From e2bd49e2e7aa86bad669e06fcac7ba1ca00396b4 Mon Sep 17 00:00:00 2001 From: Maxim Moinat Date: Wed, 3 Jan 2024 20:23:20 +0100 Subject: [PATCH] fixes #351 and fixes #354 --- inst/csv/replacementPatterns.csv | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/inst/csv/replacementPatterns.csv b/inst/csv/replacementPatterns.csv index 15e05147..914fcbd8 100644 --- a/inst/csv/replacementPatterns.csv +++ b/inst/csv/replacementPatterns.csv @@ -819,13 +819,13 @@ sqlite,"DATEADD(dd,@days,@date)","CAST(STRFTIME('%s', DATETIME(@date, 'unixepoch sqlite,"DATEADD(day,@days,@date)","CAST(STRFTIME('%s', DATETIME(@date, 'unixepoch', (@days)||' days')) AS REAL)" sqlite,"DATEADD(m,@months,@date)","CAST(STRFTIME('%s', DATETIME(@date, 'unixepoch', (@months)||' months')) AS REAL)" sqlite,"DATEADD(mm,@months,@date)","CAST(STRFTIME('%s', DATETIME(@date, 'unixepoch', (@months)||' months')) AS REAL)" -sqlite,"DATEADD(months,@months,@date)","CAST(STRFTIME('%s', DATETIME(@date, 'unixepoch', (@months)||' months')) AS REAL)" +sqlite,"DATEADD(month,@months,@date)","CAST(STRFTIME('%s', DATETIME(@date, 'unixepoch', (@months)||' months')) AS REAL)" sqlite,"DATEADD(yy,@years,@date)","CAST(STRFTIME('%s', DATETIME(@date, 'unixepoch', (@years)||' years')) AS REAL)" sqlite,"DATEADD(yyyy,@years,@date)","CAST(STRFTIME('%s', DATETIME(@date, 'unixepoch', (@years)||' years')) AS REAL)" sqlite,"DATEADD(year,@years,@date)","CAST(STRFTIME('%s', DATETIME(@date, 'unixepoch', (@years)||' years')) AS REAL)" -sqlite,"DATEDIFF(d,@start,@end)","JULIANDAY(@end, 'unixepoch') - JULIANDAY(@start, 'unixepoch')" -sqlite,"DATEDIFF(dd,@start,@end)","JULIANDAY(@end, 'unixepoch') - JULIANDAY(@start, 'unixepoch')" -sqlite,"DATEDIFF(day,@start,@end)","JULIANDAY(@end, 'unixepoch') - JULIANDAY(@start, 'unixepoch')" +sqlite,"DATEDIFF(d,@start,@end)","(JULIANDAY(@end, 'unixepoch') - JULIANDAY(@start, 'unixepoch'))" +sqlite,"DATEDIFF(dd,@start,@end)","(JULIANDAY(@end, 'unixepoch') - JULIANDAY(@start, 'unixepoch'))" +sqlite,"DATEDIFF(day,@start,@end)","(JULIANDAY(@end, 'unixepoch') - JULIANDAY(@start, 'unixepoch'))" sqlite,"DATEDIFF(year,@start, @end)","(STRFTIME('%Y', @end, 'unixepoch') - STRFTIME('%Y', @start, 'unixepoch'))" sqlite,"DATEDIFF(yyyy,@start, @end)","(STRFTIME('%Y', @end, 'unixepoch') - STRFTIME('%Y', @start, 'unixepoch'))" sqlite,"DATEDIFF(yy,@start, @end)","(STRFTIME('%Y', @end, 'unixepoch') - STRFTIME('%Y', @start, 'unixepoch'))" @@ -1089,10 +1089,6 @@ spark,"DATEDIFF(dd,@start, @end)","datediff(@end,@start)" spark,"DATEDIFF(day,@start, @end)","datediff(@end,@start)" spark,"CONVERT(VARCHAR,@date,112)","@date" spark,GETDATE(),CURRENT_DATE -spark,"+ LEFT(@str,@chars)","SUBSTR(@str,@chars)" -spark,"LEFT(@str,@chars)","SUBSTR(@str,@chars)" -spark,"+ RIGHT(@str,@chars)","|| SUBSTR(@str,-@chars)" -spark,"RIGHT(@str,@chars)","SUBSTR(@str,-@chars)" spark,CAST(@a AS varchar(@b)) +,"SUBSTRING(CAST(@a AS string), 0, @b) ||" spark,+ CAST(@a AS varchar(@b)),"|| SUBSTRING(CAST(@a AS string), 0, @b)" spark,CAST(@a AS varchar) +,CAST(@a AS string) ||