From 0a01cb2cb2566d99f98e2084ad4d3121047fc7c5 Mon Sep 17 00:00:00 2001 From: gs-jp1 <80327721+gs-jp1@users.noreply.github.com> Date: Thu, 14 Dec 2023 21:05:28 +0000 Subject: [PATCH] memsql - repeatString and char impl --- .../relational/sqlQueryToString/memSQLExtension.pure | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-memsql/legend-engine-xt-relationalStore-memsql-pure/src/main/resources/core_relational_memsql/relational/sqlQueryToString/memSQLExtension.pure b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-memsql/legend-engine-xt-relationalStore-memsql-pure/src/main/resources/core_relational_memsql/relational/sqlQueryToString/memSQLExtension.pure index f4c1e3fd6b2..7fea40450ee 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-memsql/legend-engine-xt-relationalStore-memsql-pure/src/main/resources/core_relational_memsql/relational/sqlQueryToString/memSQLExtension.pure +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-memsql/legend-engine-xt-relationalStore-memsql-pure/src/main/resources/core_relational_memsql/relational/sqlQueryToString/memSQLExtension.pure @@ -79,7 +79,8 @@ function <> meta::relational::functions::sqlQueryToString::memsq dynaFnToSql('adjust', $allStates, ^ToSql(format='adddate(%s)', transform={p:String[3] | $p->at(0) + ', INTERVAL ' + $p->at(1) + ' ' + $p->at(2)->mapToDBUnitType()})), dynaFnToSql('atan2', $allStates, ^ToSql(format='atan2(%s,%s)')), dynaFnToSql('booland', $allStates, ^ToSql(format='every(%s)')), - dynaFnToSql('boolor', $allStates, ^ToSql(format='any(%s)')), + dynaFnToSql('boolor', $allStates, ^ToSql(format='any(%s)')), + dynaFnToSql('char', $allStates, ^ToSql(format='char(%s)')), dynaFnToSql('concat', $allStates, ^ToSql(format='concat%s', transform={p:String[*]|$p->joinStrings('(', ', ', ')')})), dynaFnToSql('convertDate', $allStates, ^ToSql(format='%s', transform={p:String[*] | $p->convertToDateMemSQL()})), dynaFnToSql('convertVarchar128', $allStates, ^ToSql(format='convert(%s, CHAR)')), @@ -122,7 +123,8 @@ function <> meta::relational::functions::sqlQueryToString::memsq dynaFnToSql('previousDayOfWeek', $allStates, ^ToSql(format='adddate(%s, INTERVAL case when %s - dayofweek(%s) >= 0 then %s - dayofweek(%s) - 7 else %s - dayofweek(%s) end DAY)', transform={p:String[1..2] | $p->formatMostRecentMemSQL('curdate()')}, parametersWithinWhenClause = [false, false])), dynaFnToSql('quarter', $allStates, ^ToSql(format='quarter(%s)')), dynaFnToSql('quarterNumber', $allStates, ^ToSql(format='quarter(%s)')), - dynaFnToSql('rem', $allStates, ^ToSql(format='mod(%s, %s)')), + dynaFnToSql('rem', $allStates, ^ToSql(format='mod(%s, %s)')), + dynaFnToSql('repeatString', $allStates, ^ToSql(format='%s', transform={p:String[2] | 'lpad(\'\', length(' + $p->at(0) + ') * ' + $p->at(1) + ', ' + $p->at(0) + ')'})), dynaFnToSql('right', $allStates, ^ToSql(format='right(%s, %s)')), dynaFnToSql('round', $allStates, ^ToSql(format='round(%s, %s)', transform=transformRound_String_MANY__String_MANY_)), dynaFnToSql('rtrim', $allStates, ^ToSql(format='rtrim(%s)')),