-
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.
fix(clickhouse): generate redundant aliases to workaround clickhouse …
…naming behavior (#9525) Found during #9508. This PR works around an apparent upstream bug in ClickHouse where right-side join operand column references are not correctly recognized.
- Loading branch information
Showing
37 changed files
with
310 additions
and
249 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
2 changes: 1 addition & 1 deletion
2
ibis/backends/clickhouse/tests/snapshots/test_functions/test_cast_double_col/float/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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
SELECT | ||
"t0"."double_col" | ||
"t0"."double_col" AS "double_col" | ||
FROM "functional_alltypes" AS "t0" |
2 changes: 1 addition & 1 deletion
2
ibis/backends/clickhouse/tests/snapshots/test_functions/test_noop_cast/bigint_col/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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
SELECT | ||
"t0"."bigint_col" | ||
"t0"."bigint_col" AS "bigint_col" | ||
FROM "functional_alltypes" AS "t0" |
2 changes: 1 addition & 1 deletion
2
ibis/backends/clickhouse/tests/snapshots/test_functions/test_noop_cast/bool_col/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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
SELECT | ||
"t0"."bool_col" | ||
"t0"."bool_col" AS "bool_col" | ||
FROM "functional_alltypes" AS "t0" |
2 changes: 1 addition & 1 deletion
2
...backends/clickhouse/tests/snapshots/test_functions/test_noop_cast/date_string_col/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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
SELECT | ||
"t0"."date_string_col" | ||
"t0"."date_string_col" AS "date_string_col" | ||
FROM "functional_alltypes" AS "t0" |
2 changes: 1 addition & 1 deletion
2
ibis/backends/clickhouse/tests/snapshots/test_functions/test_noop_cast/double_col/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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
SELECT | ||
"t0"."double_col" | ||
"t0"."double_col" AS "double_col" | ||
FROM "functional_alltypes" AS "t0" |
2 changes: 1 addition & 1 deletion
2
ibis/backends/clickhouse/tests/snapshots/test_functions/test_noop_cast/float_col/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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
SELECT | ||
"t0"."float_col" | ||
"t0"."float_col" AS "float_col" | ||
FROM "functional_alltypes" AS "t0" |
2 changes: 1 addition & 1 deletion
2
ibis/backends/clickhouse/tests/snapshots/test_functions/test_noop_cast/id/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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
SELECT | ||
"t0"."id" | ||
"t0"."id" AS "id" | ||
FROM "functional_alltypes" AS "t0" |
2 changes: 1 addition & 1 deletion
2
ibis/backends/clickhouse/tests/snapshots/test_functions/test_noop_cast/int_col/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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
SELECT | ||
"t0"."int_col" | ||
"t0"."int_col" AS "int_col" | ||
FROM "functional_alltypes" AS "t0" |
2 changes: 1 addition & 1 deletion
2
ibis/backends/clickhouse/tests/snapshots/test_functions/test_noop_cast/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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
SELECT | ||
"t0"."month" | ||
"t0"."month" AS "month" | ||
FROM "functional_alltypes" AS "t0" |
2 changes: 1 addition & 1 deletion
2
ibis/backends/clickhouse/tests/snapshots/test_functions/test_noop_cast/smallint_col/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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
SELECT | ||
"t0"."smallint_col" | ||
"t0"."smallint_col" AS "smallint_col" | ||
FROM "functional_alltypes" AS "t0" |
2 changes: 1 addition & 1 deletion
2
ibis/backends/clickhouse/tests/snapshots/test_functions/test_noop_cast/string_col/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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
SELECT | ||
"t0"."string_col" | ||
"t0"."string_col" AS "string_col" | ||
FROM "functional_alltypes" AS "t0" |
2 changes: 1 addition & 1 deletion
2
ibis/backends/clickhouse/tests/snapshots/test_functions/test_noop_cast/timestamp_col/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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
SELECT | ||
"t0"."timestamp_col" | ||
"t0"."timestamp_col" AS "timestamp_col" | ||
FROM "functional_alltypes" AS "t0" |
2 changes: 1 addition & 1 deletion
2
ibis/backends/clickhouse/tests/snapshots/test_functions/test_noop_cast/tinyint_col/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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
SELECT | ||
"t0"."tinyint_col" | ||
"t0"."tinyint_col" AS "tinyint_col" | ||
FROM "functional_alltypes" AS "t0" |
2 changes: 1 addition & 1 deletion
2
ibis/backends/clickhouse/tests/snapshots/test_functions/test_noop_cast/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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
SELECT | ||
"t0"."year" | ||
"t0"."year" AS "year" | ||
FROM "functional_alltypes" AS "t0" |
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
16 changes: 8 additions & 8 deletions
16
ibis/backends/clickhouse/tests/snapshots/test_select/test_complex_join/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
2 changes: 1 addition & 1 deletion
2
ibis/backends/clickhouse/tests/snapshots/test_select/test_count_name/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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
SELECT | ||
"t0"."a", | ||
"t0"."a" AS "a", | ||
COALESCE(countIf(NOT ( | ||
"t0"."b" | ||
)), 0) AS "A", | ||
|
26 changes: 13 additions & 13 deletions
26
ibis/backends/clickhouse/tests/snapshots/test_select/test_join_self_reference/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 |
---|---|---|
@@ -1,17 +1,17 @@ | ||
SELECT | ||
"t1"."id", | ||
"t1"."bool_col", | ||
"t1"."tinyint_col", | ||
"t1"."smallint_col", | ||
"t1"."int_col", | ||
"t1"."bigint_col", | ||
"t1"."float_col", | ||
"t1"."double_col", | ||
"t1"."date_string_col", | ||
"t1"."string_col", | ||
"t1"."timestamp_col", | ||
"t1"."year", | ||
"t1"."month" | ||
"t1"."id" AS "id", | ||
"t1"."bool_col" AS "bool_col", | ||
"t1"."tinyint_col" AS "tinyint_col", | ||
"t1"."smallint_col" AS "smallint_col", | ||
"t1"."int_col" AS "int_col", | ||
"t1"."bigint_col" AS "bigint_col", | ||
"t1"."float_col" AS "float_col", | ||
"t1"."double_col" AS "double_col", | ||
"t1"."date_string_col" AS "date_string_col", | ||
"t1"."string_col" AS "string_col", | ||
"t1"."timestamp_col" AS "timestamp_col", | ||
"t1"."year" AS "year", | ||
"t1"."month" AS "month" | ||
FROM "functional_alltypes" AS "t1" | ||
INNER JOIN "functional_alltypes" AS "t2" | ||
ON "t1"."id" = "t2"."id" |
2 changes: 1 addition & 1 deletion
2
ibis/backends/clickhouse/tests/snapshots/test_select/test_named_from_filter_groupby/out1.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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
SELECT | ||
"t1"."key", | ||
"t1"."key" AS "key", | ||
SUM(( | ||
( | ||
"t1"."value" + 1 | ||
|
2 changes: 1 addition & 1 deletion
2
ibis/backends/clickhouse/tests/snapshots/test_select/test_named_from_filter_groupby/out2.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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
SELECT | ||
"t1"."key", | ||
"t1"."key" AS "key", | ||
SUM(( | ||
( | ||
"t1"."value" + 1 | ||
|
44 changes: 22 additions & 22 deletions
44
...use/tests/snapshots/test_select/test_simple_joins/playerID-awardID-any_inner_join/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 |
---|---|---|
@@ -1,26 +1,26 @@ | ||
SELECT | ||
"t2"."playerID", | ||
"t2"."yearID", | ||
"t2"."stint", | ||
"t2"."teamID", | ||
"t2"."lgID", | ||
"t2"."G", | ||
"t2"."AB", | ||
"t2"."R", | ||
"t2"."H", | ||
"t2"."X2B", | ||
"t2"."X3B", | ||
"t2"."HR", | ||
"t2"."RBI", | ||
"t2"."SB", | ||
"t2"."CS", | ||
"t2"."BB", | ||
"t2"."SO", | ||
"t2"."IBB", | ||
"t2"."HBP", | ||
"t2"."SH", | ||
"t2"."SF", | ||
"t2"."GIDP" | ||
"t2"."playerID" AS "playerID", | ||
"t2"."yearID" AS "yearID", | ||
"t2"."stint" AS "stint", | ||
"t2"."teamID" AS "teamID", | ||
"t2"."lgID" AS "lgID", | ||
"t2"."G" AS "G", | ||
"t2"."AB" AS "AB", | ||
"t2"."R" AS "R", | ||
"t2"."H" AS "H", | ||
"t2"."X2B" AS "X2B", | ||
"t2"."X3B" AS "X3B", | ||
"t2"."HR" AS "HR", | ||
"t2"."RBI" AS "RBI", | ||
"t2"."SB" AS "SB", | ||
"t2"."CS" AS "CS", | ||
"t2"."BB" AS "BB", | ||
"t2"."SO" AS "SO", | ||
"t2"."IBB" AS "IBB", | ||
"t2"."HBP" AS "HBP", | ||
"t2"."SH" AS "SH", | ||
"t2"."SF" AS "SF", | ||
"t2"."GIDP" AS "GIDP" | ||
FROM "batting" AS "t2" | ||
ANY JOIN "awards_players" AS "t3" | ||
ON "t2"."playerID" = "t3"."awardID" |
44 changes: 22 additions & 22 deletions
44
...ouse/tests/snapshots/test_select/test_simple_joins/playerID-awardID-any_left_join/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 |
---|---|---|
@@ -1,26 +1,26 @@ | ||
SELECT | ||
"t2"."playerID", | ||
"t2"."yearID", | ||
"t2"."stint", | ||
"t2"."teamID", | ||
"t2"."lgID", | ||
"t2"."G", | ||
"t2"."AB", | ||
"t2"."R", | ||
"t2"."H", | ||
"t2"."X2B", | ||
"t2"."X3B", | ||
"t2"."HR", | ||
"t2"."RBI", | ||
"t2"."SB", | ||
"t2"."CS", | ||
"t2"."BB", | ||
"t2"."SO", | ||
"t2"."IBB", | ||
"t2"."HBP", | ||
"t2"."SH", | ||
"t2"."SF", | ||
"t2"."GIDP" | ||
"t2"."playerID" AS "playerID", | ||
"t2"."yearID" AS "yearID", | ||
"t2"."stint" AS "stint", | ||
"t2"."teamID" AS "teamID", | ||
"t2"."lgID" AS "lgID", | ||
"t2"."G" AS "G", | ||
"t2"."AB" AS "AB", | ||
"t2"."R" AS "R", | ||
"t2"."H" AS "H", | ||
"t2"."X2B" AS "X2B", | ||
"t2"."X3B" AS "X3B", | ||
"t2"."HR" AS "HR", | ||
"t2"."RBI" AS "RBI", | ||
"t2"."SB" AS "SB", | ||
"t2"."CS" AS "CS", | ||
"t2"."BB" AS "BB", | ||
"t2"."SO" AS "SO", | ||
"t2"."IBB" AS "IBB", | ||
"t2"."HBP" AS "HBP", | ||
"t2"."SH" AS "SH", | ||
"t2"."SF" AS "SF", | ||
"t2"."GIDP" AS "GIDP" | ||
FROM "batting" AS "t2" | ||
LEFT ANY JOIN "awards_players" AS "t3" | ||
ON "t2"."playerID" = "t3"."awardID" |
44 changes: 22 additions & 22 deletions
44
...ckhouse/tests/snapshots/test_select/test_simple_joins/playerID-awardID-inner_join/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 |
---|---|---|
@@ -1,26 +1,26 @@ | ||
SELECT | ||
"t2"."playerID", | ||
"t2"."yearID", | ||
"t2"."stint", | ||
"t2"."teamID", | ||
"t2"."lgID", | ||
"t2"."G", | ||
"t2"."AB", | ||
"t2"."R", | ||
"t2"."H", | ||
"t2"."X2B", | ||
"t2"."X3B", | ||
"t2"."HR", | ||
"t2"."RBI", | ||
"t2"."SB", | ||
"t2"."CS", | ||
"t2"."BB", | ||
"t2"."SO", | ||
"t2"."IBB", | ||
"t2"."HBP", | ||
"t2"."SH", | ||
"t2"."SF", | ||
"t2"."GIDP" | ||
"t2"."playerID" AS "playerID", | ||
"t2"."yearID" AS "yearID", | ||
"t2"."stint" AS "stint", | ||
"t2"."teamID" AS "teamID", | ||
"t2"."lgID" AS "lgID", | ||
"t2"."G" AS "G", | ||
"t2"."AB" AS "AB", | ||
"t2"."R" AS "R", | ||
"t2"."H" AS "H", | ||
"t2"."X2B" AS "X2B", | ||
"t2"."X3B" AS "X3B", | ||
"t2"."HR" AS "HR", | ||
"t2"."RBI" AS "RBI", | ||
"t2"."SB" AS "SB", | ||
"t2"."CS" AS "CS", | ||
"t2"."BB" AS "BB", | ||
"t2"."SO" AS "SO", | ||
"t2"."IBB" AS "IBB", | ||
"t2"."HBP" AS "HBP", | ||
"t2"."SH" AS "SH", | ||
"t2"."SF" AS "SF", | ||
"t2"."GIDP" AS "GIDP" | ||
FROM "batting" AS "t2" | ||
INNER JOIN "awards_players" AS "t3" | ||
ON "t2"."playerID" = "t3"."awardID" |
Oops, something went wrong.