-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
88 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
-- pending: sqlite3 No array support. | ||
|
||
CREATE OR REPLACE TABLE __result1 AS | ||
SELECT | ||
[] AS empty_array, | ||
[1, 2, 3] AS int64_array, | ||
['a', 'b', 'c'] AS string_array, | ||
ARRAY<INT64>[] AS empty_array_typed, | ||
ARRAY<INT64>[1, 2, 3] AS int64_array_typed, | ||
ARRAY(1, 2, 3) AS int64_array_typed2, | ||
ARRAY_LENGTH([1,2]) AS array_len; | ||
|
||
CREATE OR REPLACE TABLE __expected1 ( | ||
empty_array ARRAY<INT64>, | ||
int64_array ARRAY<INT64>, | ||
string_array ARRAY<STRING>, | ||
empty_array_typed ARRAY<INT64>, | ||
int64_array_typed ARRAY<INT64>, | ||
int64_array_typed2 ARRAY<INT64>, | ||
array_len INT64, | ||
); | ||
-- Snowflake does not allow array constants in VALUES. | ||
INSERT INTO __expected1 | ||
SELECT [], [1, 2, 3], ['a', 'b', 'c'], [], [1, 2, 3], [1, 2, 3], 2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
-- pending: sqlite3 Arrays are not available. | ||
|
||
CREATE TEMP TABLE array_agg_data (grp STRING, idx INT64, x INT64); | ||
INSERT INTO array_agg_data | ||
VALUES ('a', 1, 1), ('a', 2, 1), ('a', 3, 2), ('a', 4, 0); | ||
|
||
CREATE OR REPLACE TABLE __result1 AS | ||
SELECT grp, ARRAY_AGG(x) AS arr | ||
FROM ( | ||
SELECT grp, x | ||
FROM array_agg_data | ||
ORDER BY idx | ||
) | ||
GROUP BY grp; | ||
|
||
CREATE OR REPLACE TABLE __expected1 ( | ||
grp STRING, | ||
arr ARRAY<INT64>, | ||
); | ||
-- Snowflake does not allow array constants in VALUES. | ||
INSERT INTO __expected1 | ||
SELECT 'a', [1, 1, 2, 0]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
-- pending: sqlite3 Array functions are not available. | ||
-- | ||
-- ARRAY_TO_STRING | ||
|
||
CREATE OR REPLACE TABLE __result1 AS | ||
SELECT | ||
ARRAY_TO_STRING([1, 2, 3], ',') AS array_int_to_string, | ||
ARRAY_TO_STRING(['a', 'b', 'c'], ',') AS array_string_to_string; | ||
|
||
CREATE OR REPLACE TABLE __expected1 ( | ||
array_int_to_string STRING, | ||
array_string_to_string STRING, | ||
); | ||
INSERT INTO __expected1 VALUES | ||
('1,2,3', 'a,b,c'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
-- pending: sqlite3 No array support. | ||
|
||
-- We pre-declare this table to avoid SELECT creating a VARIANT column, which | ||
-- breaks our Snowflake test driver (though it appears to store correctly). | ||
CREATE OR REPLACE TABLE __result1 (v INT64); | ||
INSERT INTO __result1 | ||
SELECT | ||
[1,2][1] AS array_index; | ||
|
||
CREATE OR REPLACE TABLE __expected1 (v INT64); | ||
INSERT INTO __expected1 VALUES | ||
(2); |