-
Notifications
You must be signed in to change notification settings - Fork 608
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(flink): add tests and translation rules for additional operators
- Loading branch information
Showing
19 changed files
with
202 additions
and
30 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
5 changes: 5 additions & 0 deletions
5
...ackends/flink/tests/snapshots/test_translator/test_translate_complex_filtered_agg/out.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,5 @@ | ||
SELECT t0.`b`, count(*) AS `total`, avg(t0.`a`) AS `avg_a`, | ||
avg(CASE WHEN t0.`g` = 'A' THEN t0.`a` ELSE NULL END) AS `avg_a_A`, | ||
avg(CASE WHEN t0.`g` = 'B' THEN t0.`a` ELSE NULL END) AS `avg_a_B` | ||
FROM table t0 | ||
GROUP BY t0.`b` |
5 changes: 5 additions & 0 deletions
5
.../flink/tests/snapshots/test_translator/test_translate_complex_groupby_aggregation/out.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,5 @@ | ||
SELECT EXTRACT(year from t0.`i`) AS `year`, | ||
EXTRACT(month from t0.`i`) AS `month`, count(*) AS `total`, | ||
count(DISTINCT t0.`b`) AS `b_unique` | ||
FROM table t0 | ||
GROUP BY EXTRACT(year from t0.`i`), EXTRACT(month from t0.`i`) |
7 changes: 7 additions & 0 deletions
7
...backends/flink/tests/snapshots/test_translator/test_translate_complex_projections/out.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,7 @@ | ||
SELECT t0.`a`, avg(abs(t0.`the_sum`)) AS `mad` | ||
FROM ( | ||
SELECT t1.`a`, t1.`c`, sum(t1.`b`) AS `the_sum` | ||
FROM table t1 | ||
GROUP BY t1.`a`, t1.`c` | ||
) t0 | ||
GROUP BY t0.`a` |
2 changes: 2 additions & 0 deletions
2
.../backends/flink/tests/snapshots/test_translator/test_translate_extract_fields/day/out.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,2 @@ | ||
SELECT EXTRACT(day from t0.`i`) AS `tmp` | ||
FROM table t0 |
2 changes: 2 additions & 0 deletions
2
...s/flink/tests/snapshots/test_translator/test_translate_extract_fields/day_of_year/out.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,2 @@ | ||
SELECT EXTRACT(doy from t0.`i`) AS `tmp` | ||
FROM table t0 |
2 changes: 2 additions & 0 deletions
2
...backends/flink/tests/snapshots/test_translator/test_translate_extract_fields/hour/out.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,2 @@ | ||
SELECT EXTRACT(hour from t0.`i`) AS `tmp` | ||
FROM table t0 |
2 changes: 2 additions & 0 deletions
2
...ckends/flink/tests/snapshots/test_translator/test_translate_extract_fields/minute/out.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,2 @@ | ||
SELECT EXTRACT(minute from t0.`i`) AS `tmp` | ||
FROM table t0 |
2 changes: 2 additions & 0 deletions
2
...ackends/flink/tests/snapshots/test_translator/test_translate_extract_fields/month/out.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,2 @@ | ||
SELECT EXTRACT(month from t0.`i`) AS `tmp` | ||
FROM table t0 |
2 changes: 2 additions & 0 deletions
2
...kends/flink/tests/snapshots/test_translator/test_translate_extract_fields/quarter/out.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,2 @@ | ||
SELECT EXTRACT(quarter from t0.`i`) AS `tmp` | ||
FROM table t0 |
2 changes: 2 additions & 0 deletions
2
...ckends/flink/tests/snapshots/test_translator/test_translate_extract_fields/second/out.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,2 @@ | ||
SELECT EXTRACT(second from t0.`i`) AS `tmp` | ||
FROM table t0 |
2 changes: 2 additions & 0 deletions
2
.../flink/tests/snapshots/test_translator/test_translate_extract_fields/week_of_year/out.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,2 @@ | ||
SELECT EXTRACT(week from t0.`i`) AS `tmp` | ||
FROM table t0 |
2 changes: 2 additions & 0 deletions
2
...backends/flink/tests/snapshots/test_translator/test_translate_extract_fields/year/out.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,2 @@ | ||
SELECT EXTRACT(year from t0.`i`) AS `tmp` | ||
FROM table t0 |
4 changes: 4 additions & 0 deletions
4
ibis/backends/flink/tests/snapshots/test_translator/test_translate_filter/out.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,4 @@ | ||
SELECT t0.* | ||
FROM table t0 | ||
WHERE ((t0.`c` > 0) OR (t0.`c` < 0)) AND | ||
(t0.`g` IN ('A', 'B')) |
4 changes: 4 additions & 0 deletions
4
ibis/backends/flink/tests/snapshots/test_translator/test_translate_having/out.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,4 @@ | ||
SELECT t0.`g`, sum(t0.`b`) AS `b_sum` | ||
FROM table t0 | ||
GROUP BY t0.`g` | ||
HAVING count(*) >= 1000 |
2 changes: 2 additions & 0 deletions
2
...backends/flink/tests/snapshots/test_translator/test_translate_simple_filtered_agg/out.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,2 @@ | ||
SELECT count(DISTINCT CASE WHEN t0.`g` = 'A' THEN t0.`b` ELSE NULL END) AS `CountDistinct(b, Equals(g, 'A'))` | ||
FROM table t0 |
6 changes: 6 additions & 0 deletions
6
ibis/backends/flink/tests/snapshots/test_translator/test_translate_value_counts/out.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,6 @@ | ||
SELECT t0.`ExtractYear(i)`, count(*) AS `ExtractYear(i)_count` | ||
FROM ( | ||
SELECT EXTRACT(year from t1.`i`) AS `ExtractYear(i)` | ||
FROM table t1 | ||
) t0 | ||
GROUP BY t0.`ExtractYear(i)` |
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