Skip to content

Commit

Permalink
infer: Make sure SQL tests pass on Snowflake, too
Browse files Browse the repository at this point in the history
  • Loading branch information
emk committed Nov 6, 2023
1 parent d25839f commit 6c4dfbe
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/scope.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ GENERATE_DATE_ARRAY = Fn(DATE, DATE, INTERVAL) -> ARRAY<DATE>;
GENERATE_UUID = Fn() -> STRING;
GREATEST = Fn<?T>(?T, ..?T) -> ?T;
LAG = FnOver<?T>(Agg<?T>) -> ?T;
LAST_VALUE = FnOver<?T>(Agg<?T>) -> ?T;
LEAST = Fn<?T>(?T, ..?T) -> ?T;
LENGTH = Fn(STRING) -> INT64 | Fn(BYTES) -> INT64;
LOWER = Fn(STRING) -> STRING;
Expand Down
2 changes: 2 additions & 0 deletions tests/sql/functions/aggregate/ansi.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
-- pending: snowflake Need to force AVG(INT64|FLOAT64) to return FLOAT64, not DECIMAL
--
-- ANSI standard aggregate functions: AVG, COUNT, MAX, MIN, SUM

CREATE TEMP TABLE ints (i INT64);
Expand Down
10 changes: 5 additions & 5 deletions tests/sql/functions/simple/strings.sql
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
-- pending: trino CONCAT doesn't coerce other types to STRING.
--
-- LOWER, UPPER, TRIM, CONCAT
CREATE OR REPLACE TABLE __result1 AS
SELECT
LOWER('FOO') AS lower,
UPPER('foo') AS upper,
TRIM(' foo ') AS trimmed,
CONCAT('foo', 'bar') AS concat,
CONCAT('x', 1) concat_casted,
-- We have decided not to support this for now, because it requires casting
-- all types _except_ BINARY.
--
-- CONCAT('x', 1) concat_casted,
CONCAT('x', NULL) concat_null;

CREATE OR REPLACE TABLE __expected1 (
lower STRING,
upper STRING,
trimmed STRING,
concat STRING,
concat_casted STRING,
concat_null STRING,
);
INSERT INTO __expected1 VALUES
('foo', 'FOO', 'foo', 'foobar', 'x1', NULL);
('foo', 'FOO', 'foo', 'foobar', NULL);

0 comments on commit 6c4dfbe

Please sign in to comment.