-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Andreas Reichel <[email protected]>
- Loading branch information
1 parent
a4491aa
commit e74bd0d
Showing
8 changed files
with
168 additions
and
32 deletions.
There are no files selected for viewing
Binary file not shown.
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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
#Wed Mar 13 14:27:42 ICT 2024 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip | ||
networkTimeout=10000 | ||
validateDistributionUrl=true | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
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
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
Binary file not shown.
69 changes: 69 additions & 0 deletions
69
src/test/resources/ai/starlake/transpiler/databricks/array_function.sql
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,69 @@ | ||
-- provided | ||
SELECT a[2] AS e FROM VALUES(array(10, 20, 30)) AS T(a); | ||
|
||
-- expected | ||
SELECT a[2+1] AS e FROM VALUES([10, 20, 30]) AS T(a); | ||
|
||
-- result | ||
"e" | ||
"30" | ||
|
||
|
||
-- provided | ||
SELECT array(1, 2, 3) AS arr; | ||
|
||
-- expected | ||
SELECT [1, 2, 3] AS arr; | ||
|
||
-- result | ||
"arr" | ||
"[1, 2, 3]" | ||
|
||
|
||
-- provided | ||
SELECT array_append(array(1, 2, 3), 0) AS arr; | ||
|
||
-- expected | ||
SELECT [1, 2, 3] || [0] AS arr; | ||
|
||
-- result | ||
"arr" | ||
"[1, 2, 3, 0]" | ||
|
||
|
||
-- provided | ||
SELECT array_compact(array(1, 2, NULL, 3, NULL, 3)) AS arr; | ||
|
||
-- expected | ||
SELECT list_filter([1, 2, NULL, 3, NULL, 3], x -> x IS NOT NULL) AS arr; | ||
|
||
-- result | ||
"arr" | ||
"[1, 2, 3, 3]" | ||
|
||
|
||
-- provided | ||
SELECT array_contains([1, 2, 3], 2) AS b; | ||
|
||
-- result | ||
"b" | ||
"true" | ||
|
||
|
||
-- provided | ||
SELECT array_distinct([1, 2, 3, NULL, 3]) AS arr; | ||
|
||
-- result | ||
"arr" | ||
"[3, 2, 1]" | ||
|
||
|
||
-- provided | ||
SELECT array_except([1, 2, 2, 3], [1, 1, 3, 5]) AS arr; | ||
|
||
-- expected | ||
SELECT list_distinct(list_filter([1, 2, 2, 3], x -> NOT array_contains(list_intersect([1, 2, 2, 3], [1, 1, 3, 5]), x) )) AS arr; | ||
|
||
-- result | ||
"arr" | ||
"[2]" |