Skip to content

Commit

Permalink
Fix round function SQL translation for Snowflake (#2958)
Browse files Browse the repository at this point in the history
  • Loading branch information
gs-ssh16 authored Jul 12, 2024
1 parent 2d2395e commit 679eede
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ function <<access.private>> meta::relational::functions::sqlQueryToString::snowf
dynaFnToSql('previousDayOfWeek', $allStates, ^ToSql(format='dateadd(DAY, case when %s - DAYOFWEEK(%s) +1 >= 0 then %s - DAYOFWEEK(%s) -1 - 7 else %s - DAYOFWEEK(%s) -1 end, %s)', transform={p:String[1..2] | $p->formatMostRecentSnowflake('current_date')}, parametersWithinWhenClause = [false, false])),
dynaFnToSql('quarter', $allStates, ^ToSql(format='quarter(%s)')),
dynaFnToSql('quarterNumber', $allStates, ^ToSql(format='quarter(%s)')),
dynaFnToSql('round', $allStates, ^ToSql(format='round((%s)::numeric, %s)', transform=transformRound_String_MANY__String_MANY_)),
dynaFnToSql('round', $allStates, ^ToSql(format='round(%s, %s)', transform=transformRound_String_MANY__String_MANY_)),
dynaFnToSql('startsWith', $allStates, ^ToSql(format='startswith(%s,%s)', transform={p:String[2]|$p})),
dynaFnToSql('second', $allStates, ^ToSql(format='second(%s)')),
dynaFnToSql('sha256', $allStates, ^ToSql(format='sha2(%s, 256)')),
Expand Down

0 comments on commit 679eede

Please sign in to comment.