diff options
Diffstat (limited to 'tests/fixtures')
-rw-r--r-- | tests/fixtures/identity.sql | 15 | ||||
-rw-r--r-- | tests/fixtures/optimizer/simplify.sql | 3 |
2 files changed, 8 insertions, 10 deletions
diff --git a/tests/fixtures/identity.sql b/tests/fixtures/identity.sql index 54d41b4..366b79e 100644 --- a/tests/fixtures/identity.sql +++ b/tests/fixtures/identity.sql @@ -158,7 +158,7 @@ CAST(x AS UUID) FILTER(a, x -> x.a.b.c.d.e.f.g) FILTER(a, x -> FOO(x.a.b.c.d.e.f.g) + x.a.b.c.d.e.f.g) TIMESTAMP_FROM_PARTS(2019, 1, 10, 2, 3, 4, 123456789, 'America/Los_Angeles') -TIMESTAMP_DIFF(CURRENT_TIMESTAMP(), 1, DAY) +TIMESTAMPDIFF(CURRENT_TIMESTAMP(), 1, DAY) DATETIME_DIFF(CURRENT_DATE, 1, DAY) QUANTILE(x, 0.5) REGEXP_REPLACE('new york', '(\w)(\w*)', x -> UPPER(x[1]) || LOWER(x[2])) @@ -237,13 +237,8 @@ SELECT AGGREGATE(a, (a, b) -> a + b) AS x SELECT COUNT(DISTINCT a, b) SELECT COUNT(DISTINCT a, b + 1) SELECT SUM(DISTINCT x) -SELECT SUM(x IGNORE NULLS) AS x -SELECT COUNT(x RESPECT NULLS) SELECT TRUNCATE(a, b) -SELECT ARRAY_AGG(DISTINCT x IGNORE NULLS ORDER BY a, b DESC LIMIT 10) AS x -SELECT ARRAY_AGG(DISTINCT x IGNORE NULLS ORDER BY a, b DESC LIMIT 1, 10) AS x SELECT ARRAY_AGG(STRUCT(x, x AS y) ORDER BY z DESC) AS x -SELECT LAST_VALUE(x IGNORE NULLS) OVER y AS x SELECT LAG(x) OVER (ORDER BY y) AS x SELECT LEAD(a) OVER (ORDER BY b) AS a SELECT LEAD(a, 1) OVER (PARTITION BY a ORDER BY a) AS x @@ -361,9 +356,10 @@ SELECT COUNT(DISTINCT a) FROM test SELECT EXP(a) FROM test SELECT FLOOR(a) FROM test SELECT FLOOR(a, b) FROM test -SELECT FIRST(a) FROM test +SELECT FIRST_VALUE(a) FROM test SELECT GREATEST(a, b, c) FROM test -SELECT LAST(a) FROM test +SELECT LAST_VALUE(a) FROM test +SELECT LAST_VALUE(a) IGNORE NULLS OVER () + 1 SELECT LN(a) FROM test SELECT LOG10(a) FROM test SELECT MAX(a) FROM test @@ -825,8 +821,6 @@ SELECT if.x SELECT NEXT VALUE FOR db.schema.sequence_name SELECT NEXT VALUE FOR db.schema.sequence_name OVER (ORDER BY foo), col SELECT PERCENTILE_CONT(x, 0.5) OVER () -SELECT PERCENTILE_CONT(x, 0.5 RESPECT NULLS) OVER () -SELECT PERCENTILE_CONT(x, 0.5 IGNORE NULLS) OVER () WITH my_cte AS (SELECT 'a' AS desc) SELECT desc AS description FROM my_cte WITH my_cte AS (SELECT 'a' AS asc) SELECT asc AS description FROM my_cte SELECT * FROM case @@ -852,3 +846,4 @@ SELECT x FROM t1 UNION ALL SELECT x FROM t2 UNION ALL SELECT x FROM t3 LIMIT 1 WITH use(use) AS (SELECT 1) SELECT use FROM use SELECT recursive FROM t SELECT (ROW_NUMBER() OVER (PARTITION BY user ORDER BY date ASC) - ROW_NUMBER() OVER (PARTITION BY user, segment ORDER BY date ASC)) AS group_id FROM example_table +CAST(foo AS BPCHAR) diff --git a/tests/fixtures/optimizer/simplify.sql b/tests/fixtures/optimizer/simplify.sql index a80be17..da9f26d 100644 --- a/tests/fixtures/optimizer/simplify.sql +++ b/tests/fixtures/optimizer/simplify.sql @@ -756,6 +756,9 @@ CAST(CAST('2023-01-01' AS TIMESTAMP) AS DATE); COALESCE(CAST(NULL AS DATE), x); COALESCE(CAST(NULL AS DATE), x); +NOT COALESCE(x, 1) = 2 AND y = 3; +(x <> 2 OR x IS NULL) AND y = 3; + -------------------------------------- -- CONCAT -------------------------------------- |