forked from ibis-project/ibis
-
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.
perf(sql): avoid parenthesizing chains of commutative operators
- Loading branch information
Showing
31 changed files
with
331 additions
and
156 deletions.
There are no files selected for viewing
4 changes: 1 addition & 3 deletions
4
...ckhouse/tests/snapshots/test_operators/test_binary_infix_parenthesization/lambda0/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,3 @@ | ||
SELECT | ||
( | ||
"t0"."int_col" + "t0"."tinyint_col" | ||
) + "t0"."double_col" AS "Add(Add(int_col, tinyint_col), double_col)" | ||
"t0"."int_col" + "t0"."tinyint_col" + "t0"."double_col" AS "Add(Add(int_col, tinyint_col), double_col)" | ||
FROM "functional_alltypes" AS "t0" |
6 changes: 1 addition & 5 deletions
6
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
6 changes: 1 addition & 5 deletions
6
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
2 changes: 1 addition & 1 deletion
2
ibis/backends/impala/tests/snapshots/test_exprs/test_named_from_filter_group_by/abc.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 +1 @@ | ||
SELECT `t1`.`key`, SUM(((`t1`.`value` + 1) + 2) + 3) AS `abc` FROM (SELECT * FROM `t0` AS `t0` WHERE `t0`.`value` = 42) AS `t1` GROUP BY 1 | ||
SELECT `t1`.`key`, SUM(`t1`.`value` + 1 + 2 + 3) AS `abc` FROM (SELECT * FROM `t0` AS `t0` WHERE `t0`.`value` = 42) AS `t1` GROUP BY 1 |
2 changes: 1 addition & 1 deletion
2
ibis/backends/impala/tests/snapshots/test_exprs/test_named_from_filter_group_by/foo.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 +1 @@ | ||
SELECT `t1`.`key`, SUM(((`t1`.`value` + 1) + 2) + 3) AS `foo` FROM (SELECT * FROM `t0` AS `t0` WHERE `t0`.`value` = 42) AS `t1` GROUP BY 1 | ||
SELECT `t1`.`key`, SUM(`t1`.`value` + 1 + 2 + 3) AS `foo` FROM (SELECT * FROM `t0` AS `t0` WHERE `t0`.`value` = 42) AS `t1` GROUP BY 1 |
4 changes: 1 addition & 3 deletions
4
...a/tests/snapshots/test_value_exprs/test_binary_infix_parenthesization/parens_left/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,3 @@ | ||
SELECT | ||
( | ||
`t0`.`a` + `t0`.`b` | ||
) + `t0`.`c` AS `Add(Add(a, b), c)` | ||
`t0`.`a` + `t0`.`b` + `t0`.`c` AS `Add(Add(a, b), c)` | ||
FROM `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
8 changes: 8 additions & 0 deletions
8
ibis/backends/tests/sql/snapshots/test_sql/test_binop_parens/add-dateintervalD/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,8 @@ | ||
SELECT | ||
"t0"."a" + "t0"."b" + "t0"."c" AS "x" | ||
FROM "t" AS "t0" --- op(op(a, b), c); | ||
SELECT | ||
"t0"."a" + ( | ||
"t0"."b" + "t0"."c" | ||
) AS "x" | ||
FROM "t" AS "t0" --- op(a, op(b, c)); |
8 changes: 8 additions & 0 deletions
8
ibis/backends/tests/sql/snapshots/test_sql/test_binop_parens/add-int8/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,8 @@ | ||
SELECT | ||
"t0"."a" + "t0"."b" + "t0"."c" AS "x" | ||
FROM "t" AS "t0" --- op(op(a, b), c); | ||
SELECT | ||
"t0"."a" + ( | ||
"t0"."b" + "t0"."c" | ||
) AS "x" | ||
FROM "t" AS "t0" --- op(a, op(b, c)); |
8 changes: 8 additions & 0 deletions
8
ibis/backends/tests/sql/snapshots/test_sql/test_binop_parens/add-interval/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,8 @@ | ||
SELECT | ||
"t0"."a" + "t0"."b" + "t0"."c" AS "x" | ||
FROM "t" AS "t0" --- op(op(a, b), c); | ||
SELECT | ||
"t0"."a" + ( | ||
"t0"."b" + "t0"."c" | ||
) AS "x" | ||
FROM "t" AS "t0" --- op(a, op(b, c)); |
8 changes: 8 additions & 0 deletions
8
ibis/backends/tests/sql/snapshots/test_sql/test_binop_parens/add-timeinterval/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,8 @@ | ||
SELECT | ||
"t0"."a" + "t0"."b" + "t0"."c" AS "x" | ||
FROM "t" AS "t0" --- op(op(a, b), c); | ||
SELECT | ||
"t0"."a" + ( | ||
"t0"."b" + "t0"."c" | ||
) AS "x" | ||
FROM "t" AS "t0" --- op(a, op(b, c)); |
8 changes: 8 additions & 0 deletions
8
ibis/backends/tests/sql/snapshots/test_sql/test_binop_parens/add-timestampinterval/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,8 @@ | ||
SELECT | ||
"t0"."a" + "t0"."b" + "t0"."c" AS "x" | ||
FROM "t" AS "t0" --- op(op(a, b), c); | ||
SELECT | ||
"t0"."a" + ( | ||
"t0"."b" + "t0"."c" | ||
) AS "x" | ||
FROM "t" AS "t0" --- op(a, op(b, c)); |
8 changes: 8 additions & 0 deletions
8
ibis/backends/tests/sql/snapshots/test_sql/test_binop_parens/and_-bool/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,8 @@ | ||
SELECT | ||
"t0"."a" AND "t0"."b" AND "t0"."c" AS "x" | ||
FROM "t" AS "t0" --- op(op(a, b), c); | ||
SELECT | ||
"t0"."a" AND ( | ||
"t0"."b" AND "t0"."c" | ||
) AS "x" | ||
FROM "t" AS "t0" --- op(a, op(b, c)); |
8 changes: 8 additions & 0 deletions
8
ibis/backends/tests/sql/snapshots/test_sql/test_binop_parens/and_-int8/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,8 @@ | ||
SELECT | ||
"t0"."a" & "t0"."b" & "t0"."c" AS "x" | ||
FROM "t" AS "t0" --- op(op(a, b), c); | ||
SELECT | ||
"t0"."a" & ( | ||
"t0"."b" & "t0"."c" | ||
) AS "x" | ||
FROM "t" AS "t0" --- op(a, op(b, c)); |
10 changes: 10 additions & 0 deletions
10
ibis/backends/tests/sql/snapshots/test_sql/test_binop_parens/lshift-int8/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,10 @@ | ||
SELECT | ||
( | ||
"t0"."a" << "t0"."b" | ||
) << "t0"."c" AS "x" | ||
FROM "t" AS "t0" --- op(op(a, b), c); | ||
SELECT | ||
"t0"."a" << ( | ||
"t0"."b" << "t0"."c" | ||
) AS "x" | ||
FROM "t" AS "t0" --- op(a, op(b, c)); |
10 changes: 10 additions & 0 deletions
10
ibis/backends/tests/sql/snapshots/test_sql/test_binop_parens/mod-int8/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,10 @@ | ||
SELECT | ||
( | ||
"t0"."a" % "t0"."b" | ||
) % "t0"."c" AS "x" | ||
FROM "t" AS "t0" --- op(op(a, b), c); | ||
SELECT | ||
"t0"."a" % ( | ||
"t0"."b" % "t0"."c" | ||
) AS "x" | ||
FROM "t" AS "t0" --- op(a, op(b, c)); |
8 changes: 8 additions & 0 deletions
8
ibis/backends/tests/sql/snapshots/test_sql/test_binop_parens/mul-int8/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,8 @@ | ||
SELECT | ||
"t0"."a" * "t0"."b" * "t0"."c" AS "x" | ||
FROM "t" AS "t0" --- op(op(a, b), c); | ||
SELECT | ||
"t0"."a" * ( | ||
"t0"."b" * "t0"."c" | ||
) AS "x" | ||
FROM "t" AS "t0" --- op(a, op(b, c)); |
8 changes: 8 additions & 0 deletions
8
ibis/backends/tests/sql/snapshots/test_sql/test_binop_parens/mul-intervalint8/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,8 @@ | ||
SELECT | ||
"t0"."a" * "t0"."b" * "t0"."c" AS "x" | ||
FROM "t" AS "t0" --- op(op(a, b), c); | ||
SELECT | ||
"t0"."a" * ( | ||
"t0"."b" * "t0"."c" | ||
) AS "x" | ||
FROM "t" AS "t0" --- op(a, op(b, c)); |
8 changes: 8 additions & 0 deletions
8
ibis/backends/tests/sql/snapshots/test_sql/test_binop_parens/or_-bool/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,8 @@ | ||
SELECT | ||
"t0"."a" OR "t0"."b" OR "t0"."c" AS "x" | ||
FROM "t" AS "t0" --- op(op(a, b), c); | ||
SELECT | ||
"t0"."a" OR ( | ||
"t0"."b" OR "t0"."c" | ||
) AS "x" | ||
FROM "t" AS "t0" --- op(a, op(b, c)); |
Oops, something went wrong.