diff --git a/ibis/backends/base/__init__.py b/ibis/backends/base/__init__.py index 445997da3b09..8e3f825321e8 100644 --- a/ibis/backends/base/__init__.py +++ b/ibis/backends/base/__init__.py @@ -1355,7 +1355,9 @@ def connect(resource: Path | str, **kwargs: Any) -> BaseBackend: Connect to an on-disk SQLite database: >>> con = ibis.connect("sqlite://relative.db") - >>> con = ibis.connect("sqlite:///absolute/path/to/data.db") + >>> con = ibis.connect( + ... "sqlite:///absolute/path/to/data.db" + ... ) # quartodoc: +SKIP # doctest: +SKIP Connect to a PostgreSQL server: @@ -1418,10 +1420,6 @@ def connect(resource: Path | str, **kwargs: Any) -> BaseBackend: # SQLAlchemy requires a `://`, while urllib may roundtrip # `duckdb://` to `duckdb:`. Here we re-add the missing `//`. url = url.replace(":", "://", 1) - if scheme in ("duckdb", "sqlite", "pyspark"): - # SQLAlchemy wants an extra slash for URLs where the path - # maps to a relative/absolute location on the filesystem - url = url.replace(":", ":/", 1) try: backend = getattr(ibis, scheme) diff --git a/ibis/backends/base/sqlglot/compiler.py b/ibis/backends/base/sqlglot/compiler.py index db90f5ea8061..f54188c5daba 100644 --- a/ibis/backends/base/sqlglot/compiler.py +++ b/ibis/backends/base/sqlglot/compiler.py @@ -163,7 +163,7 @@ class SQLGlotCompiler(abc.ABC): no_limit_value: sge.Null | None = None """The value to use to indicate no limit.""" - quoted: bool | None = None + quoted: bool = True """Whether to always quote identifiers.""" NAN: ClassVar[sge.Expression] = sge.Cast( diff --git a/ibis/backends/base/sqlglot/datatypes.py b/ibis/backends/base/sqlglot/datatypes.py index db1bae762c9a..8ac2dbffba27 100644 --- a/ibis/backends/base/sqlglot/datatypes.py +++ b/ibis/backends/base/sqlglot/datatypes.py @@ -253,6 +253,8 @@ def _from_sqlglot_INTERVAL( else: unit = precision_or_span.this.this return dt.Interval(unit=unit, nullable=nullable) + elif isinstance(precision_or_span, sge.Var): + return dt.Interval(unit=precision_or_span.this, nullable=nullable) elif precision_or_span is None: raise com.IbisTypeError("Interval precision is None") else: diff --git a/ibis/backends/bigquery/tests/system/snapshots/test_client/test_cross_project_query/out.sql b/ibis/backends/bigquery/tests/system/snapshots/test_client/test_cross_project_query/out.sql index da12e567f6b5..819adf5b9db3 100644 --- a/ibis/backends/bigquery/tests/system/snapshots/test_client/test_cross_project_query/out.sql +++ b/ibis/backends/bigquery/tests/system/snapshots/test_client/test_cross_project_query/out.sql @@ -1,6 +1,6 @@ SELECT - t0.title, - t0.tags -FROM `bigquery-public-data`.stackoverflow.posts_questions AS t0 + `t0`.`title`, + `t0`.`tags` +FROM `bigquery-public-data`.`stackoverflow`.`posts_questions` AS `t0` WHERE - strpos(t0.tags, 'ibis') > 0 \ No newline at end of file + strpos(`t0`.`tags`, 'ibis') > 0 \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/system/snapshots/test_client/test_multiple_project_queries/out.sql b/ibis/backends/bigquery/tests/system/snapshots/test_client/test_multiple_project_queries/out.sql index 9832d461eb58..fbae8c0def18 100644 --- a/ibis/backends/bigquery/tests/system/snapshots/test_client/test_multiple_project_queries/out.sql +++ b/ibis/backends/bigquery/tests/system/snapshots/test_client/test_multiple_project_queries/out.sql @@ -1,5 +1,5 @@ SELECT - t2.title -FROM `bigquery-public-data`.stackoverflow.posts_questions AS t2 -INNER JOIN `nyc-tlc`.yellow.trips AS t3 - ON t2.tags = t3.rate_code \ No newline at end of file + `t2`.`title` +FROM `bigquery-public-data`.`stackoverflow`.`posts_questions` AS `t2` +INNER JOIN `nyc-tlc`.`yellow`.`trips` AS `t3` + ON `t2`.`tags` = `t3`.`rate_code` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/system/snapshots/test_client/test_subquery_scalar_params/out.sql b/ibis/backends/bigquery/tests/system/snapshots/test_client/test_subquery_scalar_params/out.sql index ec28287c9f13..8ecfda1c0ec8 100644 --- a/ibis/backends/bigquery/tests/system/snapshots/test_client/test_subquery_scalar_params/out.sql +++ b/ibis/backends/bigquery/tests/system/snapshots/test_client/test_subquery_scalar_params/out.sql @@ -1,19 +1,19 @@ SELECT - COUNT(t2.foo) AS count + COUNT(`t2`.`foo`) AS `count` FROM ( SELECT - t1.string_col, - SUM(t1.float_col) AS foo + `t1`.`string_col`, + SUM(`t1`.`float_col`) AS `foo` FROM ( SELECT - t0.float_col, - t0.timestamp_col, - t0.int_col, - t0.string_col - FROM `ibis-gbq`.ibis_gbq_testing.functional_alltypes AS t0 + `t0`.`float_col`, + `t0`.`timestamp_col`, + `t0`.`int_col`, + `t0`.`string_col` + FROM `ibis-gbq`.`ibis_gbq_testing`.`functional_alltypes` AS `t0` WHERE - t0.timestamp_col < datetime('2014-01-01T00:00:00') - ) AS t1 + `t0`.`timestamp_col` < datetime('2014-01-01T00:00:00') + ) AS `t1` GROUP BY 1 -) AS t2 \ No newline at end of file +) AS `t2` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_approx/filter-approx_median/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_approx/filter-approx_median/out.sql index e86bffa88a0b..8c5a9fb3f8dc 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_approx/filter-approx_median/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_approx/filter-approx_median/out.sql @@ -1,3 +1,3 @@ SELECT - approx_quantiles(IF(t0.month > 0, t0.double_col, NULL), IF(t0.month > 0, 2, NULL))[offset(1)] AS `ApproxMedian_double_col_ Greater_month_ 0` -FROM functional_alltypes AS t0 \ No newline at end of file + approx_quantiles(IF(`t0`.`month` > 0, `t0`.`double_col`, NULL), IF(`t0`.`month` > 0, 2, NULL))[offset(1)] AS `ApproxMedian_double_col_ Greater_month_ 0` +FROM `functional_alltypes` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_approx/filter-approx_nunique/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_approx/filter-approx_nunique/out.sql index 967e47b3904f..68d924daea71 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_approx/filter-approx_nunique/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_approx/filter-approx_nunique/out.sql @@ -1,3 +1,3 @@ SELECT - APPROX_COUNT_DISTINCT(IF(t0.month > 0, t0.double_col, NULL)) AS `ApproxCountDistinct_double_col_ Greater_month_ 0` -FROM functional_alltypes AS t0 \ No newline at end of file + APPROX_COUNT_DISTINCT(IF(`t0`.`month` > 0, `t0`.`double_col`, NULL)) AS `ApproxCountDistinct_double_col_ Greater_month_ 0` +FROM `functional_alltypes` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_approx/no_filter-approx_median/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_approx/no_filter-approx_median/out.sql index 8a4438fd4e83..0208a6f36a89 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_approx/no_filter-approx_median/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_approx/no_filter-approx_median/out.sql @@ -1,3 +1,3 @@ SELECT - approx_quantiles(t0.double_col, 2)[offset(1)] AS ApproxMedian_double_col -FROM functional_alltypes AS t0 \ No newline at end of file + approx_quantiles(`t0`.`double_col`, 2)[offset(1)] AS `ApproxMedian_double_col` +FROM `functional_alltypes` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_approx/no_filter-approx_nunique/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_approx/no_filter-approx_nunique/out.sql index 7ee240de9fd9..68127767f47c 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_approx/no_filter-approx_nunique/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_approx/no_filter-approx_nunique/out.sql @@ -1,3 +1,3 @@ SELECT - APPROX_COUNT_DISTINCT(t0.double_col) AS ApproxCountDistinct_double_col -FROM functional_alltypes AS t0 \ No newline at end of file + APPROX_COUNT_DISTINCT(`t0`.`double_col`) AS `ApproxCountDistinct_double_col` +FROM `functional_alltypes` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_binary/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_binary/out.sql index c9b5a33bdd2a..f385d2b9a02f 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_binary/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_binary/out.sql @@ -1,3 +1,3 @@ SELECT - CAST(t0.value AS BYTES) AS `Cast_value_ binary` -FROM t AS t0 \ No newline at end of file + CAST(`t0`.`value` AS BYTES) AS `Cast_value_ binary` +FROM `t` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_bit/filter-bit_and/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_bit/filter-bit_and/out.sql index 9086990603db..b416c9f9136b 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_bit/filter-bit_and/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_bit/filter-bit_and/out.sql @@ -1,3 +1,3 @@ SELECT - bit_and(IF(t0.bigint_col > 0, t0.int_col, NULL)) AS `BitAnd_int_col_ Greater_bigint_col_ 0` -FROM functional_alltypes AS t0 \ No newline at end of file + bit_and(IF(`t0`.`bigint_col` > 0, `t0`.`int_col`, NULL)) AS `BitAnd_int_col_ Greater_bigint_col_ 0` +FROM `functional_alltypes` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_bit/filter-bit_or/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_bit/filter-bit_or/out.sql index ec9ed6c6b66b..533efe55deab 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_bit/filter-bit_or/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_bit/filter-bit_or/out.sql @@ -1,3 +1,3 @@ SELECT - bit_or(IF(t0.bigint_col > 0, t0.int_col, NULL)) AS `BitOr_int_col_ Greater_bigint_col_ 0` -FROM functional_alltypes AS t0 \ No newline at end of file + bit_or(IF(`t0`.`bigint_col` > 0, `t0`.`int_col`, NULL)) AS `BitOr_int_col_ Greater_bigint_col_ 0` +FROM `functional_alltypes` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_bit/filter-bit_xor/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_bit/filter-bit_xor/out.sql index 7997e495ef8f..6e8799e46de4 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_bit/filter-bit_xor/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_bit/filter-bit_xor/out.sql @@ -1,3 +1,3 @@ SELECT - bit_xor(IF(t0.bigint_col > 0, t0.int_col, NULL)) AS `BitXor_int_col_ Greater_bigint_col_ 0` -FROM functional_alltypes AS t0 \ No newline at end of file + bit_xor(IF(`t0`.`bigint_col` > 0, `t0`.`int_col`, NULL)) AS `BitXor_int_col_ Greater_bigint_col_ 0` +FROM `functional_alltypes` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_bit/no_filter-bit_and/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_bit/no_filter-bit_and/out.sql index fcafb18759da..6ecb37adff5e 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_bit/no_filter-bit_and/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_bit/no_filter-bit_and/out.sql @@ -1,3 +1,3 @@ SELECT - bit_and(t0.int_col) AS BitAnd_int_col -FROM functional_alltypes AS t0 \ No newline at end of file + bit_and(`t0`.`int_col`) AS `BitAnd_int_col` +FROM `functional_alltypes` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_bit/no_filter-bit_or/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_bit/no_filter-bit_or/out.sql index 22f8eb5534f9..c1191a3c6471 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_bit/no_filter-bit_or/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_bit/no_filter-bit_or/out.sql @@ -1,3 +1,3 @@ SELECT - bit_or(t0.int_col) AS BitOr_int_col -FROM functional_alltypes AS t0 \ No newline at end of file + bit_or(`t0`.`int_col`) AS `BitOr_int_col` +FROM `functional_alltypes` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_bit/no_filter-bit_xor/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_bit/no_filter-bit_xor/out.sql index de39538dbbd7..b1e2ae7247f5 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_bit/no_filter-bit_xor/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_bit/no_filter-bit_xor/out.sql @@ -1,3 +1,3 @@ SELECT - bit_xor(t0.int_col) AS BitXor_int_col -FROM functional_alltypes AS t0 \ No newline at end of file + bit_xor(`t0`.`int_col`) AS `BitXor_int_col` +FROM `functional_alltypes` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_bool_reducers/mean/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_bool_reducers/mean/out.sql index 1345addaed7e..defc913da66e 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_bool_reducers/mean/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_bool_reducers/mean/out.sql @@ -1,3 +1,3 @@ SELECT - AVG(CAST(t0.bool_col AS INT64)) AS Mean_bool_col -FROM functional_alltypes AS t0 \ No newline at end of file + AVG(CAST(`t0`.`bool_col` AS INT64)) AS `Mean_bool_col` +FROM `functional_alltypes` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_bool_reducers/sum/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_bool_reducers/sum/out.sql index 52a1683495d8..41dcc0ed9848 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_bool_reducers/sum/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_bool_reducers/sum/out.sql @@ -1,3 +1,3 @@ SELECT - SUM(CAST(t0.bool_col AS INT64)) AS Sum_bool_col -FROM functional_alltypes AS t0 \ No newline at end of file + SUM(CAST(`t0`.`bool_col` AS INT64)) AS `Sum_bool_col` +FROM `functional_alltypes` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_bool_reducers_where_conj/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_bool_reducers_where_conj/out.sql index 686b89ebd74f..3dcdc77c2b16 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_bool_reducers_where_conj/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_bool_reducers_where_conj/out.sql @@ -1,7 +1,13 @@ SELECT - SUM(IF(( - t0.month > 6 - ) AND ( - t0.month < 10 - ), CAST(t0.bool_col AS INT64), NULL)) AS `Sum_bool_col_ And_Greater_month_ 6_ Less_month_ 10` -FROM functional_alltypes AS t0 \ No newline at end of file + SUM( + IF( + ( + `t0`.`month` > 6 + ) AND ( + `t0`.`month` < 10 + ), + CAST(`t0`.`bool_col` AS INT64), + NULL + ) + ) AS `Sum_bool_col_ And_Greater_month_ 6_ Less_month_ 10` +FROM `functional_alltypes` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_bool_reducers_where_simple/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_bool_reducers_where_simple/out.sql index 3e3b21ef17e2..6bc6dd23ed12 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_bool_reducers_where_simple/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_bool_reducers_where_simple/out.sql @@ -1,3 +1,3 @@ SELECT - AVG(IF(t0.month > 6, CAST(t0.bool_col AS INT64), NULL)) AS `Mean_bool_col_ Greater_month_ 6` -FROM functional_alltypes AS t0 \ No newline at end of file + AVG(IF(`t0`.`month` > 6, CAST(`t0`.`bool_col` AS INT64), NULL)) AS `Mean_bool_col_ Greater_month_ 6` +FROM `functional_alltypes` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_bucket/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_bucket/out.sql index 7aa64367725a..5490334b51b2 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_bucket/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_bucket/out.sql @@ -1,17 +1,17 @@ SELECT CASE WHEN ( - 0 <= t0.value + 0 <= `t0`.`value` ) AND ( - t0.value < 1 + `t0`.`value` < 1 ) THEN 0 WHEN ( - 1 <= t0.value + 1 <= `t0`.`value` ) AND ( - t0.value <= 3 + `t0`.`value` <= 3 ) THEN 1 ELSE CAST(NULL AS INT64) - END AS tmp -FROM t AS t0 \ No newline at end of file + END AS `tmp` +FROM `t` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_cast_float_to_int/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_cast_float_to_int/out.sql index d81e2d9cbdcf..3ebdfd612e9d 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_cast_float_to_int/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_cast_float_to_int/out.sql @@ -1,3 +1,3 @@ SELECT - CAST(trunc(t0.double_col) AS INT64) AS `Cast_double_col_ int64` -FROM functional_alltypes AS t0 \ No newline at end of file + CAST(trunc(`t0`.`double_col`) AS INT64) AS `Cast_double_col_ int64` +FROM `functional_alltypes` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_compile_toplevel/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_compile_toplevel/out.sql index 1b1cef1e6341..6a21813f1cf0 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_compile_toplevel/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_compile_toplevel/out.sql @@ -1,3 +1,3 @@ SELECT - SUM(t0.foo) AS Sum_foo -FROM t0 AS t0 \ No newline at end of file + SUM(`t0`.`foo`) AS `Sum_foo` +FROM `t0` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_cov/pop/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_cov/pop/out.sql index 16c39cbe3843..e9c15dc26bb2 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_cov/pop/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_cov/pop/out.sql @@ -1,3 +1,3 @@ SELECT - COVAR_POP(t0.double_col, t0.double_col) AS `Covariance_double_col_ double_col` -FROM functional_alltypes AS t0 \ No newline at end of file + COVAR_POP(`t0`.`double_col`, `t0`.`double_col`) AS `Covariance_double_col_ double_col` +FROM `functional_alltypes` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_cov/sample/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_cov/sample/out.sql index cd9d190ae5e5..795180ad2157 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_cov/sample/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_cov/sample/out.sql @@ -1,3 +1,3 @@ SELECT - COVAR_SAMP(t0.double_col, t0.double_col) AS `Covariance_double_col_ double_col` -FROM functional_alltypes AS t0 \ No newline at end of file + COVAR_SAMP(`t0`.`double_col`, `t0`.`double_col`) AS `Covariance_double_col_ double_col` +FROM `functional_alltypes` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_divide_by_zero/floordiv/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_divide_by_zero/floordiv/out.sql index 021c289c519a..545d71968181 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_divide_by_zero/floordiv/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_divide_by_zero/floordiv/out.sql @@ -1,3 +1,3 @@ SELECT - CAST(FLOOR(ieee_divide(t0.double_col, 0)) AS INT64) AS `FloorDivide_double_col_ 0` -FROM functional_alltypes AS t0 \ No newline at end of file + CAST(FLOOR(ieee_divide(`t0`.`double_col`, 0)) AS INT64) AS `FloorDivide_double_col_ 0` +FROM `functional_alltypes` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_divide_by_zero/truediv/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_divide_by_zero/truediv/out.sql index 2f451f747c62..fd497dabba49 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_divide_by_zero/truediv/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_divide_by_zero/truediv/out.sql @@ -1,3 +1,3 @@ SELECT - ieee_divide(t0.double_col, 0) AS `Divide_double_col_ 0` -FROM functional_alltypes AS t0 \ No newline at end of file + ieee_divide(`t0`.`double_col`, 0) AS `Divide_double_col_ 0` +FROM `functional_alltypes` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_extract_temporal_from_timestamp/date/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_extract_temporal_from_timestamp/date/out.sql index bc3328e12ee8..a482cae8a206 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_extract_temporal_from_timestamp/date/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_extract_temporal_from_timestamp/date/out.sql @@ -1,3 +1,3 @@ SELECT - DATE(t0.ts) AS tmp -FROM t AS t0 \ No newline at end of file + DATE(`t0`.`ts`) AS `tmp` +FROM `t` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_extract_temporal_from_timestamp/time/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_extract_temporal_from_timestamp/time/out.sql index c35dfe0331a2..f6b91dd9db01 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_extract_temporal_from_timestamp/time/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_extract_temporal_from_timestamp/time/out.sql @@ -1,3 +1,3 @@ SELECT - time(t0.ts) AS tmp -FROM t AS t0 \ No newline at end of file + time(`t0`.`ts`) AS `tmp` +FROM `t` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_azimuth/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_azimuth/out.sql index c1326749682c..a1c2c27200c8 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_azimuth/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_azimuth/out.sql @@ -1,3 +1,3 @@ SELECT - st_azimuth(t0.p0, t0.p1) AS tmp -FROM t AS t0 \ No newline at end of file + st_azimuth(`t0`.`p0`, `t0`.`p1`) AS `tmp` +FROM `t` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_binary/contains/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_binary/contains/out.sql index 41db52f14ef0..96bf23390889 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_binary/contains/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_binary/contains/out.sql @@ -1,3 +1,3 @@ SELECT - st_contains(t0.geog0, t0.geog1) AS tmp -FROM t AS t0 \ No newline at end of file + st_contains(`t0`.`geog0`, `t0`.`geog1`) AS `tmp` +FROM `t` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_binary/covered_by/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_binary/covered_by/out.sql index 45073f686366..d94f44062dd8 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_binary/covered_by/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_binary/covered_by/out.sql @@ -1,3 +1,3 @@ SELECT - st_coveredby(t0.geog0, t0.geog1) AS tmp -FROM t AS t0 \ No newline at end of file + st_coveredby(`t0`.`geog0`, `t0`.`geog1`) AS `tmp` +FROM `t` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_binary/covers/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_binary/covers/out.sql index 316f696e43df..157f1abca0a2 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_binary/covers/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_binary/covers/out.sql @@ -1,3 +1,3 @@ SELECT - st_covers(t0.geog0, t0.geog1) AS tmp -FROM t AS t0 \ No newline at end of file + st_covers(`t0`.`geog0`, `t0`.`geog1`) AS `tmp` +FROM `t` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_binary/d_within/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_binary/d_within/out.sql index 95b081d2f324..f9a4a8d53fe4 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_binary/d_within/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_binary/d_within/out.sql @@ -1,3 +1,3 @@ SELECT - st_dwithin(t0.geog0, t0.geog1, 5.2) AS tmp -FROM t AS t0 \ No newline at end of file + st_dwithin(`t0`.`geog0`, `t0`.`geog1`, 5.2) AS `tmp` +FROM `t` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_binary/difference/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_binary/difference/out.sql index 3680bf6dc8cf..6a35d9cfa05e 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_binary/difference/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_binary/difference/out.sql @@ -1,3 +1,3 @@ SELECT - st_difference(t0.geog0, t0.geog1) AS tmp -FROM t AS t0 \ No newline at end of file + st_difference(`t0`.`geog0`, `t0`.`geog1`) AS `tmp` +FROM `t` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_binary/disjoint/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_binary/disjoint/out.sql index 47f67918fdaf..b60e5f4f311b 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_binary/disjoint/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_binary/disjoint/out.sql @@ -1,3 +1,3 @@ SELECT - st_disjoint(t0.geog0, t0.geog1) AS tmp -FROM t AS t0 \ No newline at end of file + st_disjoint(`t0`.`geog0`, `t0`.`geog1`) AS `tmp` +FROM `t` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_binary/distance/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_binary/distance/out.sql index dd498ab034f6..a9bdbfee05af 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_binary/distance/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_binary/distance/out.sql @@ -1,3 +1,3 @@ SELECT - st_distance(t0.geog0, t0.geog1) AS tmp -FROM t AS t0 \ No newline at end of file + st_distance(`t0`.`geog0`, `t0`.`geog1`) AS `tmp` +FROM `t` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_binary/geo_equals/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_binary/geo_equals/out.sql index 525bdd5a98c5..ecdbbfcb201b 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_binary/geo_equals/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_binary/geo_equals/out.sql @@ -1,3 +1,3 @@ SELECT - st_equals(t0.geog0, t0.geog1) AS tmp -FROM t AS t0 \ No newline at end of file + st_equals(`t0`.`geog0`, `t0`.`geog1`) AS `tmp` +FROM `t` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_binary/intersection/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_binary/intersection/out.sql index 881691e93e02..5dfd3ab8b909 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_binary/intersection/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_binary/intersection/out.sql @@ -1,3 +1,3 @@ SELECT - st_intersection(t0.geog0, t0.geog1) AS tmp -FROM t AS t0 \ No newline at end of file + st_intersection(`t0`.`geog0`, `t0`.`geog1`) AS `tmp` +FROM `t` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_binary/intersects/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_binary/intersects/out.sql index 9768493f1bbc..fef52009fe64 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_binary/intersects/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_binary/intersects/out.sql @@ -1,3 +1,3 @@ SELECT - st_intersects(t0.geog0, t0.geog1) AS tmp -FROM t AS t0 \ No newline at end of file + st_intersects(`t0`.`geog0`, `t0`.`geog1`) AS `tmp` +FROM `t` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_binary/max_distance/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_binary/max_distance/out.sql index bebf364b68f8..96a0669f9a8a 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_binary/max_distance/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_binary/max_distance/out.sql @@ -1,3 +1,3 @@ SELECT - st_maxdistance(t0.geog0, t0.geog1) AS tmp -FROM t AS t0 \ No newline at end of file + st_maxdistance(`t0`.`geog0`, `t0`.`geog1`) AS `tmp` +FROM `t` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_binary/touches/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_binary/touches/out.sql index 3d50dc04d227..66fce0704abf 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_binary/touches/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_binary/touches/out.sql @@ -1,3 +1,3 @@ SELECT - st_touches(t0.geog0, t0.geog1) AS tmp -FROM t AS t0 \ No newline at end of file + st_touches(`t0`.`geog0`, `t0`.`geog1`) AS `tmp` +FROM `t` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_binary/union/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_binary/union/out.sql index 8f5d1d5a8f42..2d55fe586ad8 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_binary/union/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_binary/union/out.sql @@ -1,3 +1,3 @@ SELECT - st_union(t0.geog0, t0.geog1) AS tmp -FROM t AS t0 \ No newline at end of file + st_union(`t0`.`geog0`, `t0`.`geog1`) AS `tmp` +FROM `t` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_binary/within/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_binary/within/out.sql index 9ac98c0a3feb..dc4db360b7c4 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_binary/within/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_binary/within/out.sql @@ -1,3 +1,3 @@ SELECT - st_within(t0.geog0, t0.geog1) AS tmp -FROM t AS t0 \ No newline at end of file + st_within(`t0`.`geog0`, `t0`.`geog1`) AS `tmp` +FROM `t` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_minmax/x_max/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_minmax/x_max/out.sql index 3acaebab60b6..b05087e2fc75 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_minmax/x_max/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_minmax/x_max/out.sql @@ -1,3 +1,3 @@ SELECT - st_boundingbox(t0.geog).xmax AS tmp -FROM t AS t0 \ No newline at end of file + st_boundingbox(`t0`.`geog`).xmax AS `tmp` +FROM `t` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_minmax/x_min/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_minmax/x_min/out.sql index 3e46dda22606..04e235462a0a 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_minmax/x_min/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_minmax/x_min/out.sql @@ -1,3 +1,3 @@ SELECT - st_boundingbox(t0.geog).xmin AS tmp -FROM t AS t0 \ No newline at end of file + st_boundingbox(`t0`.`geog`).xmin AS `tmp` +FROM `t` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_minmax/y_max/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_minmax/y_max/out.sql index f2163789f6e8..843525e16179 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_minmax/y_max/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_minmax/y_max/out.sql @@ -1,3 +1,3 @@ SELECT - st_boundingbox(t0.geog).ymax AS tmp -FROM t AS t0 \ No newline at end of file + st_boundingbox(`t0`.`geog`).ymax AS `tmp` +FROM `t` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_minmax/y_min/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_minmax/y_min/out.sql index dc148200be48..e26977c81c83 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_minmax/y_min/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_minmax/y_min/out.sql @@ -1,3 +1,3 @@ SELECT - st_boundingbox(t0.geog).ymin AS tmp -FROM t AS t0 \ No newline at end of file + st_boundingbox(`t0`.`geog`).ymin AS `tmp` +FROM `t` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_point/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_point/out.sql index a57d8a6952f5..a7e665427598 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_point/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_point/out.sql @@ -1,3 +1,3 @@ SELECT - st_geogpoint(t0.lon, t0.lat) AS tmp -FROM t AS t0 \ No newline at end of file + st_geogpoint(`t0`.`lon`, `t0`.`lat`) AS `tmp` +FROM `t` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_simplify/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_simplify/out.sql index 0f9f1b6cc556..e5d6f7d549ef 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_simplify/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_simplify/out.sql @@ -1,3 +1,3 @@ SELECT - st_simplify(t0.geog, 5.2) AS tmp -FROM t AS t0 \ No newline at end of file + st_simplify(`t0`.`geog`, 5.2) AS `tmp` +FROM `t` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_unary/aread/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_unary/aread/out.sql index 6b56cb853600..d9281160c6bf 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_unary/aread/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_unary/aread/out.sql @@ -1,3 +1,3 @@ SELECT - st_area(t0.geog) AS tmp -FROM t AS t0 \ No newline at end of file + st_area(`t0`.`geog`) AS `tmp` +FROM `t` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_unary/as_binary/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_unary/as_binary/out.sql index d08e811dab1a..018ab1f57956 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_unary/as_binary/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_unary/as_binary/out.sql @@ -1,3 +1,3 @@ SELECT - st_asbinary(t0.geog) AS tmp -FROM t AS t0 \ No newline at end of file + st_asbinary(`t0`.`geog`) AS `tmp` +FROM `t` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_unary/as_text/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_unary/as_text/out.sql index 5a15cdcf347a..8dcf46b8758f 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_unary/as_text/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_unary/as_text/out.sql @@ -1,3 +1,3 @@ SELECT - st_astext(t0.geog) AS tmp -FROM t AS t0 \ No newline at end of file + st_astext(`t0`.`geog`) AS `tmp` +FROM `t` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_unary/buffer/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_unary/buffer/out.sql index 026f5a13ab9c..70cb2b7cc351 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_unary/buffer/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_unary/buffer/out.sql @@ -1,3 +1,3 @@ SELECT - st_buffer(t0.geog, 5.2) AS tmp -FROM t AS t0 \ No newline at end of file + st_buffer(`t0`.`geog`, 5.2) AS `tmp` +FROM `t` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_unary/centroid/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_unary/centroid/out.sql index c486a43d1f54..446af3e347eb 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_unary/centroid/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_unary/centroid/out.sql @@ -1,3 +1,3 @@ SELECT - st_centroid(t0.geog) AS tmp -FROM t AS t0 \ No newline at end of file + st_centroid(`t0`.`geog`) AS `tmp` +FROM `t` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_unary/end_point/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_unary/end_point/out.sql index 0f4f517bc5d7..9bb5289851e1 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_unary/end_point/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_unary/end_point/out.sql @@ -1,3 +1,3 @@ SELECT - st_endpoint(t0.geog) AS tmp -FROM t AS t0 \ No newline at end of file + st_endpoint(`t0`.`geog`) AS `tmp` +FROM `t` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_unary/geometry_type/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_unary/geometry_type/out.sql index 6b87c638e82d..e6849f56ea7c 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_unary/geometry_type/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_unary/geometry_type/out.sql @@ -1,3 +1,3 @@ SELECT - st_geometrytype(t0.geog) AS tmp -FROM t AS t0 \ No newline at end of file + st_geometrytype(`t0`.`geog`) AS `tmp` +FROM `t` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_unary/length/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_unary/length/out.sql index cc0c00c15a40..daa410bd11d6 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_unary/length/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_unary/length/out.sql @@ -1,3 +1,3 @@ SELECT - st_length(t0.geog) AS tmp -FROM t AS t0 \ No newline at end of file + st_length(`t0`.`geog`) AS `tmp` +FROM `t` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_unary/npoints/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_unary/npoints/out.sql index ce6c5c6a9988..5776674cef29 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_unary/npoints/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_unary/npoints/out.sql @@ -1,3 +1,3 @@ SELECT - st_numpoints(t0.geog) AS tmp -FROM t AS t0 \ No newline at end of file + st_numpoints(`t0`.`geog`) AS `tmp` +FROM `t` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_unary/perimeter/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_unary/perimeter/out.sql index 62b3f322440b..ed5ce2aafa27 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_unary/perimeter/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_unary/perimeter/out.sql @@ -1,3 +1,3 @@ SELECT - st_perimeter(t0.geog) AS tmp -FROM t AS t0 \ No newline at end of file + st_perimeter(`t0`.`geog`) AS `tmp` +FROM `t` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_unary/point_n/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_unary/point_n/out.sql index 0b03f583db71..070963810106 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_unary/point_n/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_unary/point_n/out.sql @@ -1,3 +1,3 @@ SELECT - st_pointn(t0.geog, 3) AS tmp -FROM t AS t0 \ No newline at end of file + st_pointn(`t0`.`geog`, 3) AS `tmp` +FROM `t` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_unary/start_point/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_unary/start_point/out.sql index 9c77d20eaae8..a4681f1837fd 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_unary/start_point/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_unary/start_point/out.sql @@ -1,3 +1,3 @@ SELECT - st_startpoint(t0.geog) AS tmp -FROM t AS t0 \ No newline at end of file + st_startpoint(`t0`.`geog`) AS `tmp` +FROM `t` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_unary_union/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_unary_union/out.sql index 112d191a4eae..4729efce3601 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_unary_union/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_unary_union/out.sql @@ -1,3 +1,3 @@ SELECT - st_union_agg(t0.geog) AS tmp -FROM t AS t0 \ No newline at end of file + st_union_agg(`t0`.`geog`) AS `tmp` +FROM `t` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_xy/x/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_xy/x/out.sql index 76b1ac85d03e..3f2648904d3a 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_xy/x/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_xy/x/out.sql @@ -1,3 +1,3 @@ SELECT - st_x(t0.pt) AS tmp -FROM t AS t0 \ No newline at end of file + st_x(`t0`.`pt`) AS `tmp` +FROM `t` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_xy/y/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_xy/y/out.sql index 472068d4b795..dafbb99d5876 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_xy/y/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_geospatial_xy/y/out.sql @@ -1,3 +1,3 @@ SELECT - st_y(t0.pt) AS tmp -FROM t AS t0 \ No newline at end of file + st_y(`t0`.`pt`) AS `tmp` +FROM `t` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_hashbytes/md5-test-binary/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_hashbytes/md5-test-binary/out.sql index 06e3d4e02c04..a3f28427c7d1 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_hashbytes/md5-test-binary/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_hashbytes/md5-test-binary/out.sql @@ -1,2 +1,2 @@ SELECT - TO_HEX(MD5(CAST('74657374' AS BYTES FORMAT 'HEX'))) AS tmp \ No newline at end of file + TO_HEX(MD5(CAST('74657374' AS BYTES FORMAT 'HEX'))) AS `tmp` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_hashbytes/md5-test-string/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_hashbytes/md5-test-string/out.sql index a9b91d0a8fd8..56feffe64936 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_hashbytes/md5-test-string/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_hashbytes/md5-test-string/out.sql @@ -1,2 +1,2 @@ SELECT - TO_HEX(MD5('test')) AS tmp \ No newline at end of file + TO_HEX(MD5('test')) AS `tmp` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_hashbytes/sha1-test-binary/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_hashbytes/sha1-test-binary/out.sql index b47ac212bf11..4bb7f967efac 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_hashbytes/sha1-test-binary/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_hashbytes/sha1-test-binary/out.sql @@ -1,2 +1,2 @@ SELECT - SHA(CAST('74657374' AS BYTES FORMAT 'HEX')) AS tmp \ No newline at end of file + SHA(CAST('74657374' AS BYTES FORMAT 'HEX')) AS `tmp` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_hashbytes/sha1-test-string/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_hashbytes/sha1-test-string/out.sql index 006923cc428f..14d1aadd4b12 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_hashbytes/sha1-test-string/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_hashbytes/sha1-test-string/out.sql @@ -1,2 +1,2 @@ SELECT - SHA('test') AS tmp \ No newline at end of file + SHA('test') AS `tmp` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_hashbytes/sha256-test-binary/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_hashbytes/sha256-test-binary/out.sql index 66952364a23a..94a06c700a99 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_hashbytes/sha256-test-binary/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_hashbytes/sha256-test-binary/out.sql @@ -1,2 +1,2 @@ SELECT - sha256(CAST('74657374' AS BYTES FORMAT 'HEX')) AS tmp \ No newline at end of file + sha256(CAST('74657374' AS BYTES FORMAT 'HEX')) AS `tmp` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_hashbytes/sha256-test-string/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_hashbytes/sha256-test-string/out.sql index eee9f3b6f5c6..1099300c55f1 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_hashbytes/sha256-test-string/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_hashbytes/sha256-test-string/out.sql @@ -1,2 +1,2 @@ SELECT - sha256('test') AS tmp \ No newline at end of file + sha256('test') AS `tmp` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_hashbytes/sha512-test-binary/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_hashbytes/sha512-test-binary/out.sql index 0a34496a1b95..a4ea136590ee 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_hashbytes/sha512-test-binary/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_hashbytes/sha512-test-binary/out.sql @@ -1,2 +1,2 @@ SELECT - sha512(CAST('74657374' AS BYTES FORMAT 'HEX')) AS tmp \ No newline at end of file + sha512(CAST('74657374' AS BYTES FORMAT 'HEX')) AS `tmp` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_hashbytes/sha512-test-string/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_hashbytes/sha512-test-string/out.sql index ba16c3204a26..fe017301d4e8 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_hashbytes/sha512-test-string/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_hashbytes/sha512-test-string/out.sql @@ -1,2 +1,2 @@ SELECT - sha512('test') AS tmp \ No newline at end of file + sha512('test') AS `tmp` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_identical_to/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_identical_to/out.sql index dbd6d0bc38db..78efbe4e8ed6 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_identical_to/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_identical_to/out.sql @@ -1,18 +1,18 @@ SELECT - t0.id, - t0.bool_col, - t0.tinyint_col, - t0.smallint_col, - t0.int_col, - t0.bigint_col, - t0.float_col, - t0.double_col, - t0.date_string_col, - t0.string_col, - t0.timestamp_col, - t0.year, - t0.month -FROM functional_alltypes AS t0 + `t0`.`id`, + `t0`.`bool_col`, + `t0`.`tinyint_col`, + `t0`.`smallint_col`, + `t0`.`int_col`, + `t0`.`bigint_col`, + `t0`.`float_col`, + `t0`.`double_col`, + `t0`.`date_string_col`, + `t0`.`string_col`, + `t0`.`timestamp_col`, + `t0`.`year`, + `t0`.`month` +FROM `functional_alltypes` AS `t0` WHERE - t0.string_col IS NOT DISTINCT FROM 'a' - AND t0.date_string_col IS NOT DISTINCT FROM 'b' \ No newline at end of file + `t0`.`string_col` IS NOT DISTINCT FROM 'a' + AND `t0`.`date_string_col` IS NOT DISTINCT FROM 'b' \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_integer_to_timestamp/ms/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_integer_to_timestamp/ms/out.sql index 108f5bdd6655..f6bbd8c50e76 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_integer_to_timestamp/ms/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_integer_to_timestamp/ms/out.sql @@ -1,2 +1,2 @@ SELECT - timestamp_millis(-123456789) AS tmp \ No newline at end of file + timestamp_millis(-123456789) AS `tmp` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_integer_to_timestamp/ns/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_integer_to_timestamp/ns/out.sql index aaa93e0528b8..71a52f80bc47 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_integer_to_timestamp/ns/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_integer_to_timestamp/ns/out.sql @@ -1,2 +1,2 @@ SELECT - timestamp_micros(CAST(ROUND(1234567891011 / 1000) AS INT64)) AS tmp \ No newline at end of file + timestamp_micros(CAST(ROUND(1234567891011 / 1000) AS INT64)) AS `tmp` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_integer_to_timestamp/s/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_integer_to_timestamp/s/out.sql index a470e62fd7a5..88b361b392d8 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_integer_to_timestamp/s/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_integer_to_timestamp/s/out.sql @@ -1,2 +1,2 @@ SELECT - timestamp_seconds(123456789) AS tmp \ No newline at end of file + timestamp_seconds(123456789) AS `tmp` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_integer_to_timestamp/us/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_integer_to_timestamp/us/out.sql index 9c2e88bc505f..9217cf492432 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_integer_to_timestamp/us/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_integer_to_timestamp/us/out.sql @@ -1,2 +1,2 @@ SELECT - timestamp_micros(123456789) AS tmp \ No newline at end of file + timestamp_micros(123456789) AS `tmp` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_literal_timestamp_or_time/datetime/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_literal_timestamp_or_time/datetime/out.sql index 4a5e85730e47..bfefa9d352a9 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_literal_timestamp_or_time/datetime/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_literal_timestamp_or_time/datetime/out.sql @@ -1,2 +1,2 @@ SELECT - EXTRACT(HOUR FROM datetime('2017-01-01T04:55:59')) AS tmp \ No newline at end of file + EXTRACT(HOUR FROM datetime('2017-01-01T04:55:59')) AS `tmp` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_literal_timestamp_or_time/string_time/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_literal_timestamp_or_time/string_time/out.sql index b0b094d49530..b3acf7e814fc 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_literal_timestamp_or_time/string_time/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_literal_timestamp_or_time/string_time/out.sql @@ -1,2 +1,2 @@ SELECT - EXTRACT(HOUR FROM time(4, 55, 59)) AS tmp \ No newline at end of file + EXTRACT(HOUR FROM time(4, 55, 59)) AS `tmp` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_literal_timestamp_or_time/string_timestamp/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_literal_timestamp_or_time/string_timestamp/out.sql index 4a5e85730e47..bfefa9d352a9 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_literal_timestamp_or_time/string_timestamp/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_literal_timestamp_or_time/string_timestamp/out.sql @@ -1,2 +1,2 @@ SELECT - EXTRACT(HOUR FROM datetime('2017-01-01T04:55:59')) AS tmp \ No newline at end of file + EXTRACT(HOUR FROM datetime('2017-01-01T04:55:59')) AS `tmp` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_literal_timestamp_or_time/time/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_literal_timestamp_or_time/time/out.sql index b0b094d49530..b3acf7e814fc 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_literal_timestamp_or_time/time/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_literal_timestamp_or_time/time/out.sql @@ -1,2 +1,2 @@ SELECT - EXTRACT(HOUR FROM time(4, 55, 59)) AS tmp \ No newline at end of file + EXTRACT(HOUR FROM time(4, 55, 59)) AS `tmp` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_literal_timestamp_or_time/timestamp/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_literal_timestamp_or_time/timestamp/out.sql index 4a5e85730e47..bfefa9d352a9 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_literal_timestamp_or_time/timestamp/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_literal_timestamp_or_time/timestamp/out.sql @@ -1,2 +1,2 @@ SELECT - EXTRACT(HOUR FROM datetime('2017-01-01T04:55:59')) AS tmp \ No newline at end of file + EXTRACT(HOUR FROM datetime('2017-01-01T04:55:59')) AS `tmp` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_now/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_now/out.sql index c86165f516de..3eecc7336d34 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_now/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_now/out.sql @@ -1,2 +1,2 @@ SELECT - CURRENT_TIMESTAMP() AS TimestampNow \ No newline at end of file + CURRENT_TIMESTAMP() AS `TimestampNow` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_projection_fusion_only_peeks_at_immediate_parent/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_projection_fusion_only_peeks_at_immediate_parent/out.sql index 4e9dfeb746c9..dca603f5351e 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_projection_fusion_only_peeks_at_immediate_parent/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_projection_fusion_only_peeks_at_immediate_parent/out.sql @@ -1,18 +1,19 @@ -WITH t1 AS ( +WITH `t1` AS ( SELECT - CAST(t0.file_date AS DATE) AS file_date, - t0.PARTITIONTIME, - t0.val, - t0.val * 2 AS XYZ - FROM unbound_table AS t0 + CAST(`t0`.`file_date` AS DATE) AS `file_date`, + `t0`.`PARTITIONTIME`, + `t0`.`val`, + `t0`.`val` * 2 AS `XYZ` + FROM `unbound_table` AS `t0` WHERE - t0.PARTITIONTIME < DATE(2017, 1, 1) AND CAST(t0.file_date AS DATE) < DATE(2017, 1, 1) + `t0`.`PARTITIONTIME` < DATE(2017, 1, 1) + AND CAST(`t0`.`file_date` AS DATE) < DATE(2017, 1, 1) ) SELECT - t3.file_date, - t3.PARTITIONTIME, - t3.val, - t3.XYZ -FROM t1 AS t3 -INNER JOIN t1 AS t5 + `t3`.`file_date`, + `t3`.`PARTITIONTIME`, + `t3`.`val`, + `t3`.`XYZ` +FROM `t1` AS `t3` +INNER JOIN `t1` AS `t5` ON TRUE \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_range_window_function/prec_foll/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_range_window_function/prec_foll/out.sql index b429e0b40a4b..d3d34d8aab8c 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_range_window_function/prec_foll/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_range_window_function/prec_foll/out.sql @@ -1,16 +1,16 @@ SELECT - t0.id, - t0.bool_col, - t0.tinyint_col, - t0.smallint_col, - t0.int_col, - t0.bigint_col, - t0.float_col, - t0.double_col, - t0.date_string_col, - t0.string_col, - t0.timestamp_col, - t0.year, - t0.month, - AVG(t0.float_col) OVER (PARTITION BY t0.year ORDER BY t0.month ASC RANGE BETWEEN 1 preceding AND CURRENT ROW) AS two_month_avg -FROM functional_alltypes AS t0 \ No newline at end of file + `t0`.`id`, + `t0`.`bool_col`, + `t0`.`tinyint_col`, + `t0`.`smallint_col`, + `t0`.`int_col`, + `t0`.`bigint_col`, + `t0`.`float_col`, + `t0`.`double_col`, + `t0`.`date_string_col`, + `t0`.`string_col`, + `t0`.`timestamp_col`, + `t0`.`year`, + `t0`.`month`, + AVG(`t0`.`float_col`) OVER (PARTITION BY `t0`.`year` ORDER BY `t0`.`month` ASC RANGE BETWEEN 1 preceding AND CURRENT ROW) AS `two_month_avg` +FROM `functional_alltypes` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_range_window_function/prec_prec/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_range_window_function/prec_prec/out.sql index 28f748f8d387..07d2c13692bc 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_range_window_function/prec_prec/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_range_window_function/prec_prec/out.sql @@ -1,16 +1,16 @@ SELECT - t0.id, - t0.bool_col, - t0.tinyint_col, - t0.smallint_col, - t0.int_col, - t0.bigint_col, - t0.float_col, - t0.double_col, - t0.date_string_col, - t0.string_col, - t0.timestamp_col, - t0.year, - t0.month, - AVG(t0.float_col) OVER (PARTITION BY t0.year ORDER BY t0.timestamp_col ASC RANGE BETWEEN 4 preceding AND 2 preceding) AS two_month_avg -FROM functional_alltypes AS t0 \ No newline at end of file + `t0`.`id`, + `t0`.`bool_col`, + `t0`.`tinyint_col`, + `t0`.`smallint_col`, + `t0`.`int_col`, + `t0`.`bigint_col`, + `t0`.`float_col`, + `t0`.`double_col`, + `t0`.`date_string_col`, + `t0`.`string_col`, + `t0`.`timestamp_col`, + `t0`.`year`, + `t0`.`month`, + AVG(`t0`.`float_col`) OVER (PARTITION BY `t0`.`year` ORDER BY `t0`.`timestamp_col` ASC RANGE BETWEEN 4 preceding AND 2 preceding) AS `two_month_avg` +FROM `functional_alltypes` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_set_operation/difference/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_set_operation/difference/out.sql index 1fba54566ec5..f606f41d85af 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_set_operation/difference/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_set_operation/difference/out.sql @@ -1,11 +1,11 @@ SELECT - t2.a + `t2`.`a` FROM ( SELECT * - FROM t0 AS t0 + FROM `t0` AS `t0` EXCEPT DISTINCT SELECT * - FROM t1 AS t1 -) AS t2 \ No newline at end of file + FROM `t1` AS `t1` +) AS `t2` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_set_operation/intersect/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_set_operation/intersect/out.sql index 0300759946af..2d55719ae929 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_set_operation/intersect/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_set_operation/intersect/out.sql @@ -1,11 +1,11 @@ SELECT - t2.a + `t2`.`a` FROM ( SELECT * - FROM t0 AS t0 + FROM `t0` AS `t0` INTERSECT DISTINCT SELECT * - FROM t1 AS t1 -) AS t2 \ No newline at end of file + FROM `t1` AS `t1` +) AS `t2` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_set_operation/union_all/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_set_operation/union_all/out.sql index 65ca427a3cc1..934660ad08b6 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_set_operation/union_all/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_set_operation/union_all/out.sql @@ -1,11 +1,11 @@ SELECT - t2.a + `t2`.`a` FROM ( SELECT * - FROM t0 AS t0 + FROM `t0` AS `t0` UNION ALL SELECT * - FROM t1 AS t1 -) AS t2 \ No newline at end of file + FROM `t1` AS `t1` +) AS `t2` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_set_operation/union_distinct/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_set_operation/union_distinct/out.sql index f060886f0ca7..a25ce9e14ab5 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_set_operation/union_distinct/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_set_operation/union_distinct/out.sql @@ -1,11 +1,11 @@ SELECT - t2.a + `t2`.`a` FROM ( SELECT * - FROM t0 AS t0 + FROM `t0` AS `t0` UNION DISTINCT SELECT * - FROM t1 AS t1 -) AS t2 \ No newline at end of file + FROM `t1` AS `t1` +) AS `t2` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_substring/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_substring/out.sql index dde97310a2d4..1f0e135f1a72 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_substring/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_substring/out.sql @@ -1,3 +1,7 @@ SELECT - IF(3 >= 0, substr(t0.value, 3 + 1, 1), substr(t0.value, LENGTH(t0.value) + 3 + 1, 1)) AS tmp -FROM t AS t0 \ No newline at end of file + IF( + 3 >= 0, + substr(`t0`.`value`, 3 + 1, 1), + substr(`t0`.`value`, LENGTH(`t0`.`value`) + 3 + 1, 1) + ) AS `tmp` +FROM `t` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/day-date/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/day-date/out.sql index cfda92082d60..d777efe8c269 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/day-date/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/day-date/out.sql @@ -1,3 +1,3 @@ SELECT - DATE_TRUNC(t0.a, DAY) AS tmp -FROM t AS t0 \ No newline at end of file + DATE_TRUNC(`t0`.`a`, DAY) AS `tmp` +FROM `t` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/day-timestamp/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/day-timestamp/out.sql index 5914e551cdfa..49c235e509b8 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/day-timestamp/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/day-timestamp/out.sql @@ -1,3 +1,3 @@ SELECT - TIMESTAMP_TRUNC(t0.a, DAY) AS tmp -FROM t AS t0 \ No newline at end of file + TIMESTAMP_TRUNC(`t0`.`a`, DAY) AS `tmp` +FROM `t` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/hour-time/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/hour-time/out.sql index 627fd52607ea..86b91e57f380 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/hour-time/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/hour-time/out.sql @@ -1,3 +1,3 @@ SELECT - TIME_TRUNC(t0.a, HOUR) AS tmp -FROM t AS t0 \ No newline at end of file + TIME_TRUNC(`t0`.`a`, HOUR) AS `tmp` +FROM `t` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/hour-timestamp/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/hour-timestamp/out.sql index 2eb17fc72aa7..73ae9c38d7f3 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/hour-timestamp/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/hour-timestamp/out.sql @@ -1,3 +1,3 @@ SELECT - TIMESTAMP_TRUNC(t0.a, HOUR) AS tmp -FROM t AS t0 \ No newline at end of file + TIMESTAMP_TRUNC(`t0`.`a`, HOUR) AS `tmp` +FROM `t` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/micros-time/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/micros-time/out.sql index bc83a4627907..ff72ad1869f1 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/micros-time/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/micros-time/out.sql @@ -1,3 +1,3 @@ SELECT - TIME_TRUNC(t0.a, MICROSECOND) AS tmp -FROM t AS t0 \ No newline at end of file + TIME_TRUNC(`t0`.`a`, MICROSECOND) AS `tmp` +FROM `t` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/micros-timestamp/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/micros-timestamp/out.sql index 85129ae2ca98..6e969ad4a4e3 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/micros-timestamp/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/micros-timestamp/out.sql @@ -1,3 +1,3 @@ SELECT - TIMESTAMP_TRUNC(t0.a, MICROSECOND) AS tmp -FROM t AS t0 \ No newline at end of file + TIMESTAMP_TRUNC(`t0`.`a`, MICROSECOND) AS `tmp` +FROM `t` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/millis-time/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/millis-time/out.sql index d568ac473f24..320bf3dba9fb 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/millis-time/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/millis-time/out.sql @@ -1,3 +1,3 @@ SELECT - TIME_TRUNC(t0.a, MILLISECOND) AS tmp -FROM t AS t0 \ No newline at end of file + TIME_TRUNC(`t0`.`a`, MILLISECOND) AS `tmp` +FROM `t` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/millis-timestamp/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/millis-timestamp/out.sql index eeb61582028e..33dae6b0f68d 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/millis-timestamp/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/millis-timestamp/out.sql @@ -1,3 +1,3 @@ SELECT - TIMESTAMP_TRUNC(t0.a, MILLISECOND) AS tmp -FROM t AS t0 \ No newline at end of file + TIMESTAMP_TRUNC(`t0`.`a`, MILLISECOND) AS `tmp` +FROM `t` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/minute-time/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/minute-time/out.sql index 53a26cff7227..e160ccd4a6e0 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/minute-time/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/minute-time/out.sql @@ -1,3 +1,3 @@ SELECT - TIME_TRUNC(t0.a, MINUTE) AS tmp -FROM t AS t0 \ No newline at end of file + TIME_TRUNC(`t0`.`a`, MINUTE) AS `tmp` +FROM `t` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/minute-timestamp/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/minute-timestamp/out.sql index 75ed2f48e4f3..8e8f9b216b1c 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/minute-timestamp/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/minute-timestamp/out.sql @@ -1,3 +1,3 @@ SELECT - TIMESTAMP_TRUNC(t0.a, MINUTE) AS tmp -FROM t AS t0 \ No newline at end of file + TIMESTAMP_TRUNC(`t0`.`a`, MINUTE) AS `tmp` +FROM `t` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/month-date/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/month-date/out.sql index 08aea93a5d16..18595276e94c 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/month-date/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/month-date/out.sql @@ -1,3 +1,3 @@ SELECT - DATE_TRUNC(t0.a, MONTH) AS tmp -FROM t AS t0 \ No newline at end of file + DATE_TRUNC(`t0`.`a`, MONTH) AS `tmp` +FROM `t` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/month-timestamp/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/month-timestamp/out.sql index fb5755607afc..a91309d464e8 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/month-timestamp/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/month-timestamp/out.sql @@ -1,3 +1,3 @@ SELECT - TIMESTAMP_TRUNC(t0.a, MONTH) AS tmp -FROM t AS t0 \ No newline at end of file + TIMESTAMP_TRUNC(`t0`.`a`, MONTH) AS `tmp` +FROM `t` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/quarter-date/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/quarter-date/out.sql index 69fb0c1c0073..b0d7d6961791 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/quarter-date/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/quarter-date/out.sql @@ -1,3 +1,3 @@ SELECT - DATE_TRUNC(t0.a, QUARTER) AS tmp -FROM t AS t0 \ No newline at end of file + DATE_TRUNC(`t0`.`a`, QUARTER) AS `tmp` +FROM `t` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/quarter-timestamp/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/quarter-timestamp/out.sql index 6ae384abfe45..0a2d8f60b36f 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/quarter-timestamp/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/quarter-timestamp/out.sql @@ -1,3 +1,3 @@ SELECT - TIMESTAMP_TRUNC(t0.a, QUARTER) AS tmp -FROM t AS t0 \ No newline at end of file + TIMESTAMP_TRUNC(`t0`.`a`, QUARTER) AS `tmp` +FROM `t` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/second-time/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/second-time/out.sql index ed1a4f61a766..dbc7706ed2ea 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/second-time/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/second-time/out.sql @@ -1,3 +1,3 @@ SELECT - TIME_TRUNC(t0.a, SECOND) AS tmp -FROM t AS t0 \ No newline at end of file + TIME_TRUNC(`t0`.`a`, SECOND) AS `tmp` +FROM `t` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/second-timestamp/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/second-timestamp/out.sql index ca6b3eea53d1..b079b10cf547 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/second-timestamp/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/second-timestamp/out.sql @@ -1,3 +1,3 @@ SELECT - TIMESTAMP_TRUNC(t0.a, SECOND) AS tmp -FROM t AS t0 \ No newline at end of file + TIMESTAMP_TRUNC(`t0`.`a`, SECOND) AS `tmp` +FROM `t` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/week-date/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/week-date/out.sql index 5fa3caed910e..2e9393921012 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/week-date/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/week-date/out.sql @@ -1,3 +1,3 @@ SELECT - DATE_TRUNC(t0.a, WEEK(MONDAY)) AS tmp -FROM t AS t0 \ No newline at end of file + DATE_TRUNC(`t0`.`a`, WEEK(MONDAY)) AS `tmp` +FROM `t` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/week-timestamp/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/week-timestamp/out.sql index 116adb3c510c..97185a8e1b46 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/week-timestamp/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/week-timestamp/out.sql @@ -1,3 +1,3 @@ SELECT - TIMESTAMP_TRUNC(t0.a, WEEK(MONDAY)) AS tmp -FROM t AS t0 \ No newline at end of file + TIMESTAMP_TRUNC(`t0`.`a`, WEEK(MONDAY)) AS `tmp` +FROM `t` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/year-date/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/year-date/out.sql index 6c6515bd7737..908cf8cb2652 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/year-date/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/year-date/out.sql @@ -1,3 +1,3 @@ SELECT - DATE_TRUNC(t0.a, YEAR) AS tmp -FROM t AS t0 \ No newline at end of file + DATE_TRUNC(`t0`.`a`, YEAR) AS `tmp` +FROM `t` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/year-timestamp/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/year-timestamp/out.sql index 9b639983ccda..bd256408229b 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/year-timestamp/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_temporal_truncate/year-timestamp/out.sql @@ -1,3 +1,3 @@ SELECT - TIMESTAMP_TRUNC(t0.a, YEAR) AS tmp -FROM t AS t0 \ No newline at end of file + TIMESTAMP_TRUNC(`t0`.`a`, YEAR) AS `tmp` +FROM `t` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_to_timestamp_no_timezone/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_to_timestamp_no_timezone/out.sql index 13bb7ff2b42b..78b8c273dbcf 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_to_timestamp_no_timezone/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_to_timestamp_no_timezone/out.sql @@ -1,3 +1,3 @@ SELECT - parse_timestamp('%F', t0.date_string_col, 'UTC') AS `StringToTimestamp_date_string_col_ '%F'` -FROM functional_alltypes AS t0 \ No newline at end of file + parse_timestamp('%F', `t0`.`date_string_col`, 'UTC') AS `StringToTimestamp_date_string_col_ '%F'` +FROM `functional_alltypes` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_to_timestamp_timezone/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_to_timestamp_timezone/out.sql index 9e192cd1a351..01ed85e47093 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_to_timestamp_timezone/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_to_timestamp_timezone/out.sql @@ -1,3 +1,3 @@ SELECT - parse_timestamp('%F %Z', CONCAT(t0.date_string_col, ' America/New_York'), 'UTC') AS `StringToTimestamp_StringConcat_ '%F %Z'` -FROM functional_alltypes AS t0 \ No newline at end of file + parse_timestamp('%F %Z', CONCAT(`t0`.`date_string_col`, ' America/New_York'), 'UTC') AS `StringToTimestamp_StringConcat_ '%F %Z'` +FROM `functional_alltypes` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_trailing_range_window/days/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_trailing_range_window/days/out.sql index 45c49c5adc20..35721bf95368 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_trailing_range_window/days/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_trailing_range_window/days/out.sql @@ -1,16 +1,16 @@ SELECT - t0.id, - t0.bool_col, - t0.tinyint_col, - t0.smallint_col, - t0.int_col, - t0.bigint_col, - t0.float_col, - t0.double_col, - t0.date_string_col, - t0.string_col, - t0.timestamp_col, - t0.year, - t0.month, - AVG(t0.float_col) OVER (ORDER BY t0.timestamp_col ASC RANGE BETWEEN INTERVAL '1' DAY preceding AND INTERVAL 0 DAY following) AS win_avg -FROM functional_alltypes AS t0 \ No newline at end of file + `t0`.`id`, + `t0`.`bool_col`, + `t0`.`tinyint_col`, + `t0`.`smallint_col`, + `t0`.`int_col`, + `t0`.`bigint_col`, + `t0`.`float_col`, + `t0`.`double_col`, + `t0`.`date_string_col`, + `t0`.`string_col`, + `t0`.`timestamp_col`, + `t0`.`year`, + `t0`.`month`, + AVG(`t0`.`float_col`) OVER (ORDER BY `t0`.`timestamp_col` ASC RANGE BETWEEN INTERVAL '1' DAY preceding AND INTERVAL 0 DAY following) AS `win_avg` +FROM `functional_alltypes` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_trailing_range_window/five/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_trailing_range_window/five/out.sql index 7483e117fe59..8bd0f083e008 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_trailing_range_window/five/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_trailing_range_window/five/out.sql @@ -1,16 +1,16 @@ SELECT - t0.id, - t0.bool_col, - t0.tinyint_col, - t0.smallint_col, - t0.int_col, - t0.bigint_col, - t0.float_col, - t0.double_col, - t0.date_string_col, - t0.string_col, - t0.timestamp_col, - t0.year, - t0.month, - AVG(t0.float_col) OVER (ORDER BY t0.timestamp_col ASC RANGE BETWEEN 5 preceding AND CURRENT ROW) AS win_avg -FROM functional_alltypes AS t0 \ No newline at end of file + `t0`.`id`, + `t0`.`bool_col`, + `t0`.`tinyint_col`, + `t0`.`smallint_col`, + `t0`.`int_col`, + `t0`.`bigint_col`, + `t0`.`float_col`, + `t0`.`double_col`, + `t0`.`date_string_col`, + `t0`.`string_col`, + `t0`.`timestamp_col`, + `t0`.`year`, + `t0`.`month`, + AVG(`t0`.`float_col`) OVER (ORDER BY `t0`.`timestamp_col` ASC RANGE BETWEEN 5 preceding AND CURRENT ROW) AS `win_avg` +FROM `functional_alltypes` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_trailing_range_window/hours/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_trailing_range_window/hours/out.sql index 497fe55410fe..31ee99c82c64 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_trailing_range_window/hours/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_trailing_range_window/hours/out.sql @@ -1,16 +1,16 @@ SELECT - t0.id, - t0.bool_col, - t0.tinyint_col, - t0.smallint_col, - t0.int_col, - t0.bigint_col, - t0.float_col, - t0.double_col, - t0.date_string_col, - t0.string_col, - t0.timestamp_col, - t0.year, - t0.month, - AVG(t0.float_col) OVER (ORDER BY t0.timestamp_col ASC RANGE BETWEEN INTERVAL '1' HOUR preceding AND INTERVAL 0 HOUR following) AS win_avg -FROM functional_alltypes AS t0 \ No newline at end of file + `t0`.`id`, + `t0`.`bool_col`, + `t0`.`tinyint_col`, + `t0`.`smallint_col`, + `t0`.`int_col`, + `t0`.`bigint_col`, + `t0`.`float_col`, + `t0`.`double_col`, + `t0`.`date_string_col`, + `t0`.`string_col`, + `t0`.`timestamp_col`, + `t0`.`year`, + `t0`.`month`, + AVG(`t0`.`float_col`) OVER (ORDER BY `t0`.`timestamp_col` ASC RANGE BETWEEN INTERVAL '1' HOUR preceding AND INTERVAL 0 HOUR following) AS `win_avg` +FROM `functional_alltypes` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_trailing_range_window/micros/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_trailing_range_window/micros/out.sql index 37c7b9452f03..61ec48e6dea0 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_trailing_range_window/micros/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_trailing_range_window/micros/out.sql @@ -1,16 +1,16 @@ SELECT - t0.id, - t0.bool_col, - t0.tinyint_col, - t0.smallint_col, - t0.int_col, - t0.bigint_col, - t0.float_col, - t0.double_col, - t0.date_string_col, - t0.string_col, - t0.timestamp_col, - t0.year, - t0.month, - AVG(t0.float_col) OVER (ORDER BY t0.timestamp_col ASC RANGE BETWEEN INTERVAL '1' MICROSECOND preceding AND INTERVAL 0 MICROSECOND following) AS win_avg -FROM functional_alltypes AS t0 \ No newline at end of file + `t0`.`id`, + `t0`.`bool_col`, + `t0`.`tinyint_col`, + `t0`.`smallint_col`, + `t0`.`int_col`, + `t0`.`bigint_col`, + `t0`.`float_col`, + `t0`.`double_col`, + `t0`.`date_string_col`, + `t0`.`string_col`, + `t0`.`timestamp_col`, + `t0`.`year`, + `t0`.`month`, + AVG(`t0`.`float_col`) OVER (ORDER BY `t0`.`timestamp_col` ASC RANGE BETWEEN INTERVAL '1' MICROSECOND preceding AND INTERVAL 0 MICROSECOND following) AS `win_avg` +FROM `functional_alltypes` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_trailing_range_window/minutes/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_trailing_range_window/minutes/out.sql index ab8f45c80717..20f4807e69cc 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_trailing_range_window/minutes/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_trailing_range_window/minutes/out.sql @@ -1,16 +1,16 @@ SELECT - t0.id, - t0.bool_col, - t0.tinyint_col, - t0.smallint_col, - t0.int_col, - t0.bigint_col, - t0.float_col, - t0.double_col, - t0.date_string_col, - t0.string_col, - t0.timestamp_col, - t0.year, - t0.month, - AVG(t0.float_col) OVER (ORDER BY t0.timestamp_col ASC RANGE BETWEEN INTERVAL '1' MINUTE preceding AND INTERVAL 0 MINUTE following) AS win_avg -FROM functional_alltypes AS t0 \ No newline at end of file + `t0`.`id`, + `t0`.`bool_col`, + `t0`.`tinyint_col`, + `t0`.`smallint_col`, + `t0`.`int_col`, + `t0`.`bigint_col`, + `t0`.`float_col`, + `t0`.`double_col`, + `t0`.`date_string_col`, + `t0`.`string_col`, + `t0`.`timestamp_col`, + `t0`.`year`, + `t0`.`month`, + AVG(`t0`.`float_col`) OVER (ORDER BY `t0`.`timestamp_col` ASC RANGE BETWEEN INTERVAL '1' MINUTE preceding AND INTERVAL 0 MINUTE following) AS `win_avg` +FROM `functional_alltypes` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_trailing_range_window/seconds/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_trailing_range_window/seconds/out.sql index 88e0656e843b..7083aacf02c2 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_trailing_range_window/seconds/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_trailing_range_window/seconds/out.sql @@ -1,16 +1,16 @@ SELECT - t0.id, - t0.bool_col, - t0.tinyint_col, - t0.smallint_col, - t0.int_col, - t0.bigint_col, - t0.float_col, - t0.double_col, - t0.date_string_col, - t0.string_col, - t0.timestamp_col, - t0.year, - t0.month, - AVG(t0.float_col) OVER (ORDER BY t0.timestamp_col ASC RANGE BETWEEN INTERVAL '1' SECOND preceding AND INTERVAL 0 SECOND following) AS win_avg -FROM functional_alltypes AS t0 \ No newline at end of file + `t0`.`id`, + `t0`.`bool_col`, + `t0`.`tinyint_col`, + `t0`.`smallint_col`, + `t0`.`int_col`, + `t0`.`bigint_col`, + `t0`.`float_col`, + `t0`.`double_col`, + `t0`.`date_string_col`, + `t0`.`string_col`, + `t0`.`timestamp_col`, + `t0`.`year`, + `t0`.`month`, + AVG(`t0`.`float_col`) OVER (ORDER BY `t0`.`timestamp_col` ASC RANGE BETWEEN INTERVAL '1' SECOND preceding AND INTERVAL 0 SECOND following) AS `win_avg` +FROM `functional_alltypes` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_trailing_range_window/two_days/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_trailing_range_window/two_days/out.sql index b2e631f727c3..aca5354fb4c5 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_trailing_range_window/two_days/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_trailing_range_window/two_days/out.sql @@ -1,16 +1,16 @@ SELECT - t0.id, - t0.bool_col, - t0.tinyint_col, - t0.smallint_col, - t0.int_col, - t0.bigint_col, - t0.float_col, - t0.double_col, - t0.date_string_col, - t0.string_col, - t0.timestamp_col, - t0.year, - t0.month, - AVG(t0.float_col) OVER (ORDER BY t0.timestamp_col ASC RANGE BETWEEN INTERVAL (EXTRACT(DAY FROM INTERVAL '1' DAY) * 2) DAY preceding AND INTERVAL 0 DAY following) AS win_avg -FROM functional_alltypes AS t0 \ No newline at end of file + `t0`.`id`, + `t0`.`bool_col`, + `t0`.`tinyint_col`, + `t0`.`smallint_col`, + `t0`.`int_col`, + `t0`.`bigint_col`, + `t0`.`float_col`, + `t0`.`double_col`, + `t0`.`date_string_col`, + `t0`.`string_col`, + `t0`.`timestamp_col`, + `t0`.`year`, + `t0`.`month`, + AVG(`t0`.`float_col`) OVER (ORDER BY `t0`.`timestamp_col` ASC RANGE BETWEEN INTERVAL (EXTRACT(DAY FROM INTERVAL '1' DAY) * 2) DAY preceding AND INTERVAL 0 DAY following) AS `win_avg` +FROM `functional_alltypes` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_trailing_range_window/week/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_trailing_range_window/week/out.sql index db904f4be055..d29dbecaadd0 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_trailing_range_window/week/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_trailing_range_window/week/out.sql @@ -1,16 +1,16 @@ SELECT - t0.id, - t0.bool_col, - t0.tinyint_col, - t0.smallint_col, - t0.int_col, - t0.bigint_col, - t0.float_col, - t0.double_col, - t0.date_string_col, - t0.string_col, - t0.timestamp_col, - t0.year, - t0.month, - AVG(t0.float_col) OVER (ORDER BY t0.timestamp_col ASC RANGE BETWEEN INTERVAL '1' WEEK preceding AND INTERVAL 0 WEEK following) AS win_avg -FROM functional_alltypes AS t0 \ No newline at end of file + `t0`.`id`, + `t0`.`bool_col`, + `t0`.`tinyint_col`, + `t0`.`smallint_col`, + `t0`.`int_col`, + `t0`.`bigint_col`, + `t0`.`float_col`, + `t0`.`double_col`, + `t0`.`date_string_col`, + `t0`.`string_col`, + `t0`.`timestamp_col`, + `t0`.`year`, + `t0`.`month`, + AVG(`t0`.`float_col`) OVER (ORDER BY `t0`.`timestamp_col` ASC RANGE BETWEEN INTERVAL '1' WEEK preceding AND INTERVAL 0 WEEK following) AS `win_avg` +FROM `functional_alltypes` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_union/False/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_union/False/out.sql index de91c71e2d5d..fb68ee11ccd0 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_union/False/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_union/False/out.sql @@ -1,23 +1,23 @@ 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`, + `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` FROM ( SELECT * - FROM functional_alltypes AS t0 + FROM `functional_alltypes` AS `t0` UNION ALL SELECT * - FROM functional_alltypes AS t0 -) AS t1 \ No newline at end of file + FROM `functional_alltypes` AS `t0` +) AS `t1` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_union/True/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_union/True/out.sql index 84d01ac2951a..26f4fe953438 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_union/True/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_union/True/out.sql @@ -1,23 +1,23 @@ 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`, + `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` FROM ( SELECT * - FROM functional_alltypes AS t0 + FROM `functional_alltypes` AS `t0` UNION DISTINCT SELECT * - FROM functional_alltypes AS t0 -) AS t1 \ No newline at end of file + FROM `functional_alltypes` AS `t0` +) AS `t1` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_union_cte/False-False/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_union_cte/False-False/out.sql index 3a6924cb5b2e..3252f19058dc 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_union_cte/False-False/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_union_cte/False-False/out.sql @@ -1,29 +1,29 @@ -WITH t1 AS ( +WITH `t1` AS ( SELECT - t0.string_col, - SUM(t0.double_col) AS metric - FROM functional_alltypes AS t0 + `t0`.`string_col`, + SUM(`t0`.`double_col`) AS `metric` + FROM `functional_alltypes` AS `t0` GROUP BY 1 ) SELECT - t7.string_col, - t7.metric + `t7`.`string_col`, + `t7`.`metric` FROM ( SELECT - t5.string_col, - t5.metric + `t5`.`string_col`, + `t5`.`metric` FROM ( SELECT * - FROM t1 AS t2 + FROM `t1` AS `t2` UNION ALL SELECT * - FROM t1 AS t4 - ) AS t5 + FROM `t1` AS `t4` + ) AS `t5` UNION ALL SELECT * - FROM t1 AS t3 -) AS t7 \ No newline at end of file + FROM `t1` AS `t3` +) AS `t7` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_union_cte/False-True/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_union_cte/False-True/out.sql index cc408f613945..fd5a8a571b37 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_union_cte/False-True/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_union_cte/False-True/out.sql @@ -1,29 +1,29 @@ -WITH t1 AS ( +WITH `t1` AS ( SELECT - t0.string_col, - SUM(t0.double_col) AS metric - FROM functional_alltypes AS t0 + `t0`.`string_col`, + SUM(`t0`.`double_col`) AS `metric` + FROM `functional_alltypes` AS `t0` GROUP BY 1 ) SELECT - t7.string_col, - t7.metric + `t7`.`string_col`, + `t7`.`metric` FROM ( SELECT - t5.string_col, - t5.metric + `t5`.`string_col`, + `t5`.`metric` FROM ( SELECT * - FROM t1 AS t2 + FROM `t1` AS `t2` UNION DISTINCT SELECT * - FROM t1 AS t4 - ) AS t5 + FROM `t1` AS `t4` + ) AS `t5` UNION ALL SELECT * - FROM t1 AS t3 -) AS t7 \ No newline at end of file + FROM `t1` AS `t3` +) AS `t7` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_union_cte/True-False/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_union_cte/True-False/out.sql index 81d85c90cbb2..40e1cd0c436b 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_union_cte/True-False/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_union_cte/True-False/out.sql @@ -1,29 +1,29 @@ -WITH t1 AS ( +WITH `t1` AS ( SELECT - t0.string_col, - SUM(t0.double_col) AS metric - FROM functional_alltypes AS t0 + `t0`.`string_col`, + SUM(`t0`.`double_col`) AS `metric` + FROM `functional_alltypes` AS `t0` GROUP BY 1 ) SELECT - t7.string_col, - t7.metric + `t7`.`string_col`, + `t7`.`metric` FROM ( SELECT - t5.string_col, - t5.metric + `t5`.`string_col`, + `t5`.`metric` FROM ( SELECT * - FROM t1 AS t2 + FROM `t1` AS `t2` UNION ALL SELECT * - FROM t1 AS t4 - ) AS t5 + FROM `t1` AS `t4` + ) AS `t5` UNION DISTINCT SELECT * - FROM t1 AS t3 -) AS t7 \ No newline at end of file + FROM `t1` AS `t3` +) AS `t7` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_union_cte/True-True/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_union_cte/True-True/out.sql index 77a087cb3362..e5b9e52f6722 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_union_cte/True-True/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_union_cte/True-True/out.sql @@ -1,29 +1,29 @@ -WITH t1 AS ( +WITH `t1` AS ( SELECT - t0.string_col, - SUM(t0.double_col) AS metric - FROM functional_alltypes AS t0 + `t0`.`string_col`, + SUM(`t0`.`double_col`) AS `metric` + FROM `functional_alltypes` AS `t0` GROUP BY 1 ) SELECT - t7.string_col, - t7.metric + `t7`.`string_col`, + `t7`.`metric` FROM ( SELECT - t5.string_col, - t5.metric + `t5`.`string_col`, + `t5`.`metric` FROM ( SELECT * - FROM t1 AS t2 + FROM `t1` AS `t2` UNION DISTINCT SELECT * - FROM t1 AS t4 - ) AS t5 + FROM `t1` AS `t4` + ) AS `t5` UNION DISTINCT SELECT * - FROM t1 AS t3 -) AS t7 \ No newline at end of file + FROM `t1` AS `t3` +) AS `t7` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_unnest/out_one_unnest.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_unnest/out_one_unnest.sql index 1efaf2f26d3a..58998846f040 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_unnest/out_one_unnest.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_unnest/out_one_unnest.sql @@ -1,16 +1,16 @@ SELECT - t0.rowindex, - IF(pos = pos_2, repeated_struct_col, NULL) AS repeated_struct_col -FROM array_test AS t0 -CROSS JOIN UNNEST(GENERATE_ARRAY(0, GREATEST(ARRAY_LENGTH(t0.repeated_struct_col)) - 1)) AS pos -CROSS JOIN UNNEST(t0.repeated_struct_col) AS repeated_struct_col WITH OFFSET AS pos_2 + `t0`.`rowindex`, + IF(pos = pos_2, `repeated_struct_col`, NULL) AS `repeated_struct_col` +FROM `array_test` AS `t0` +CROSS JOIN UNNEST(GENERATE_ARRAY(0, GREATEST(ARRAY_LENGTH(`t0`.`repeated_struct_col`)) - 1)) AS pos +CROSS JOIN UNNEST(`t0`.`repeated_struct_col`) AS `repeated_struct_col` WITH OFFSET AS pos_2 WHERE pos = pos_2 OR ( pos > ( - ARRAY_LENGTH(t0.repeated_struct_col) - 1 + ARRAY_LENGTH(`t0`.`repeated_struct_col`) - 1 ) AND pos_2 = ( - ARRAY_LENGTH(t0.repeated_struct_col) - 1 + ARRAY_LENGTH(`t0`.`repeated_struct_col`) - 1 ) ) \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_unnest/out_two_unnests.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_unnest/out_two_unnests.sql index febc60d6c4df..3a5cab0285bf 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_unnest/out_two_unnests.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_unnest/out_two_unnests.sql @@ -1,32 +1,32 @@ SELECT - IF(pos = pos_2, level_two, NULL) AS level_two + IF(pos = pos_2, `level_two`, NULL) AS `level_two` FROM ( SELECT - t0.rowindex, - IF(pos = pos_2, level_one, NULL).nested_struct_col AS level_one - FROM array_test AS t0 - CROSS JOIN UNNEST(GENERATE_ARRAY(0, GREATEST(ARRAY_LENGTH(t0.repeated_struct_col)) - 1)) AS pos - CROSS JOIN UNNEST(t0.repeated_struct_col) AS level_one WITH OFFSET AS pos_2 + `t0`.`rowindex`, + IF(pos = pos_2, `level_one`, NULL).`nested_struct_col` AS `level_one` + FROM `array_test` AS `t0` + CROSS JOIN UNNEST(GENERATE_ARRAY(0, GREATEST(ARRAY_LENGTH(`t0`.`repeated_struct_col`)) - 1)) AS pos + CROSS JOIN UNNEST(`t0`.`repeated_struct_col`) AS `level_one` WITH OFFSET AS pos_2 WHERE pos = pos_2 OR ( pos > ( - ARRAY_LENGTH(t0.repeated_struct_col) - 1 + ARRAY_LENGTH(`t0`.`repeated_struct_col`) - 1 ) AND pos_2 = ( - ARRAY_LENGTH(t0.repeated_struct_col) - 1 + ARRAY_LENGTH(`t0`.`repeated_struct_col`) - 1 ) ) -) AS t1 -CROSS JOIN UNNEST(GENERATE_ARRAY(0, GREATEST(ARRAY_LENGTH(t1.level_one)) - 1)) AS pos -CROSS JOIN UNNEST(t1.level_one) AS level_two WITH OFFSET AS pos_2 +) AS `t1` +CROSS JOIN UNNEST(GENERATE_ARRAY(0, GREATEST(ARRAY_LENGTH(`t1`.`level_one`)) - 1)) AS pos +CROSS JOIN UNNEST(`t1`.`level_one`) AS `level_two` WITH OFFSET AS pos_2 WHERE pos = pos_2 OR ( pos > ( - ARRAY_LENGTH(t1.level_one) - 1 + ARRAY_LENGTH(`t1`.`level_one`) - 1 ) AND pos_2 = ( - ARRAY_LENGTH(t1.level_one) - 1 + ARRAY_LENGTH(`t1`.`level_one`) - 1 ) ) \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_window_function/current_foll/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_window_function/current_foll/out.sql index f7af87cc3889..7621ca814cca 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_window_function/current_foll/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_window_function/current_foll/out.sql @@ -1,16 +1,16 @@ SELECT - t0.id, - t0.bool_col, - t0.tinyint_col, - t0.smallint_col, - t0.int_col, - t0.bigint_col, - t0.float_col, - t0.double_col, - t0.date_string_col, - t0.string_col, - t0.timestamp_col, - t0.year, - t0.month, - AVG(t0.float_col) OVER (PARTITION BY t0.year ORDER BY t0.timestamp_col ASC ROWS BETWEEN CURRENT ROW AND 2 following) AS win_avg -FROM functional_alltypes AS t0 \ No newline at end of file + `t0`.`id`, + `t0`.`bool_col`, + `t0`.`tinyint_col`, + `t0`.`smallint_col`, + `t0`.`int_col`, + `t0`.`bigint_col`, + `t0`.`float_col`, + `t0`.`double_col`, + `t0`.`date_string_col`, + `t0`.`string_col`, + `t0`.`timestamp_col`, + `t0`.`year`, + `t0`.`month`, + AVG(`t0`.`float_col`) OVER (PARTITION BY `t0`.`year` ORDER BY `t0`.`timestamp_col` ASC ROWS BETWEEN CURRENT ROW AND 2 following) AS `win_avg` +FROM `functional_alltypes` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_window_function/prec_current/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_window_function/prec_current/out.sql index 812d5c8e17fc..4487cb8125d5 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_window_function/prec_current/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_window_function/prec_current/out.sql @@ -1,16 +1,16 @@ SELECT - t0.id, - t0.bool_col, - t0.tinyint_col, - t0.smallint_col, - t0.int_col, - t0.bigint_col, - t0.float_col, - t0.double_col, - t0.date_string_col, - t0.string_col, - t0.timestamp_col, - t0.year, - t0.month, - AVG(t0.float_col) OVER (PARTITION BY t0.year ORDER BY t0.timestamp_col ASC ROWS BETWEEN 1 preceding AND CURRENT ROW) AS win_avg -FROM functional_alltypes AS t0 \ No newline at end of file + `t0`.`id`, + `t0`.`bool_col`, + `t0`.`tinyint_col`, + `t0`.`smallint_col`, + `t0`.`int_col`, + `t0`.`bigint_col`, + `t0`.`float_col`, + `t0`.`double_col`, + `t0`.`date_string_col`, + `t0`.`string_col`, + `t0`.`timestamp_col`, + `t0`.`year`, + `t0`.`month`, + AVG(`t0`.`float_col`) OVER (PARTITION BY `t0`.`year` ORDER BY `t0`.`timestamp_col` ASC ROWS BETWEEN 1 preceding AND CURRENT ROW) AS `win_avg` +FROM `functional_alltypes` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_window_function/prec_prec/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_window_function/prec_prec/out.sql index dc3996ac2b7d..b925096a5fdc 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_window_function/prec_prec/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_window_function/prec_prec/out.sql @@ -1,16 +1,16 @@ SELECT - t0.id, - t0.bool_col, - t0.tinyint_col, - t0.smallint_col, - t0.int_col, - t0.bigint_col, - t0.float_col, - t0.double_col, - t0.date_string_col, - t0.string_col, - t0.timestamp_col, - t0.year, - t0.month, - AVG(t0.float_col) OVER (PARTITION BY t0.year ORDER BY t0.timestamp_col ASC ROWS BETWEEN 4 preceding AND 2 preceding) AS win_avg -FROM functional_alltypes AS t0 \ No newline at end of file + `t0`.`id`, + `t0`.`bool_col`, + `t0`.`tinyint_col`, + `t0`.`smallint_col`, + `t0`.`int_col`, + `t0`.`bigint_col`, + `t0`.`float_col`, + `t0`.`double_col`, + `t0`.`date_string_col`, + `t0`.`string_col`, + `t0`.`timestamp_col`, + `t0`.`year`, + `t0`.`month`, + AVG(`t0`.`float_col`) OVER (PARTITION BY `t0`.`year` ORDER BY `t0`.`timestamp_col` ASC ROWS BETWEEN 4 preceding AND 2 preceding) AS `win_avg` +FROM `functional_alltypes` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_window_unbounded/following/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_window_unbounded/following/out.sql index 4efa722dccbc..d84c347e7921 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_window_unbounded/following/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_window_unbounded/following/out.sql @@ -1,3 +1,3 @@ SELECT - SUM(t0.a) OVER (ROWS BETWEEN 1 following AND UNBOUNDED FOLLOWING) AS tmp -FROM t AS t0 \ No newline at end of file + SUM(`t0`.`a`) OVER (ROWS BETWEEN 1 following AND UNBOUNDED FOLLOWING) AS `tmp` +FROM `t` AS `t0` \ No newline at end of file diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_window_unbounded/preceding/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_window_unbounded/preceding/out.sql index fe5c57096cc2..ae094f1c4b92 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_window_unbounded/preceding/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_window_unbounded/preceding/out.sql @@ -1,3 +1,3 @@ SELECT - SUM(t0.a) OVER (ROWS BETWEEN UNBOUNDED PRECEDING AND 1 preceding) AS tmp -FROM t AS t0 \ No newline at end of file + SUM(`t0`.`a`) OVER (ROWS BETWEEN UNBOUNDED PRECEDING AND 1 preceding) AS `tmp` +FROM `t` AS `t0` \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_aggregations/test_reduction_where/count/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_aggregations/test_reduction_where/count/out.sql index af5c023dd5ff..1b5b80c2db62 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_aggregations/test_reduction_where/count/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_aggregations/test_reduction_where/count/out.sql @@ -1,3 +1,3 @@ SELECT - countIf(t0.double_col, t0.bigint_col < 70) AS "Count(double_col, Less(bigint_col, 70))" -FROM functional_alltypes AS t0 \ No newline at end of file + countIf("t0"."double_col", "t0"."bigint_col" < 70) AS "Count(double_col, Less(bigint_col, 70))" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_aggregations/test_reduction_where/max/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_aggregations/test_reduction_where/max/out.sql index b2708dc6d6f7..729336a0d44b 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_aggregations/test_reduction_where/max/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_aggregations/test_reduction_where/max/out.sql @@ -1,3 +1,3 @@ SELECT - maxIf(t0.double_col, t0.bigint_col < 70) AS "Max(double_col, Less(bigint_col, 70))" -FROM functional_alltypes AS t0 \ No newline at end of file + maxIf("t0"."double_col", "t0"."bigint_col" < 70) AS "Max(double_col, Less(bigint_col, 70))" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_aggregations/test_reduction_where/mean/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_aggregations/test_reduction_where/mean/out.sql index 6280758e636b..a3582e4cbdcf 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_aggregations/test_reduction_where/mean/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_aggregations/test_reduction_where/mean/out.sql @@ -1,3 +1,3 @@ SELECT - avgIf(t0.double_col, t0.bigint_col < 70) AS "Mean(double_col, Less(bigint_col, 70))" -FROM functional_alltypes AS t0 \ No newline at end of file + avgIf("t0"."double_col", "t0"."bigint_col" < 70) AS "Mean(double_col, Less(bigint_col, 70))" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_aggregations/test_reduction_where/min/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_aggregations/test_reduction_where/min/out.sql index 052e8bf363ea..377d48bf68d1 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_aggregations/test_reduction_where/min/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_aggregations/test_reduction_where/min/out.sql @@ -1,3 +1,3 @@ SELECT - minIf(t0.double_col, t0.bigint_col < 70) AS "Min(double_col, Less(bigint_col, 70))" -FROM functional_alltypes AS t0 \ No newline at end of file + minIf("t0"."double_col", "t0"."bigint_col" < 70) AS "Min(double_col, Less(bigint_col, 70))" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_aggregations/test_reduction_where/std/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_aggregations/test_reduction_where/std/out.sql index fc3700a892ee..a31236bb2501 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_aggregations/test_reduction_where/std/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_aggregations/test_reduction_where/std/out.sql @@ -1,3 +1,3 @@ SELECT - stddevSampIf(t0.double_col, t0.bigint_col < 70) AS "StandardDev(double_col, Less(bigint_col, 70))" -FROM functional_alltypes AS t0 \ No newline at end of file + stddevSampIf("t0"."double_col", "t0"."bigint_col" < 70) AS "StandardDev(double_col, Less(bigint_col, 70))" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_aggregations/test_reduction_where/sum/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_aggregations/test_reduction_where/sum/out.sql index 60e9ba221527..f5b04fc2ab38 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_aggregations/test_reduction_where/sum/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_aggregations/test_reduction_where/sum/out.sql @@ -1,3 +1,3 @@ SELECT - sumIf(t0.double_col, t0.bigint_col < 70) AS "Sum(double_col, Less(bigint_col, 70))" -FROM functional_alltypes AS t0 \ No newline at end of file + sumIf("t0"."double_col", "t0"."bigint_col" < 70) AS "Sum(double_col, Less(bigint_col, 70))" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_aggregations/test_reduction_where/var/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_aggregations/test_reduction_where/var/out.sql index d21dbed60a49..bd479ba09a53 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_aggregations/test_reduction_where/var/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_aggregations/test_reduction_where/var/out.sql @@ -1,3 +1,3 @@ SELECT - varSampIf(t0.double_col, t0.bigint_col < 70) AS "Variance(double_col, Less(bigint_col, 70))" -FROM functional_alltypes AS t0 \ No newline at end of file + varSampIf("t0"."double_col", "t0"."bigint_col" < 70) AS "Variance(double_col, Less(bigint_col, 70))" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_aggregations/test_std_var_pop/std/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_aggregations/test_std_var_pop/std/out.sql index 16791db4e361..f4d55c3823ff 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_aggregations/test_std_var_pop/std/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_aggregations/test_std_var_pop/std/out.sql @@ -1,3 +1,3 @@ SELECT - stddevPopIf(t0.double_col, t0.bigint_col < 70) AS "StandardDev(double_col, Less(bigint_col, 70))" -FROM functional_alltypes AS t0 \ No newline at end of file + stddevPopIf("t0"."double_col", "t0"."bigint_col" < 70) AS "StandardDev(double_col, Less(bigint_col, 70))" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_aggregations/test_std_var_pop/var/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_aggregations/test_std_var_pop/var/out.sql index 3bc94bce8a9f..bbde294172d1 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_aggregations/test_std_var_pop/var/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_aggregations/test_std_var_pop/var/out.sql @@ -1,3 +1,3 @@ SELECT - varPopIf(t0.double_col, t0.bigint_col < 70) AS "Variance(double_col, Less(bigint_col, 70))" -FROM functional_alltypes AS t0 \ No newline at end of file + varPopIf("t0"."double_col", "t0"."bigint_col" < 70) AS "Variance(double_col, Less(bigint_col, 70))" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_cast_double_col/float/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_cast_double_col/float/out.sql index f97b0b7e0747..6e208faf9e4b 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_cast_double_col/float/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_cast_double_col/float/out.sql @@ -1,3 +1,3 @@ SELECT - t0.double_col -FROM functional_alltypes AS t0 \ No newline at end of file + "t0"."double_col" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_cast_double_col/float32/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_cast_double_col/float32/out.sql index 98753d331890..a2ad2afc9e9d 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_cast_double_col/float32/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_cast_double_col/float32/out.sql @@ -1,3 +1,3 @@ SELECT - CAST(t0.double_col AS Nullable(Float32)) AS "Cast(double_col, float32)" -FROM functional_alltypes AS t0 \ No newline at end of file + CAST("t0"."double_col" AS Nullable(Float32)) AS "Cast(double_col, float32)" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_cast_double_col/float64/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_cast_double_col/float64/out.sql index eccf0cf30586..9c0d96c91a3f 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_cast_double_col/float64/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_cast_double_col/float64/out.sql @@ -1,3 +1,3 @@ SELECT - CAST(t0.double_col AS Float64) AS "Cast(double_col, !float64)" -FROM functional_alltypes AS t0 \ No newline at end of file + CAST("t0"."double_col" AS Float64) AS "Cast(double_col, !float64)" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_cast_double_col/int16/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_cast_double_col/int16/out.sql index b7ed3873ec03..3cf7ca0c8451 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_cast_double_col/int16/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_cast_double_col/int16/out.sql @@ -1,3 +1,3 @@ SELECT - CAST(t0.double_col AS Nullable(Int16)) AS "Cast(double_col, int16)" -FROM functional_alltypes AS t0 \ No newline at end of file + CAST("t0"."double_col" AS Nullable(Int16)) AS "Cast(double_col, int16)" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_cast_double_col/int8/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_cast_double_col/int8/out.sql index e748f08dfdf7..798bce54ff29 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_cast_double_col/int8/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_cast_double_col/int8/out.sql @@ -1,3 +1,3 @@ SELECT - CAST(t0.double_col AS Nullable(Int8)) AS "Cast(double_col, int8)" -FROM functional_alltypes AS t0 \ No newline at end of file + CAST("t0"."double_col" AS Nullable(Int8)) AS "Cast(double_col, int8)" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_cast_string_col/date/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_cast_string_col/date/out.sql index 4af6d58848b2..76d4640c9d6f 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_cast_string_col/date/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_cast_string_col/date/out.sql @@ -1,3 +1,3 @@ SELECT - CAST(t0.string_col AS Nullable(DATE)) AS "Cast(string_col, date)" -FROM functional_alltypes AS t0 \ No newline at end of file + CAST("t0"."string_col" AS Nullable(DATE)) AS "Cast(string_col, date)" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_cast_string_col/int16/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_cast_string_col/int16/out.sql index ef55adad9689..2afe5df2b14f 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_cast_string_col/int16/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_cast_string_col/int16/out.sql @@ -1,3 +1,3 @@ SELECT - CAST(t0.string_col AS Nullable(Int16)) AS "Cast(string_col, int16)" -FROM functional_alltypes AS t0 \ No newline at end of file + CAST("t0"."string_col" AS Nullable(Int16)) AS "Cast(string_col, int16)" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_cast_string_col/int8/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_cast_string_col/int8/out.sql index 012a8420810c..75bd2d4778ca 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_cast_string_col/int8/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_cast_string_col/int8/out.sql @@ -1,3 +1,3 @@ SELECT - CAST(t0.string_col AS Nullable(Int8)) AS "Cast(string_col, int8)" -FROM functional_alltypes AS t0 \ No newline at end of file + CAST("t0"."string_col" AS Nullable(Int8)) AS "Cast(string_col, int8)" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_cast_string_col/mapstring_int64/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_cast_string_col/mapstring_int64/out.sql index fd415c3d093a..1e26580d6098 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_cast_string_col/mapstring_int64/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_cast_string_col/mapstring_int64/out.sql @@ -1,3 +1,3 @@ SELECT - CAST(t0.string_col AS Map(String, Nullable(Int64))) AS "Cast(string_col, !map)" -FROM functional_alltypes AS t0 \ No newline at end of file + CAST("t0"."string_col" AS Map(String, Nullable(Int64))) AS "Cast(string_col, !map)" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_cast_string_col/string/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_cast_string_col/string/out.sql index 188a52291632..f819d430aab0 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_cast_string_col/string/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_cast_string_col/string/out.sql @@ -1,3 +1,3 @@ SELECT - CAST(t0.string_col AS String) AS "Cast(string_col, !string)" -FROM functional_alltypes AS t0 \ No newline at end of file + CAST("t0"."string_col" AS String) AS "Cast(string_col, !string)" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_cast_string_col/structa_string_b_int64/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_cast_string_col/structa_string_b_int64/out.sql index b7eb2caf81cd..7ccbd7140a78 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_cast_string_col/structa_string_b_int64/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_cast_string_col/structa_string_b_int64/out.sql @@ -1,3 +1,3 @@ SELECT - CAST(t0.string_col AS Tuple(a Nullable(String), b Nullable(Int64))) AS "Cast(string_col, !struct)" -FROM functional_alltypes AS t0 \ No newline at end of file + CAST("t0"."string_col" AS Tuple(a Nullable(String), b Nullable(Int64))) AS "Cast(string_col, !struct)" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_cast_string_col/timestamp/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_cast_string_col/timestamp/out.sql index 7141924de135..65f976d317ba 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_cast_string_col/timestamp/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_cast_string_col/timestamp/out.sql @@ -1,3 +1,3 @@ SELECT - CAST(t0.string_col AS Nullable(DATETIME)) AS "Cast(string_col, timestamp)" -FROM functional_alltypes AS t0 \ No newline at end of file + CAST("t0"."string_col" AS Nullable(DATETIME)) AS "Cast(string_col, timestamp)" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_column_regexp_extract/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_column_regexp_extract/out.sql index 17cb19de2901..2da83aca651e 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_column_regexp_extract/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_column_regexp_extract/out.sql @@ -1,7 +1,9 @@ SELECT CASE - WHEN notEmpty(extractGroups(CAST(t0.string_col AS String), CONCAT('(', '[\d]+', ')'))[3 + 1]) - THEN extractGroups(CAST(t0.string_col AS String), CONCAT('(', '[\d]+', ')'))[3 + 1] + WHEN notEmpty( + extractGroups(CAST("t0"."string_col" AS String), CONCAT('(', '[\d]+', ')'))[3 + 1] + ) + THEN extractGroups(CAST("t0"."string_col" AS String), CONCAT('(', '[\d]+', ')'))[3 + 1] ELSE NULL END AS "RegexExtract(string_col, '[\\d]+', 3)" -FROM functional_alltypes AS t0 \ No newline at end of file +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_column_regexp_replace/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_column_regexp_replace/out.sql index 2d24cf4611e5..5eb21c433e57 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_column_regexp_replace/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_column_regexp_replace/out.sql @@ -1,3 +1,3 @@ SELECT - replaceRegexpAll(t0.string_col, '[\d]+', 'aaa') AS "RegexReplace(string_col, '[\\d]+', 'aaa')" -FROM functional_alltypes AS t0 \ No newline at end of file + replaceRegexpAll("t0"."string_col", '[\d]+', 'aaa') AS "RegexReplace(string_col, '[\\d]+', 'aaa')" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_greatest_least/out1.sql b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_greatest_least/out1.sql index 30f8b69f93bc..ceb370f312cc 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_greatest_least/out1.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_greatest_least/out1.sql @@ -1,3 +1,3 @@ SELECT - GREATEST(t0.int_col, 10) AS "Greatest()" -FROM functional_alltypes AS t0 \ No newline at end of file + GREATEST("t0"."int_col", 10) AS "Greatest()" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_greatest_least/out2.sql b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_greatest_least/out2.sql index a55d6c21b8bb..85601ed38dad 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_greatest_least/out2.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_greatest_least/out2.sql @@ -1,3 +1,3 @@ SELECT - GREATEST(t0.int_col, t0.bigint_col) AS "Greatest()" -FROM functional_alltypes AS t0 \ No newline at end of file + GREATEST("t0"."int_col", "t0"."bigint_col") AS "Greatest()" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_greatest_least/out3.sql b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_greatest_least/out3.sql index 8082272f6adf..3dc8affe7d89 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_greatest_least/out3.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_greatest_least/out3.sql @@ -1,3 +1,3 @@ SELECT - LEAST(t0.int_col, 10) AS "Least()" -FROM functional_alltypes AS t0 \ No newline at end of file + LEAST("t0"."int_col", 10) AS "Least()" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_greatest_least/out4.sql b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_greatest_least/out4.sql index 81663e74f595..4f57aa348d16 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_greatest_least/out4.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_greatest_least/out4.sql @@ -1,3 +1,3 @@ SELECT - LEAST(t0.int_col, t0.bigint_col) AS "Least()" -FROM functional_alltypes AS t0 \ No newline at end of file + LEAST("t0"."int_col", "t0"."bigint_col") AS "Least()" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_group_concat/comma_none/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_group_concat/comma_none/out.sql index 267418e4dbbb..1c85b5fbb75a 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_group_concat/comma_none/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_group_concat/comma_none/out.sql @@ -1,7 +1,7 @@ SELECT CASE - WHEN empty(groupArray(t0.string_col)) + WHEN empty(groupArray("t0"."string_col")) THEN NULL - ELSE arrayStringConcat(groupArray(t0.string_col), ',') + ELSE arrayStringConcat(groupArray("t0"."string_col"), ',') END AS "GroupConcat(string_col, ',')" -FROM functional_alltypes AS t0 \ No newline at end of file +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_group_concat/comma_zero/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_group_concat/comma_zero/out.sql index 007b81ddbd2b..7846aad19960 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_group_concat/comma_zero/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_group_concat/comma_zero/out.sql @@ -1,7 +1,7 @@ SELECT CASE - WHEN empty(groupArrayIf(t0.string_col, t0.bool_col = 0)) + WHEN empty(groupArrayIf("t0"."string_col", "t0"."bool_col" = 0)) THEN NULL - ELSE arrayStringConcat(groupArrayIf(t0.string_col, t0.bool_col = 0), ',') + ELSE arrayStringConcat(groupArrayIf("t0"."string_col", "t0"."bool_col" = 0), ',') END AS "GroupConcat(string_col, ',', Equals(bool_col, 0))" -FROM functional_alltypes AS t0 \ No newline at end of file +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_group_concat/minus_none/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_group_concat/minus_none/out.sql index d0c6e0c84539..b68d30a94cec 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_group_concat/minus_none/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_group_concat/minus_none/out.sql @@ -1,7 +1,7 @@ SELECT CASE - WHEN empty(groupArray(t0.string_col)) + WHEN empty(groupArray("t0"."string_col")) THEN NULL - ELSE arrayStringConcat(groupArray(t0.string_col), '-') + ELSE arrayStringConcat(groupArray("t0"."string_col"), '-') END AS "GroupConcat(string_col, '-')" -FROM functional_alltypes AS t0 \ No newline at end of file +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_hash/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_hash/out.sql index 5f84917b8eb9..bfd18d927565 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_hash/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_hash/out.sql @@ -1,3 +1,3 @@ SELECT - sipHash64(t0.string_col) AS "Hash(string_col)" -FROM functional_alltypes AS t0 \ No newline at end of file + sipHash64("t0"."string_col") AS "Hash(string_col)" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_noop_cast/bigint_col/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_noop_cast/bigint_col/out.sql index b2e0d4507c4f..32ed9ce5dec7 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_noop_cast/bigint_col/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_noop_cast/bigint_col/out.sql @@ -1,3 +1,3 @@ SELECT - t0.bigint_col -FROM functional_alltypes AS t0 \ No newline at end of file + "t0"."bigint_col" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_noop_cast/bool_col/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_noop_cast/bool_col/out.sql index d967873daf1f..581ad8820c60 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_noop_cast/bool_col/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_noop_cast/bool_col/out.sql @@ -1,3 +1,3 @@ SELECT - t0.bool_col -FROM functional_alltypes AS t0 \ No newline at end of file + "t0"."bool_col" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_noop_cast/date_string_col/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_noop_cast/date_string_col/out.sql index c8ad0f838a31..95fc17b5c1b5 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_noop_cast/date_string_col/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_noop_cast/date_string_col/out.sql @@ -1,3 +1,3 @@ SELECT - t0.date_string_col -FROM functional_alltypes AS t0 \ No newline at end of file + "t0"."date_string_col" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_noop_cast/double_col/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_noop_cast/double_col/out.sql index f97b0b7e0747..6e208faf9e4b 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_noop_cast/double_col/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_noop_cast/double_col/out.sql @@ -1,3 +1,3 @@ SELECT - t0.double_col -FROM functional_alltypes AS t0 \ No newline at end of file + "t0"."double_col" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_noop_cast/float_col/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_noop_cast/float_col/out.sql index 33277148af85..011938c86330 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_noop_cast/float_col/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_noop_cast/float_col/out.sql @@ -1,3 +1,3 @@ SELECT - t0.float_col -FROM functional_alltypes AS t0 \ No newline at end of file + "t0"."float_col" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_noop_cast/id/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_noop_cast/id/out.sql index b4012dbb377d..e162ed46b465 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_noop_cast/id/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_noop_cast/id/out.sql @@ -1,3 +1,3 @@ SELECT - t0.id -FROM functional_alltypes AS t0 \ No newline at end of file + "t0"."id" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_noop_cast/int_col/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_noop_cast/int_col/out.sql index 6b3541821ed4..ad1282f2b06b 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_noop_cast/int_col/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_noop_cast/int_col/out.sql @@ -1,3 +1,3 @@ SELECT - t0.int_col -FROM functional_alltypes AS t0 \ No newline at end of file + "t0"."int_col" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_noop_cast/month/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_noop_cast/month/out.sql index d0eb5143c2b4..8cf6f8be9ab1 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_noop_cast/month/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_noop_cast/month/out.sql @@ -1,3 +1,3 @@ SELECT - t0.month -FROM functional_alltypes AS t0 \ No newline at end of file + "t0"."month" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_noop_cast/smallint_col/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_noop_cast/smallint_col/out.sql index dfcd8e0c0149..9d35742155b4 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_noop_cast/smallint_col/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_noop_cast/smallint_col/out.sql @@ -1,3 +1,3 @@ SELECT - t0.smallint_col -FROM functional_alltypes AS t0 \ No newline at end of file + "t0"."smallint_col" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_noop_cast/string_col/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_noop_cast/string_col/out.sql index cfe88fb96a8c..11a14ce0716c 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_noop_cast/string_col/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_noop_cast/string_col/out.sql @@ -1,3 +1,3 @@ SELECT - t0.string_col -FROM functional_alltypes AS t0 \ No newline at end of file + "t0"."string_col" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_noop_cast/timestamp_col/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_noop_cast/timestamp_col/out.sql index 860302ea8039..cffb9b1135c6 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_noop_cast/timestamp_col/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_noop_cast/timestamp_col/out.sql @@ -1,3 +1,3 @@ SELECT - t0.timestamp_col -FROM functional_alltypes AS t0 \ No newline at end of file + "t0"."timestamp_col" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_noop_cast/tinyint_col/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_noop_cast/tinyint_col/out.sql index c9f057e3aa11..8eeeecefaf66 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_noop_cast/tinyint_col/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_noop_cast/tinyint_col/out.sql @@ -1,3 +1,3 @@ SELECT - t0.tinyint_col -FROM functional_alltypes AS t0 \ No newline at end of file + "t0"."tinyint_col" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_noop_cast/year/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_noop_cast/year/out.sql index 5295b8fc6a8d..0afd5e4842d5 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_noop_cast/year/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_noop_cast/year/out.sql @@ -1,3 +1,3 @@ SELECT - t0.year -FROM functional_alltypes AS t0 \ No newline at end of file + "t0"."year" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_string_column_find/out1.sql b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_string_column_find/out1.sql index fb3ba7be84f7..0647f5bfb1c6 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_string_column_find/out1.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_string_column_find/out1.sql @@ -1,3 +1,3 @@ SELECT - locate(t0.string_col, 'a') - 1 AS "StringFind(string_col, 'a')" -FROM functional_alltypes AS t0 \ No newline at end of file + locate("t0"."string_col", 'a') - 1 AS "StringFind(string_col, 'a')" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_string_column_find/out2.sql b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_string_column_find/out2.sql index f80e7854276b..36e1ffb4878c 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_string_column_find/out2.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_string_column_find/out2.sql @@ -1,3 +1,3 @@ SELECT - locate(t0.string_col, t0.string_col) - 1 AS "StringFind(string_col, string_col)" -FROM functional_alltypes AS t0 \ No newline at end of file + locate("t0"."string_col", "t0"."string_col") - 1 AS "StringFind(string_col, string_col)" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_string_column_find_in_set/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_string_column_find_in_set/out.sql index 36d0b0d247ca..a418947dff5e 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_string_column_find_in_set/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_string_column_find_in_set/out.sql @@ -1,3 +1,3 @@ SELECT - indexOf(['a', 'b', 'c'], t0.string_col) - 1 AS "FindInSet(string_col)" -FROM functional_alltypes AS t0 \ No newline at end of file + indexOf(['a', 'b', 'c'], "t0"."string_col") - 1 AS "FindInSet(string_col)" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_string_column_like/out1.sql b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_string_column_like/out1.sql index 8323a166f3d4..f01d4b40fac4 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_string_column_like/out1.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_string_column_like/out1.sql @@ -1,3 +1,3 @@ SELECT - t0.string_col LIKE 'foo%' AS "StringSQLLike(string_col, 'foo%')" -FROM functional_alltypes AS t0 \ No newline at end of file + "t0"."string_col" LIKE 'foo%' AS "StringSQLLike(string_col, 'foo%')" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_string_column_like/out2.sql b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_string_column_like/out2.sql index 8ec21cad88cf..89813e81d3b0 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_string_column_like/out2.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_string_column_like/out2.sql @@ -1,3 +1,3 @@ SELECT - t0.string_col LIKE 'foo%' OR t0.string_col LIKE '%bar' AS "Or(StringSQLLike(string_col, 'foo%'), StringSQLLike(string_col, '%bar'))" -FROM functional_alltypes AS t0 \ No newline at end of file + "t0"."string_col" LIKE 'foo%' OR "t0"."string_col" LIKE '%bar' AS "Or(StringSQLLike(string_col, 'foo%'), StringSQLLike(string_col, '%bar'))" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_string_column_substring/out1.sql b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_string_column_substring/out1.sql index c63c6f5051b3..191676d95a33 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_string_column_substring/out1.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_string_column_substring/out1.sql @@ -1,7 +1,7 @@ SELECT CASE WHEN 2 >= 0 - THEN SUBSTRING(t0.string_col, 2 + 1) - ELSE SUBSTRING(t0.string_col, LENGTH(t0.string_col) + 2 + 1) + THEN SUBSTRING("t0"."string_col", 2 + 1) + ELSE SUBSTRING("t0"."string_col", LENGTH("t0"."string_col") + 2 + 1) END AS "Substring(string_col, 2)" -FROM functional_alltypes AS t0 \ No newline at end of file +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_string_column_substring/out2.sql b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_string_column_substring/out2.sql index c121d8cb9bda..d45d241e8840 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_string_column_substring/out2.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_string_column_substring/out2.sql @@ -1,7 +1,7 @@ SELECT CASE WHEN 0 >= 0 - THEN SUBSTRING(t0.string_col, 0 + 1, 3) - ELSE SUBSTRING(t0.string_col, LENGTH(t0.string_col) + 0 + 1, 3) + THEN SUBSTRING("t0"."string_col", 0 + 1, 3) + ELSE SUBSTRING("t0"."string_col", LENGTH("t0"."string_col") + 0 + 1, 3) END AS "Substring(string_col, 0, 3)" -FROM functional_alltypes AS t0 \ No newline at end of file +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_timestamp_cast/out1.sql b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_timestamp_cast/out1.sql index 1491cfdc2a67..8c45bbd7d6d7 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_timestamp_cast/out1.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_timestamp_cast/out1.sql @@ -1,3 +1,3 @@ SELECT - CAST(t0.timestamp_col AS DATETIME) AS "Cast(timestamp_col, !timestamp)" -FROM functional_alltypes AS t0 \ No newline at end of file + CAST("t0"."timestamp_col" AS DATETIME) AS "Cast(timestamp_col, !timestamp)" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_timestamp_cast/out2.sql b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_timestamp_cast/out2.sql index d6f185cd8c53..daa10c3b5e60 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_timestamp_cast/out2.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_timestamp_cast/out2.sql @@ -1,3 +1,3 @@ SELECT - CAST(t0.int_col AS DATETIME) AS "Cast(int_col, !timestamp)" -FROM functional_alltypes AS t0 \ No newline at end of file + CAST("t0"."int_col" AS DATETIME) AS "Cast(int_col, !timestamp)" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_timestamp_from_integer/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_timestamp_from_integer/out.sql index 155a4cd77e5f..1022c7539dbd 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_timestamp_from_integer/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_timestamp_from_integer/out.sql @@ -1,3 +1,3 @@ SELECT - toDateTime(t0.int_col) AS "TimestampFromUNIX(int_col)" -FROM functional_alltypes AS t0 \ No newline at end of file + toDateTime("t0"."int_col") AS "TimestampFromUNIX(int_col)" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_translate_math_functions/abs/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_translate_math_functions/abs/out.sql index 9053504cff85..55df560b2fac 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_translate_math_functions/abs/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_translate_math_functions/abs/out.sql @@ -1,3 +1,3 @@ SELECT - ABS(t0.double_col) AS "Abs(double_col)" -FROM functional_alltypes AS t0 \ No newline at end of file + ABS("t0"."double_col") AS "Abs(double_col)" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_translate_math_functions/ceil/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_translate_math_functions/ceil/out.sql index fafc564ab456..09cbb2e254bb 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_translate_math_functions/ceil/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_translate_math_functions/ceil/out.sql @@ -1,3 +1,3 @@ SELECT - CAST(CEIL(t0.double_col) AS Nullable(Int64)) AS "Ceil(double_col)" -FROM functional_alltypes AS t0 \ No newline at end of file + CAST(CEIL("t0"."double_col") AS Nullable(Int64)) AS "Ceil(double_col)" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_translate_math_functions/exp/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_translate_math_functions/exp/out.sql index 4d8fe27b3e8e..c11261c44dbd 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_translate_math_functions/exp/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_translate_math_functions/exp/out.sql @@ -1,3 +1,3 @@ SELECT - EXP(t0.double_col) AS "Exp(double_col)" -FROM functional_alltypes AS t0 \ No newline at end of file + EXP("t0"."double_col") AS "Exp(double_col)" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_translate_math_functions/log/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_translate_math_functions/log/out.sql index 82a9852fce2e..32ff0c4948e6 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_translate_math_functions/log/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_translate_math_functions/log/out.sql @@ -1,3 +1,3 @@ SELECT - LN(t0.double_col) AS "Log(double_col)" -FROM functional_alltypes AS t0 \ No newline at end of file + LN("t0"."double_col") AS "Log(double_col)" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_translate_math_functions/log10/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_translate_math_functions/log10/out.sql index 8fa391142aca..c862dded81ed 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_translate_math_functions/log10/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_translate_math_functions/log10/out.sql @@ -1,3 +1,3 @@ SELECT - LOG10(t0.double_col) AS "Log10(double_col)" -FROM functional_alltypes AS t0 \ No newline at end of file + LOG10("t0"."double_col") AS "Log10(double_col)" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_translate_math_functions/log2/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_translate_math_functions/log2/out.sql index 8c0c7345d907..cebe0f41f850 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_translate_math_functions/log2/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_translate_math_functions/log2/out.sql @@ -1,3 +1,3 @@ SELECT - LOG2(t0.double_col) AS "Log2(double_col)" -FROM functional_alltypes AS t0 \ No newline at end of file + LOG2("t0"."double_col") AS "Log2(double_col)" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_translate_math_functions/round/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_translate_math_functions/round/out.sql index ca5418a19a6c..8e25278c7b9a 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_translate_math_functions/round/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_translate_math_functions/round/out.sql @@ -1,3 +1,3 @@ SELECT - ROUND(t0.double_col) AS "Round(double_col)" -FROM functional_alltypes AS t0 \ No newline at end of file + ROUND("t0"."double_col") AS "Round(double_col)" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_translate_math_functions/round_0/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_translate_math_functions/round_0/out.sql index d3d0e5b8d3f3..0540e27c45a9 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_translate_math_functions/round_0/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_translate_math_functions/round_0/out.sql @@ -1,3 +1,3 @@ SELECT - ROUND(t0.double_col, 0) AS "Round(double_col, 0)" -FROM functional_alltypes AS t0 \ No newline at end of file + ROUND("t0"."double_col", 0) AS "Round(double_col, 0)" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_translate_math_functions/round_2/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_translate_math_functions/round_2/out.sql index 546248ea6602..86e64f8f88bf 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_translate_math_functions/round_2/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_translate_math_functions/round_2/out.sql @@ -1,3 +1,3 @@ SELECT - ROUND(t0.double_col, 2) AS "Round(double_col, 2)" -FROM functional_alltypes AS t0 \ No newline at end of file + ROUND("t0"."double_col", 2) AS "Round(double_col, 2)" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_translate_math_functions/sign/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_translate_math_functions/sign/out.sql index 1081419665a0..10d56c154fa0 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_translate_math_functions/sign/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_translate_math_functions/sign/out.sql @@ -1,3 +1,3 @@ SELECT - intDivOrZero(t0.double_col, ABS(t0.double_col)) AS "Sign(double_col)" -FROM functional_alltypes AS t0 \ No newline at end of file + intDivOrZero("t0"."double_col", ABS("t0"."double_col")) AS "Sign(double_col)" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_translate_math_functions/sqrt/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_translate_math_functions/sqrt/out.sql index 22d3ea0b7053..2e4139a99d1c 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_translate_math_functions/sqrt/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_translate_math_functions/sqrt/out.sql @@ -1,3 +1,3 @@ SELECT - SQRT(t0.double_col) AS "Sqrt(double_col)" -FROM functional_alltypes AS t0 \ No newline at end of file + SQRT("t0"."double_col") AS "Sqrt(double_col)" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_literals/test_string_numeric_boolean_literals/false/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_literals/test_string_numeric_boolean_literals/false/out.sql index ebdf5892bd88..3384069fe9ef 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_literals/test_string_numeric_boolean_literals/false/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_literals/test_string_numeric_boolean_literals/false/out.sql @@ -1,2 +1,2 @@ SELECT - FALSE AS False \ No newline at end of file + FALSE AS "False" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_literals/test_string_numeric_boolean_literals/true/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_literals/test_string_numeric_boolean_literals/true/out.sql index 8cafff945927..0e4959c5be70 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_literals/test_string_numeric_boolean_literals/true/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_literals/test_string_numeric_boolean_literals/true/out.sql @@ -1,2 +1,2 @@ SELECT - TRUE AS True \ No newline at end of file + TRUE AS "True" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_operators/test_between/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_operators/test_between/out.sql index f385a5073f4a..d36d7dbfe47a 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_operators/test_between/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_operators/test_between/out.sql @@ -1,3 +1,3 @@ SELECT - t0.int_col BETWEEN 0 AND 10 AS "Between(int_col, 0, 10)" -FROM functional_alltypes AS t0 \ No newline at end of file + "t0"."int_col" BETWEEN 0 AND 10 AS "Between(int_col, 0, 10)" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_operators/test_binary_infix_operators/add/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_operators/test_binary_infix_operators/add/out.sql index e68b7ab92f5b..f861b63ca850 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_operators/test_binary_infix_operators/add/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_operators/test_binary_infix_operators/add/out.sql @@ -1,3 +1,3 @@ SELECT - t0.int_col + t0.tinyint_col AS "Add(int_col, tinyint_col)" -FROM functional_alltypes AS t0 \ No newline at end of file + "t0"."int_col" + "t0"."tinyint_col" AS "Add(int_col, tinyint_col)" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_operators/test_binary_infix_operators/eq/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_operators/test_binary_infix_operators/eq/out.sql index fcb1bd0800dc..594a301ee86c 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_operators/test_binary_infix_operators/eq/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_operators/test_binary_infix_operators/eq/out.sql @@ -1,3 +1,3 @@ SELECT - t0.int_col = t0.tinyint_col AS "Equals(int_col, tinyint_col)" -FROM functional_alltypes AS t0 \ No newline at end of file + "t0"."int_col" = "t0"."tinyint_col" AS "Equals(int_col, tinyint_col)" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_operators/test_binary_infix_operators/ge/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_operators/test_binary_infix_operators/ge/out.sql index 19a415c58ebf..f54ffa08d8d5 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_operators/test_binary_infix_operators/ge/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_operators/test_binary_infix_operators/ge/out.sql @@ -1,3 +1,3 @@ SELECT - t0.int_col >= t0.tinyint_col AS "GreaterEqual(int_col, tinyint_col)" -FROM functional_alltypes AS t0 \ No newline at end of file + "t0"."int_col" >= "t0"."tinyint_col" AS "GreaterEqual(int_col, tinyint_col)" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_operators/test_binary_infix_operators/gt/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_operators/test_binary_infix_operators/gt/out.sql index 2bb6220a6ff3..9a3e27a030f6 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_operators/test_binary_infix_operators/gt/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_operators/test_binary_infix_operators/gt/out.sql @@ -1,3 +1,3 @@ SELECT - t0.int_col > t0.tinyint_col AS "Greater(int_col, tinyint_col)" -FROM functional_alltypes AS t0 \ No newline at end of file + "t0"."int_col" > "t0"."tinyint_col" AS "Greater(int_col, tinyint_col)" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_operators/test_binary_infix_operators/le/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_operators/test_binary_infix_operators/le/out.sql index 078ecd833ad4..d8c830904dfc 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_operators/test_binary_infix_operators/le/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_operators/test_binary_infix_operators/le/out.sql @@ -1,3 +1,3 @@ SELECT - t0.int_col <= t0.tinyint_col AS "LessEqual(int_col, tinyint_col)" -FROM functional_alltypes AS t0 \ No newline at end of file + "t0"."int_col" <= "t0"."tinyint_col" AS "LessEqual(int_col, tinyint_col)" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_operators/test_binary_infix_operators/lt/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_operators/test_binary_infix_operators/lt/out.sql index e7f933028170..cefda5d4ae87 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_operators/test_binary_infix_operators/lt/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_operators/test_binary_infix_operators/lt/out.sql @@ -1,3 +1,3 @@ SELECT - t0.int_col < t0.tinyint_col AS "Less(int_col, tinyint_col)" -FROM functional_alltypes AS t0 \ No newline at end of file + "t0"."int_col" < "t0"."tinyint_col" AS "Less(int_col, tinyint_col)" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_operators/test_binary_infix_operators/mul/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_operators/test_binary_infix_operators/mul/out.sql index e1389c6da13b..ee9e7b4aa15b 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_operators/test_binary_infix_operators/mul/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_operators/test_binary_infix_operators/mul/out.sql @@ -1,3 +1,3 @@ SELECT - t0.int_col * t0.tinyint_col AS "Multiply(int_col, tinyint_col)" -FROM functional_alltypes AS t0 \ No newline at end of file + "t0"."int_col" * "t0"."tinyint_col" AS "Multiply(int_col, tinyint_col)" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_operators/test_binary_infix_operators/ne/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_operators/test_binary_infix_operators/ne/out.sql index b640e3569c95..69f73bd5e823 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_operators/test_binary_infix_operators/ne/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_operators/test_binary_infix_operators/ne/out.sql @@ -1,3 +1,3 @@ SELECT - t0.int_col <> t0.tinyint_col AS "NotEquals(int_col, tinyint_col)" -FROM functional_alltypes AS t0 \ No newline at end of file + "t0"."int_col" <> "t0"."tinyint_col" AS "NotEquals(int_col, tinyint_col)" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_operators/test_binary_infix_operators/pow/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_operators/test_binary_infix_operators/pow/out.sql index 1eb784222e9c..2b99f1bca330 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_operators/test_binary_infix_operators/pow/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_operators/test_binary_infix_operators/pow/out.sql @@ -1,3 +1,3 @@ SELECT - POWER(t0.int_col, t0.tinyint_col) AS "Power(int_col, tinyint_col)" -FROM functional_alltypes AS t0 \ No newline at end of file + POWER("t0"."int_col", "t0"."tinyint_col") AS "Power(int_col, tinyint_col)" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_operators/test_binary_infix_operators/sub/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_operators/test_binary_infix_operators/sub/out.sql index de39ee04558f..ad2506f3d9f7 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_operators/test_binary_infix_operators/sub/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_operators/test_binary_infix_operators/sub/out.sql @@ -1,3 +1,3 @@ SELECT - t0.int_col - t0.tinyint_col AS "Subtract(int_col, tinyint_col)" -FROM functional_alltypes AS t0 \ No newline at end of file + "t0"."int_col" - "t0"."tinyint_col" AS "Subtract(int_col, tinyint_col)" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_operators/test_binary_infix_operators/truediv/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_operators/test_binary_infix_operators/truediv/out.sql index cb51f9f8c6a1..ef67e8fbca04 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_operators/test_binary_infix_operators/truediv/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_operators/test_binary_infix_operators/truediv/out.sql @@ -1,3 +1,3 @@ SELECT - t0.int_col / t0.tinyint_col AS "Divide(int_col, tinyint_col)" -FROM functional_alltypes AS t0 \ No newline at end of file + "t0"."int_col" / "t0"."tinyint_col" AS "Divide(int_col, tinyint_col)" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_operators/test_binary_infix_parenthesization/lambda0/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_operators/test_binary_infix_parenthesization/lambda0/out.sql index 8133e2fc1ec5..dbe622a75a1a 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_operators/test_binary_infix_parenthesization/lambda0/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_operators/test_binary_infix_parenthesization/lambda0/out.sql @@ -1,5 +1,5 @@ SELECT ( - t0.int_col + t0.tinyint_col - ) + t0.double_col AS "Add(Add(int_col, tinyint_col), double_col)" -FROM functional_alltypes AS t0 \ No newline at end of file + "t0"."int_col" + "t0"."tinyint_col" + ) + "t0"."double_col" AS "Add(Add(int_col, tinyint_col), double_col)" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_operators/test_binary_infix_parenthesization/lambda1/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_operators/test_binary_infix_parenthesization/lambda1/out.sql index 3c61319c349c..c0b915d5412f 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_operators/test_binary_infix_parenthesization/lambda1/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_operators/test_binary_infix_parenthesization/lambda1/out.sql @@ -1,3 +1,3 @@ SELECT - LN(t0.int_col) + t0.double_col AS "Add(Log(int_col), double_col)" -FROM functional_alltypes AS t0 \ No newline at end of file + LN("t0"."int_col") + "t0"."double_col" AS "Add(Log(int_col), double_col)" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_operators/test_binary_infix_parenthesization/lambda2/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_operators/test_binary_infix_parenthesization/lambda2/out.sql index 08d6cd257a99..32f86e31d105 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_operators/test_binary_infix_parenthesization/lambda2/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_operators/test_binary_infix_parenthesization/lambda2/out.sql @@ -1,5 +1,5 @@ SELECT - t0.tinyint_col + -( - t0.int_col + t0.double_col + "t0"."tinyint_col" + -( + "t0"."int_col" + "t0"."double_col" ) AS "Add(tinyint_col, Negate(Add(int_col, double_col)))" -FROM functional_alltypes AS t0 \ No newline at end of file +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_operators/test_negate/bool_col/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_operators/test_negate/bool_col/out.sql index f99229d255c1..4ed2a27cb186 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_operators/test_negate/bool_col/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_operators/test_negate/bool_col/out.sql @@ -1,5 +1,5 @@ SELECT NOT ( - t0.bool_col + "t0"."bool_col" ) AS "Not(bool_col)" -FROM functional_alltypes AS t0 \ No newline at end of file +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_operators/test_negate/float_col/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_operators/test_negate/float_col/out.sql index a0bba803ac5e..bd9115f001e4 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_operators/test_negate/float_col/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_operators/test_negate/float_col/out.sql @@ -1,5 +1,5 @@ SELECT -( - t0.float_col + "t0"."float_col" ) AS "Negate(float_col)" -FROM functional_alltypes AS t0 \ No newline at end of file +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_operators/test_negate/int_col/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_operators/test_negate/int_col/out.sql index 0f6ccfcd6d63..0a970f06c50c 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_operators/test_negate/int_col/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_operators/test_negate/int_col/out.sql @@ -1,5 +1,5 @@ SELECT -( - t0.int_col + "t0"."int_col" ) AS "Negate(int_col)" -FROM functional_alltypes AS t0 \ No newline at end of file +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_operators/test_search_case/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_operators/test_search_case/out.sql index 550ad6ad9278..11569fc15843 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_operators/test_search_case/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_operators/test_search_case/out.sql @@ -1,9 +1,9 @@ SELECT CASE - WHEN t0.float_col > 0 - THEN t0.int_col * 2 - WHEN t0.float_col < 0 - THEN t0.int_col + WHEN "t0"."float_col" > 0 + THEN "t0"."int_col" * 2 + WHEN "t0"."float_col" < 0 + THEN "t0"."int_col" ELSE 0 END AS "SearchedCase(0)" -FROM functional_alltypes AS t0 \ No newline at end of file +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_operators/test_simple_case/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_operators/test_simple_case/out.sql index 2864ba8200b4..66d7aca5a83f 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_operators/test_simple_case/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_operators/test_simple_case/out.sql @@ -1,3 +1,3 @@ SELECT - CASE t0.string_col WHEN 'foo' THEN 'bar' WHEN 'baz' THEN 'qux' ELSE 'default' END AS "SimpleCase(string_col, 'default')" -FROM functional_alltypes AS t0 \ No newline at end of file + CASE "t0"."string_col" WHEN 'foo' THEN 'bar' WHEN 'baz' THEN 'qux' ELSE 'default' END AS "SimpleCase(string_col, 'default')" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_select/test_array_join_in_subquery/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_select/test_array_join_in_subquery/out.sql index a62f4b1f78bc..9598809b7217 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_select/test_array_join_in_subquery/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_select/test_array_join_in_subquery/out.sql @@ -1,5 +1,5 @@ SELECT - t0.id IN (SELECT - arrayJoin(t1.ids) AS ids - FROM way_view AS t1) AS "InSubquery(id)" -FROM node_view AS t0 \ No newline at end of file + "t0"."id" IN (SELECT + arrayJoin("t1"."ids") AS "ids" + FROM "way_view" AS "t1") AS "InSubquery(id)" +FROM "node_view" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_select/test_complex_array_expr_projection/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_select/test_complex_array_expr_projection/out.sql index 034aab28ceef..54d3826d1847 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_select/test_complex_array_expr_projection/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_select/test_complex_array_expr_projection/out.sql @@ -1,10 +1,10 @@ SELECT - CAST(t1.string_col AS Nullable(Float64)) AS "Cast(string_col, float64)" + CAST("t1"."string_col" AS Nullable(Float64)) AS "Cast(string_col, float64)" FROM ( SELECT - t0.string_col, - COUNT(*) AS count - FROM functional_alltypes AS t0 + "t0"."string_col", + COUNT(*) AS "count" + FROM "functional_alltypes" AS "t0" GROUP BY - t0.string_col -) AS t1 \ No newline at end of file + "t0"."string_col" +) AS "t1" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_select/test_complex_join/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_select/test_complex_join/out.sql index ef5ec770f49a..4e106ac768a3 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_select/test_complex_join/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_select/test_complex_join/out.sql @@ -1,18 +1,18 @@ SELECT - t4.a, - t4.b, - t4.c, - t4.d, - t4.c / ( - t4.a - t4.b - ) AS e + "t4"."a", + "t4"."b", + "t4"."c", + "t4"."d", + "t4"."c" / ( + "t4"."a" - "t4"."b" + ) AS "e" FROM ( SELECT - t2.a, - t2.b, - t3.c, - t3.d - FROM s AS t2 - INNER JOIN t AS t3 - ON t2.a = t3.c -) AS t4 \ No newline at end of file + "t2"."a", + "t2"."b", + "t3"."c", + "t3"."d" + FROM "s" AS "t2" + INNER JOIN "t" AS "t3" + ON "t2"."a" = "t3"."c" +) AS "t4" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_select/test_count_name/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_select/test_count_name/out.sql index 6edcaf0c84a9..818766ac3f33 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_select/test_count_name/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_select/test_count_name/out.sql @@ -1,9 +1,9 @@ SELECT - t0.a, + "t0"."a", COALESCE(countIf(NOT ( - t0.b - )), 0) AS A, - COALESCE(countIf(t0.b), 0) AS B -FROM t AS t0 + "t0"."b" + )), 0) AS "A", + COALESCE(countIf("t0"."b"), 0) AS "B" +FROM "t" AS "t0" GROUP BY - t0.a \ No newline at end of file + "t0"."a" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_select/test_ifelse_use_if/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_select/test_ifelse_use_if/out.sql index 73b7283aba5f..5909a4ea1a1b 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_select/test_ifelse_use_if/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_select/test_ifelse_use_if/out.sql @@ -1,3 +1,3 @@ SELECT - CASE WHEN t0.float_col > 0 THEN t0.int_col ELSE t0.bigint_col END AS "IfElse(Greater(float_col, 0), int_col, bigint_col)" -FROM functional_alltypes AS t0 \ No newline at end of file + CASE WHEN "t0"."float_col" > 0 THEN "t0"."int_col" ELSE "t0"."bigint_col" END AS "IfElse(Greater(float_col, 0), int_col, bigint_col)" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_select/test_isin_notin_in_select/out1.sql b/ibis/backends/clickhouse/tests/snapshots/test_select/test_isin_notin_in_select/out1.sql index 1bd6720ed390..bda298346094 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_select/test_isin_notin_in_select/out1.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_select/test_isin_notin_in_select/out1.sql @@ -1,17 +1,17 @@ SELECT - t0.id, - t0.bool_col, - t0.tinyint_col, - t0.smallint_col, - t0.int_col, - t0.bigint_col, - t0.float_col, - t0.double_col, - t0.date_string_col, - t0.string_col, - t0.timestamp_col, - t0.year, - t0.month -FROM functional_alltypes AS t0 + "t0"."id", + "t0"."bool_col", + "t0"."tinyint_col", + "t0"."smallint_col", + "t0"."int_col", + "t0"."bigint_col", + "t0"."float_col", + "t0"."double_col", + "t0"."date_string_col", + "t0"."string_col", + "t0"."timestamp_col", + "t0"."year", + "t0"."month" +FROM "functional_alltypes" AS "t0" WHERE - t0.string_col IN ('foo', 'bar') \ No newline at end of file + "t0"."string_col" IN ('foo', 'bar') \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_select/test_isin_notin_in_select/out2.sql b/ibis/backends/clickhouse/tests/snapshots/test_select/test_isin_notin_in_select/out2.sql index 85fd1cae375d..0612bf8ebe05 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_select/test_isin_notin_in_select/out2.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_select/test_isin_notin_in_select/out2.sql @@ -1,19 +1,19 @@ SELECT - t0.id, - t0.bool_col, - t0.tinyint_col, - t0.smallint_col, - t0.int_col, - t0.bigint_col, - t0.float_col, - t0.double_col, - t0.date_string_col, - t0.string_col, - t0.timestamp_col, - t0.year, - t0.month -FROM functional_alltypes AS t0 + "t0"."id", + "t0"."bool_col", + "t0"."tinyint_col", + "t0"."smallint_col", + "t0"."int_col", + "t0"."bigint_col", + "t0"."float_col", + "t0"."double_col", + "t0"."date_string_col", + "t0"."string_col", + "t0"."timestamp_col", + "t0"."year", + "t0"."month" +FROM "functional_alltypes" AS "t0" WHERE NOT ( - t0.string_col IN ('foo', 'bar') + "t0"."string_col" IN ('foo', 'bar') ) \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_select/test_isnull_case_expr_rewrite_failure/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_select/test_isnull_case_expr_rewrite_failure/out.sql index 3029dd2e2fb3..0a5733558a19 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_select/test_isnull_case_expr_rewrite_failure/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_select/test_isnull_case_expr_rewrite_failure/out.sql @@ -1,3 +1,3 @@ SELECT - SUM(CASE WHEN isNull(t0.string_col) THEN 1 ELSE 0 END) AS "Sum(IfElse(IsNull(string_col), 1, 0))" -FROM functional_alltypes AS t0 \ No newline at end of file + SUM(CASE WHEN isNull("t0"."string_col") THEN 1 ELSE 0 END) AS "Sum(IfElse(IsNull(string_col), 1, 0))" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_select/test_join_self_reference/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_select/test_join_self_reference/out.sql index 728987548b00..66518891122e 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_select/test_join_self_reference/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_select/test_join_self_reference/out.sql @@ -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 -FROM functional_alltypes AS t1 -INNER JOIN functional_alltypes AS t3 - ON t1.id = t3.id \ No newline at end of file + "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" +FROM "functional_alltypes" AS "t1" +INNER JOIN "functional_alltypes" AS "t3" + ON "t1"."id" = "t3"."id" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_select/test_named_from_filter_groupby/out1.sql b/ibis/backends/clickhouse/tests/snapshots/test_select/test_named_from_filter_groupby/out1.sql index 2ae649a0ea76..eae60372b99a 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_select/test_named_from_filter_groupby/out1.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_select/test_named_from_filter_groupby/out1.sql @@ -1,17 +1,17 @@ SELECT - t1.key, + "t1"."key", SUM(( ( - t1.value + 1 + "t1"."value" + 1 ) + 2 - ) + 3) AS abc + ) + 3) AS "abc" FROM ( SELECT - t0.key, - t0.value - FROM t0 AS t0 + "t0"."key", + "t0"."value" + FROM "t0" AS "t0" WHERE - t0.value = 42 -) AS t1 + "t0"."value" = 42 +) AS "t1" GROUP BY - t1.key \ No newline at end of file + "t1"."key" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_select/test_named_from_filter_groupby/out2.sql b/ibis/backends/clickhouse/tests/snapshots/test_select/test_named_from_filter_groupby/out2.sql index d22a599a88a7..7a163b9542da 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_select/test_named_from_filter_groupby/out2.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_select/test_named_from_filter_groupby/out2.sql @@ -1,17 +1,17 @@ SELECT - t1.key, + "t1"."key", SUM(( ( - t1.value + 1 + "t1"."value" + 1 ) + 2 - ) + 3) AS foo + ) + 3) AS "foo" FROM ( SELECT - t0.key, - t0.value - FROM t0 AS t0 + "t0"."key", + "t0"."value" + FROM "t0" AS "t0" WHERE - t0.value = 42 -) AS t1 + "t0"."value" = 42 +) AS "t1" GROUP BY - t1.key \ No newline at end of file + "t1"."key" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_select/test_physical_table_reference_translate/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_select/test_physical_table_reference_translate/out.sql index cdcc673f9d1c..67f2cfc5ea25 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_select/test_physical_table_reference_translate/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_select/test_physical_table_reference_translate/out.sql @@ -1,3 +1,3 @@ SELECT * -FROM functional_alltypes \ No newline at end of file +FROM "functional_alltypes" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_select/test_self_reference_simple/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_select/test_self_reference_simple/out.sql index 99d5c76e03f3..6d497849fa7e 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_select/test_self_reference_simple/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_select/test_self_reference_simple/out.sql @@ -1,3 +1,3 @@ SELECT * -FROM functional_alltypes AS t0 \ No newline at end of file +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_select/test_simple_joins/playerID-awardID-any_inner_join/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_select/test_simple_joins/playerID-awardID-any_inner_join/out.sql index a1bdbc4f3fc3..7ea322ab3e40 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_select/test_simple_joins/playerID-awardID-any_inner_join/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_select/test_simple_joins/playerID-awardID-any_inner_join/out.sql @@ -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 -FROM batting AS t2 -ANY JOIN awards_players AS t3 - ON t2.playerID = t3.awardID \ No newline at end of file + "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" +FROM "batting" AS "t2" +ANY JOIN "awards_players" AS "t3" + ON "t2"."playerID" = "t3"."awardID" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_select/test_simple_joins/playerID-awardID-any_left_join/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_select/test_simple_joins/playerID-awardID-any_left_join/out.sql index 651c9ca46694..99c2c8ed05ba 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_select/test_simple_joins/playerID-awardID-any_left_join/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_select/test_simple_joins/playerID-awardID-any_left_join/out.sql @@ -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 -FROM batting AS t2 -LEFT ANY JOIN awards_players AS t3 - ON t2.playerID = t3.awardID \ No newline at end of file + "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" +FROM "batting" AS "t2" +LEFT ANY JOIN "awards_players" AS "t3" + ON "t2"."playerID" = "t3"."awardID" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_select/test_simple_joins/playerID-awardID-inner_join/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_select/test_simple_joins/playerID-awardID-inner_join/out.sql index ebcca144d254..b0e5b8e38295 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_select/test_simple_joins/playerID-awardID-inner_join/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_select/test_simple_joins/playerID-awardID-inner_join/out.sql @@ -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 -FROM batting AS t2 -INNER JOIN awards_players AS t3 - ON t2.playerID = t3.awardID \ No newline at end of file + "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" +FROM "batting" AS "t2" +INNER JOIN "awards_players" AS "t3" + ON "t2"."playerID" = "t3"."awardID" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_select/test_simple_joins/playerID-awardID-left_join/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_select/test_simple_joins/playerID-awardID-left_join/out.sql index 5ae2ee1998b1..3933c87710b6 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_select/test_simple_joins/playerID-awardID-left_join/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_select/test_simple_joins/playerID-awardID-left_join/out.sql @@ -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 -FROM batting AS t2 -LEFT OUTER JOIN awards_players AS t3 - ON t2.playerID = t3.awardID \ No newline at end of file + "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" +FROM "batting" AS "t2" +LEFT OUTER JOIN "awards_players" AS "t3" + ON "t2"."playerID" = "t3"."awardID" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_select/test_simple_joins/playerID-playerID-any_inner_join/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_select/test_simple_joins/playerID-playerID-any_inner_join/out.sql index 43bddb923f0a..71a2337a7448 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_select/test_simple_joins/playerID-playerID-any_inner_join/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_select/test_simple_joins/playerID-playerID-any_inner_join/out.sql @@ -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 -FROM batting AS t2 -ANY JOIN awards_players AS t3 - ON t2.playerID = t3.playerID \ No newline at end of file + "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" +FROM "batting" AS "t2" +ANY JOIN "awards_players" AS "t3" + ON "t2"."playerID" = "t3"."playerID" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_select/test_simple_joins/playerID-playerID-any_left_join/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_select/test_simple_joins/playerID-playerID-any_left_join/out.sql index 5586b8b01ee0..7181dbe8cc83 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_select/test_simple_joins/playerID-playerID-any_left_join/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_select/test_simple_joins/playerID-playerID-any_left_join/out.sql @@ -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 -FROM batting AS t2 -LEFT ANY JOIN awards_players AS t3 - ON t2.playerID = t3.playerID \ No newline at end of file + "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" +FROM "batting" AS "t2" +LEFT ANY JOIN "awards_players" AS "t3" + ON "t2"."playerID" = "t3"."playerID" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_select/test_simple_joins/playerID-playerID-inner_join/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_select/test_simple_joins/playerID-playerID-inner_join/out.sql index f611516b394e..fc1eeca36630 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_select/test_simple_joins/playerID-playerID-inner_join/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_select/test_simple_joins/playerID-playerID-inner_join/out.sql @@ -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 -FROM batting AS t2 -INNER JOIN awards_players AS t3 - ON t2.playerID = t3.playerID \ No newline at end of file + "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" +FROM "batting" AS "t2" +INNER JOIN "awards_players" AS "t3" + ON "t2"."playerID" = "t3"."playerID" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_select/test_simple_joins/playerID-playerID-left_join/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_select/test_simple_joins/playerID-playerID-left_join/out.sql index c820c7e05b88..e3d44d128a61 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_select/test_simple_joins/playerID-playerID-left_join/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_select/test_simple_joins/playerID-playerID-left_join/out.sql @@ -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 -FROM batting AS t2 -LEFT OUTER JOIN awards_players AS t3 - ON t2.playerID = t3.playerID \ No newline at end of file + "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" +FROM "batting" AS "t2" +LEFT OUTER JOIN "awards_players" AS "t3" + ON "t2"."playerID" = "t3"."playerID" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_select/test_simple_scalar_aggregates/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_select/test_simple_scalar_aggregates/out.sql index 86d975c44589..d7dbc74ba50b 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_select/test_simple_scalar_aggregates/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_select/test_simple_scalar_aggregates/out.sql @@ -1,21 +1,21 @@ SELECT - SUM(t1.float_col) AS "Sum(float_col)" + SUM("t1"."float_col") AS "Sum(float_col)" FROM ( SELECT - t0.id, - t0.bool_col, - t0.tinyint_col, - t0.smallint_col, - t0.int_col, - t0.bigint_col, - t0.float_col, - t0.double_col, - t0.date_string_col, - t0.string_col, - t0.timestamp_col, - t0.year, - t0.month - FROM functional_alltypes AS t0 + "t0"."id", + "t0"."bool_col", + "t0"."tinyint_col", + "t0"."smallint_col", + "t0"."int_col", + "t0"."bigint_col", + "t0"."float_col", + "t0"."double_col", + "t0"."date_string_col", + "t0"."string_col", + "t0"."timestamp_col", + "t0"."year", + "t0"."month" + FROM "functional_alltypes" AS "t0" WHERE - t0.int_col > 0 -) AS t1 \ No newline at end of file + "t0"."int_col" > 0 +) AS "t1" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_select/test_table_column_unbox/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_select/test_table_column_unbox/out.sql index d2bf6243fdea..bafeb1ea3fae 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_select/test_table_column_unbox/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_select/test_table_column_unbox/out.sql @@ -1,28 +1,28 @@ SELECT - t2.string_col + "t2"."string_col" FROM ( SELECT - t1.string_col, - SUM(t1.float_col) AS total + "t1"."string_col", + SUM("t1"."float_col") AS "total" FROM ( SELECT - t0.id, - t0.bool_col, - t0.tinyint_col, - t0.smallint_col, - t0.int_col, - t0.bigint_col, - t0.float_col, - t0.double_col, - t0.date_string_col, - t0.string_col, - t0.timestamp_col, - t0.year, - t0.month - FROM functional_alltypes AS t0 + "t0"."id", + "t0"."bool_col", + "t0"."tinyint_col", + "t0"."smallint_col", + "t0"."int_col", + "t0"."bigint_col", + "t0"."float_col", + "t0"."double_col", + "t0"."date_string_col", + "t0"."string_col", + "t0"."timestamp_col", + "t0"."year", + "t0"."month" + FROM "functional_alltypes" AS "t0" WHERE - t0.int_col > 0 - ) AS t1 + "t0"."int_col" > 0 + ) AS "t1" GROUP BY - t1.string_col -) AS t2 \ No newline at end of file + "t1"."string_col" +) AS "t2" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_select/test_timestamp_extract_field/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_select/test_timestamp_extract_field/out.sql index 9336d08bda8d..07b42d623f25 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_select/test_timestamp_extract_field/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_select/test_timestamp_extract_field/out.sql @@ -1,8 +1,8 @@ SELECT - toYear(t0.timestamp_col) AS year, - toMonth(t0.timestamp_col) AS month, - toDayOfMonth(t0.timestamp_col) AS day, - toHour(t0.timestamp_col) AS hour, - toMinute(t0.timestamp_col) AS minute, - toSecond(t0.timestamp_col) AS second -FROM functional_alltypes AS t0 \ No newline at end of file + toYear("t0"."timestamp_col") AS "year", + toMonth("t0"."timestamp_col") AS "month", + toDayOfMonth("t0"."timestamp_col") AS "day", + toHour("t0"."timestamp_col") AS "hour", + toMinute("t0"."timestamp_col") AS "minute", + toSecond("t0"."timestamp_col") AS "second" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_select/test_where_simple_comparisons/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_select/test_where_simple_comparisons/out.sql index cb651e1f7369..6a0067715eb6 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_select/test_where_simple_comparisons/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_select/test_where_simple_comparisons/out.sql @@ -1,19 +1,19 @@ SELECT - t0.id, - t0.bool_col, - t0.tinyint_col, - t0.smallint_col, - t0.int_col, - t0.bigint_col, - t0.float_col, - t0.double_col, - t0.date_string_col, - t0.string_col, - t0.timestamp_col, - t0.year, - t0.month -FROM functional_alltypes AS t0 + "t0"."id", + "t0"."bool_col", + "t0"."tinyint_col", + "t0"."smallint_col", + "t0"."int_col", + "t0"."bigint_col", + "t0"."float_col", + "t0"."double_col", + "t0"."date_string_col", + "t0"."string_col", + "t0"."timestamp_col", + "t0"."year", + "t0"."month" +FROM "functional_alltypes" AS "t0" WHERE - t0.float_col > 0 AND t0.int_col < ( - t0.float_col * 2 + "t0"."float_col" > 0 AND "t0"."int_col" < ( + "t0"."float_col" * 2 ) \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_select/test_where_with_between/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_select/test_where_with_between/out.sql index a27f8a736dc5..ce6fd8adb053 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_select/test_where_with_between/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_select/test_where_with_between/out.sql @@ -1,17 +1,17 @@ SELECT - t0.id, - t0.bool_col, - t0.tinyint_col, - t0.smallint_col, - t0.int_col, - t0.bigint_col, - t0.float_col, - t0.double_col, - t0.date_string_col, - t0.string_col, - t0.timestamp_col, - t0.year, - t0.month -FROM functional_alltypes AS t0 + "t0"."id", + "t0"."bool_col", + "t0"."tinyint_col", + "t0"."smallint_col", + "t0"."int_col", + "t0"."bigint_col", + "t0"."float_col", + "t0"."double_col", + "t0"."date_string_col", + "t0"."string_col", + "t0"."timestamp_col", + "t0"."year", + "t0"."month" +FROM "functional_alltypes" AS "t0" WHERE - t0.int_col > 0 AND t0.float_col BETWEEN 0 AND 1 \ No newline at end of file + "t0"."int_col" > 0 AND "t0"."float_col" BETWEEN 0 AND 1 \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_select/test_where_with_timestamp/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_select/test_where_with_timestamp/out.sql index cee980322a7b..2650818b44ad 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_select/test_where_with_timestamp/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_select/test_where_with_timestamp/out.sql @@ -1,6 +1,6 @@ SELECT - t0.uuid, - minIf(t0.ts, t0.search_level = 1) AS min_date -FROM t AS t0 + "t0"."uuid", + minIf("t0"."ts", "t0"."search_level" = 1) AS "min_date" +FROM "t" AS "t0" GROUP BY - t0.uuid \ No newline at end of file + "t0"."uuid" \ No newline at end of file diff --git a/ibis/backends/duckdb/__init__.py b/ibis/backends/duckdb/__init__.py index e66b0b99763e..d0bcb68a0386 100644 --- a/ibis/backends/duckdb/__init__.py +++ b/ibis/backends/duckdb/__init__.py @@ -491,7 +491,7 @@ def _from_url(self, url: str, **kwargs) -> BaseBackend: """ url = urlparse(url) - database = url.path[1:] or ":memory:" + database = url.path or ":memory:" query_params = parse_qs(url.query) for name, value in query_params.items(): diff --git a/ibis/backends/duckdb/tests/snapshots/test_datatypes/test_cast_uints/uint16/out.sql b/ibis/backends/duckdb/tests/snapshots/test_datatypes/test_cast_uints/uint16/out.sql index abb420080b20..2acbaa8d5f12 100644 --- a/ibis/backends/duckdb/tests/snapshots/test_datatypes/test_cast_uints/uint16/out.sql +++ b/ibis/backends/duckdb/tests/snapshots/test_datatypes/test_cast_uints/uint16/out.sql @@ -1,3 +1,3 @@ SELECT - CAST(t0.a AS USMALLINT) AS "Cast(a, uint16)" -FROM t AS t0 \ No newline at end of file + CAST("t0"."a" AS USMALLINT) AS "Cast(a, uint16)" +FROM "t" AS "t0" \ No newline at end of file diff --git a/ibis/backends/duckdb/tests/snapshots/test_datatypes/test_cast_uints/uint32/out.sql b/ibis/backends/duckdb/tests/snapshots/test_datatypes/test_cast_uints/uint32/out.sql index b2ec0d726884..a48e232ecd8e 100644 --- a/ibis/backends/duckdb/tests/snapshots/test_datatypes/test_cast_uints/uint32/out.sql +++ b/ibis/backends/duckdb/tests/snapshots/test_datatypes/test_cast_uints/uint32/out.sql @@ -1,3 +1,3 @@ SELECT - CAST(t0.a AS UINTEGER) AS "Cast(a, uint32)" -FROM t AS t0 \ No newline at end of file + CAST("t0"."a" AS UINTEGER) AS "Cast(a, uint32)" +FROM "t" AS "t0" \ No newline at end of file diff --git a/ibis/backends/duckdb/tests/snapshots/test_datatypes/test_cast_uints/uint64/out.sql b/ibis/backends/duckdb/tests/snapshots/test_datatypes/test_cast_uints/uint64/out.sql index 6cefd3bb478b..18926c3384c4 100644 --- a/ibis/backends/duckdb/tests/snapshots/test_datatypes/test_cast_uints/uint64/out.sql +++ b/ibis/backends/duckdb/tests/snapshots/test_datatypes/test_cast_uints/uint64/out.sql @@ -1,3 +1,3 @@ SELECT - CAST(t0.a AS UBIGINT) AS "Cast(a, uint64)" -FROM t AS t0 \ No newline at end of file + CAST("t0"."a" AS UBIGINT) AS "Cast(a, uint64)" +FROM "t" AS "t0" \ No newline at end of file diff --git a/ibis/backends/duckdb/tests/snapshots/test_datatypes/test_cast_uints/uint8/out.sql b/ibis/backends/duckdb/tests/snapshots/test_datatypes/test_cast_uints/uint8/out.sql index dae9dbdc41cb..d6c4e6f31517 100644 --- a/ibis/backends/duckdb/tests/snapshots/test_datatypes/test_cast_uints/uint8/out.sql +++ b/ibis/backends/duckdb/tests/snapshots/test_datatypes/test_cast_uints/uint8/out.sql @@ -1,3 +1,3 @@ SELECT - CAST(t0.a AS UTINYINT) AS "Cast(a, uint8)" -FROM t AS t0 \ No newline at end of file + CAST("t0"."a" AS UTINYINT) AS "Cast(a, uint8)" +FROM "t" AS "t0" \ No newline at end of file diff --git a/ibis/backends/duckdb/tests/snapshots/test_geospatial/test_geospatial_dwithin/out.sql b/ibis/backends/duckdb/tests/snapshots/test_geospatial/test_geospatial_dwithin/out.sql index e68c65813913..a7503ad3c708 100644 --- a/ibis/backends/duckdb/tests/snapshots/test_geospatial/test_geospatial_dwithin/out.sql +++ b/ibis/backends/duckdb/tests/snapshots/test_geospatial/test_geospatial_dwithin/out.sql @@ -1,3 +1,3 @@ SELECT - ST_DWITHIN(t0.geom, t0.geom, CAST(3.0 AS DOUBLE)) AS tmp -FROM t AS t0 \ No newline at end of file + ST_DWITHIN("t0"."geom", "t0"."geom", CAST(3.0 AS DOUBLE)) AS "tmp" +FROM "t" AS "t0" \ No newline at end of file diff --git a/ibis/backends/duckdb/tests/snapshots/test_geospatial/test_geospatial_unary_snapshot/as_text/out.sql b/ibis/backends/duckdb/tests/snapshots/test_geospatial/test_geospatial_unary_snapshot/as_text/out.sql index 7da710b2dceb..c3309623704a 100644 --- a/ibis/backends/duckdb/tests/snapshots/test_geospatial/test_geospatial_unary_snapshot/as_text/out.sql +++ b/ibis/backends/duckdb/tests/snapshots/test_geospatial/test_geospatial_unary_snapshot/as_text/out.sql @@ -1,3 +1,3 @@ SELECT - ST_ASTEXT(t0.geom) AS tmp -FROM t AS t0 \ No newline at end of file + ST_ASTEXT("t0"."geom") AS "tmp" +FROM "t" AS "t0" \ No newline at end of file diff --git a/ibis/backends/duckdb/tests/snapshots/test_geospatial/test_geospatial_unary_snapshot/n_points/out.sql b/ibis/backends/duckdb/tests/snapshots/test_geospatial/test_geospatial_unary_snapshot/n_points/out.sql index bf8ba88ffde2..e51ac61f7af2 100644 --- a/ibis/backends/duckdb/tests/snapshots/test_geospatial/test_geospatial_unary_snapshot/n_points/out.sql +++ b/ibis/backends/duckdb/tests/snapshots/test_geospatial/test_geospatial_unary_snapshot/n_points/out.sql @@ -1,3 +1,3 @@ SELECT - ST_NPOINTS(t0.geom) AS tmp -FROM t AS t0 \ No newline at end of file + ST_NPOINTS("t0"."geom") AS "tmp" +FROM "t" AS "t0" \ No newline at end of file diff --git a/ibis/backends/sqlite/__init__.py b/ibis/backends/sqlite/__init__.py index bc12542b3b70..906137627f49 100644 --- a/ibis/backends/sqlite/__init__.py +++ b/ibis/backends/sqlite/__init__.py @@ -111,7 +111,7 @@ def _from_url(self, url: str, **kwargs): """ url = urlparse(url) - database = url.path[1:] or ":memory:" + database = url.path or ":memory:" return self.connect(database=database, **kwargs) def raw_sql(self, query: str | sg.Expression, **kwargs: Any) -> Any: diff --git a/ibis/backends/tests/snapshots/test_dot_sql/test_cte/bigquery/out.sql b/ibis/backends/tests/snapshots/test_dot_sql/test_cte/bigquery/out.sql index 499888a1d390..0f8ec722632b 100644 --- a/ibis/backends/tests/snapshots/test_dot_sql/test_cte/bigquery/out.sql +++ b/ibis/backends/tests/snapshots/test_dot_sql/test_cte/bigquery/out.sql @@ -1,7 +1,7 @@ -WITH foo AS ( +WITH `foo` AS ( SELECT * - FROM `ibis-gbq`.ibis_gbq_testing.test_bigquery_temp_mem_t_for_cte AS t0 + FROM `ibis-gbq`.`ibis_gbq_testing`.`test_bigquery_temp_mem_t_for_cte` AS `t0` ) SELECT COUNT(*) AS `x` diff --git a/ibis/backends/tests/snapshots/test_dot_sql/test_cte/clickhouse/out.sql b/ibis/backends/tests/snapshots/test_dot_sql/test_cte/clickhouse/out.sql index 65c261d51aed..86a20dda1d70 100644 --- a/ibis/backends/tests/snapshots/test_dot_sql/test_cte/clickhouse/out.sql +++ b/ibis/backends/tests/snapshots/test_dot_sql/test_cte/clickhouse/out.sql @@ -1,7 +1,7 @@ -WITH foo AS ( +WITH "foo" AS ( SELECT * - FROM test_clickhouse_temp_mem_t_for_cte AS t0 + FROM "test_clickhouse_temp_mem_t_for_cte" AS "t0" ) SELECT COUNT(*) AS "x" diff --git a/ibis/backends/tests/snapshots/test_dot_sql/test_cte/duckdb/out.sql b/ibis/backends/tests/snapshots/test_dot_sql/test_cte/duckdb/out.sql index 274da8b2928b..51c412222fac 100644 --- a/ibis/backends/tests/snapshots/test_dot_sql/test_cte/duckdb/out.sql +++ b/ibis/backends/tests/snapshots/test_dot_sql/test_cte/duckdb/out.sql @@ -1,7 +1,7 @@ -WITH foo AS ( +WITH "foo" AS ( SELECT * - FROM test_duckdb_temp_mem_t_for_cte AS t0 + FROM "test_duckdb_temp_mem_t_for_cte" AS "t0" ) SELECT COUNT(*) AS "x" diff --git a/ibis/backends/tests/snapshots/test_generic/test_many_subqueries/clickhouse/out.sql b/ibis/backends/tests/snapshots/test_generic/test_many_subqueries/clickhouse/out.sql index fca431bc4c45..64a6e78e8bf3 100644 --- a/ibis/backends/tests/snapshots/test_generic/test_many_subqueries/clickhouse/out.sql +++ b/ibis/backends/tests/snapshots/test_generic/test_many_subqueries/clickhouse/out.sql @@ -1,42 +1,42 @@ -WITH t6 AS ( +WITH "t6" AS ( SELECT - t5.street, - ROW_NUMBER() OVER (ORDER BY t5.street ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - 1 AS key + "t5"."street", + ROW_NUMBER() OVER (ORDER BY "t5"."street" ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - 1 AS "key" FROM ( SELECT - t2.street, - t2.key + "t2"."street", + "t2"."key" FROM ( SELECT - t0.street, - ROW_NUMBER() OVER (ORDER BY t0.street ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - 1 AS key - FROM data AS t0 - ) AS t2 + "t0"."street", + ROW_NUMBER() OVER (ORDER BY "t0"."street" ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - 1 AS "key" + FROM "data" AS "t0" + ) AS "t2" INNER JOIN ( SELECT - t1.key + "t1"."key" FROM ( SELECT - t0.street, - ROW_NUMBER() OVER (ORDER BY t0.street ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - 1 AS key - FROM data AS t0 - ) AS t1 - ) AS t4 - ON t2.key = t4.key - ) AS t5 -), t1 AS ( + "t0"."street", + ROW_NUMBER() OVER (ORDER BY "t0"."street" ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - 1 AS "key" + FROM "data" AS "t0" + ) AS "t1" + ) AS "t4" + ON "t2"."key" = "t4"."key" + ) AS "t5" +), "t1" AS ( SELECT - t0.street, - ROW_NUMBER() OVER (ORDER BY t0.street ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - 1 AS key - FROM data AS t0 + "t0"."street", + ROW_NUMBER() OVER (ORDER BY "t0"."street" ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - 1 AS "key" + FROM "data" AS "t0" ) SELECT - t8.street, - t8.key -FROM t6 AS t8 + "t8"."street", + "t8"."key" +FROM "t6" AS "t8" INNER JOIN ( SELECT - t7.key - FROM t6 AS t7 -) AS t10 - ON t8.key = t10.key \ No newline at end of file + "t7"."key" + FROM "t6" AS "t7" +) AS "t10" + ON "t8"."key" = "t10"."key" \ No newline at end of file diff --git a/ibis/backends/tests/snapshots/test_generic/test_many_subqueries/duckdb/out.sql b/ibis/backends/tests/snapshots/test_generic/test_many_subqueries/duckdb/out.sql index 2e5f7d14030f..0ceff9007707 100644 --- a/ibis/backends/tests/snapshots/test_generic/test_many_subqueries/duckdb/out.sql +++ b/ibis/backends/tests/snapshots/test_generic/test_many_subqueries/duckdb/out.sql @@ -1,42 +1,42 @@ -WITH t6 AS ( +WITH "t6" AS ( SELECT - t5.street, - ROW_NUMBER() OVER (ORDER BY t5.street ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - CAST(1 AS TINYINT) AS key + "t5"."street", + ROW_NUMBER() OVER (ORDER BY "t5"."street" ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - CAST(1 AS TINYINT) AS "key" FROM ( SELECT - t2.street, - t2.key + "t2"."street", + "t2"."key" FROM ( SELECT - t0.street, - ROW_NUMBER() OVER (ORDER BY t0.street ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - CAST(1 AS TINYINT) AS key - FROM data AS t0 - ) AS t2 + "t0"."street", + ROW_NUMBER() OVER (ORDER BY "t0"."street" ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - CAST(1 AS TINYINT) AS "key" + FROM "data" AS "t0" + ) AS "t2" INNER JOIN ( SELECT - t1.key + "t1"."key" FROM ( SELECT - t0.street, - ROW_NUMBER() OVER (ORDER BY t0.street ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - CAST(1 AS TINYINT) AS key - FROM data AS t0 - ) AS t1 - ) AS t4 - ON t2.key = t4.key - ) AS t5 -), t1 AS ( + "t0"."street", + ROW_NUMBER() OVER (ORDER BY "t0"."street" ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - CAST(1 AS TINYINT) AS "key" + FROM "data" AS "t0" + ) AS "t1" + ) AS "t4" + ON "t2"."key" = "t4"."key" + ) AS "t5" +), "t1" AS ( SELECT - t0.street, - ROW_NUMBER() OVER (ORDER BY t0.street ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - CAST(1 AS TINYINT) AS key - FROM data AS t0 + "t0"."street", + ROW_NUMBER() OVER (ORDER BY "t0"."street" ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - CAST(1 AS TINYINT) AS "key" + FROM "data" AS "t0" ) SELECT - t8.street, - t8.key -FROM t6 AS t8 + "t8"."street", + "t8"."key" +FROM "t6" AS "t8" INNER JOIN ( SELECT - t7.key - FROM t6 AS t7 -) AS t10 - ON t8.key = t10.key \ No newline at end of file + "t7"."key" + FROM "t6" AS "t7" +) AS "t10" + ON "t8"."key" = "t10"."key" \ No newline at end of file diff --git a/ibis/backends/tests/snapshots/test_generic/test_many_subqueries/risingwave/out.sql b/ibis/backends/tests/snapshots/test_generic/test_many_subqueries/risingwave/out.sql new file mode 100644 index 000000000000..64a6e78e8bf3 --- /dev/null +++ b/ibis/backends/tests/snapshots/test_generic/test_many_subqueries/risingwave/out.sql @@ -0,0 +1,42 @@ +WITH "t6" AS ( + SELECT + "t5"."street", + ROW_NUMBER() OVER (ORDER BY "t5"."street" ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - 1 AS "key" + FROM ( + SELECT + "t2"."street", + "t2"."key" + FROM ( + SELECT + "t0"."street", + ROW_NUMBER() OVER (ORDER BY "t0"."street" ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - 1 AS "key" + FROM "data" AS "t0" + ) AS "t2" + INNER JOIN ( + SELECT + "t1"."key" + FROM ( + SELECT + "t0"."street", + ROW_NUMBER() OVER (ORDER BY "t0"."street" ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - 1 AS "key" + FROM "data" AS "t0" + ) AS "t1" + ) AS "t4" + ON "t2"."key" = "t4"."key" + ) AS "t5" +), "t1" AS ( + SELECT + "t0"."street", + ROW_NUMBER() OVER (ORDER BY "t0"."street" ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - 1 AS "key" + FROM "data" AS "t0" +) +SELECT + "t8"."street", + "t8"."key" +FROM "t6" AS "t8" +INNER JOIN ( + SELECT + "t7"."key" + FROM "t6" AS "t7" +) AS "t10" + ON "t8"."key" = "t10"."key" \ No newline at end of file diff --git a/ibis/backends/tests/snapshots/test_generic/test_many_subqueries/sqlite/out.sql b/ibis/backends/tests/snapshots/test_generic/test_many_subqueries/sqlite/out.sql index 96d6c839c2c0..9989afbf4aec 100644 --- a/ibis/backends/tests/snapshots/test_generic/test_many_subqueries/sqlite/out.sql +++ b/ibis/backends/tests/snapshots/test_generic/test_many_subqueries/sqlite/out.sql @@ -1,32 +1,42 @@ -WITH t0 AS ( +WITH "t6" AS ( SELECT - t5.street AS street, - ROW_NUMBER() OVER (ORDER BY t5.street ASC) - 1 AS "key" - FROM data AS t5 -), t1 AS ( + "t5"."street", + ROW_NUMBER() OVER (ORDER BY "t5"."street" ASC NULLS LAST ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - 1 AS "key" + FROM ( + SELECT + "t2"."street", + "t2"."key" + FROM ( + SELECT + "t0"."street", + ROW_NUMBER() OVER (ORDER BY "t0"."street" ASC NULLS LAST ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - 1 AS "key" + FROM "data" AS "t0" + ) AS "t2" + INNER JOIN ( + SELECT + "t1"."key" + FROM ( + SELECT + "t0"."street", + ROW_NUMBER() OVER (ORDER BY "t0"."street" ASC NULLS LAST ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - 1 AS "key" + FROM "data" AS "t0" + ) AS "t1" + ) AS "t4" + ON "t2"."key" = "t4"."key" + ) AS "t5" +), "t1" AS ( SELECT - t0."key" AS "key" - FROM t0 -), t2 AS ( - SELECT - t0.street AS street, - t0."key" AS "key" - FROM t0 - JOIN t1 - ON t0."key" = t1."key" -), t3 AS ( - SELECT - t2.street AS street, - ROW_NUMBER() OVER (ORDER BY t2.street ASC) - 1 AS "key" - FROM t2 -), t4 AS ( - SELECT - t3."key" AS "key" - FROM t3 + "t0"."street", + ROW_NUMBER() OVER (ORDER BY "t0"."street" ASC NULLS LAST ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - 1 AS "key" + FROM "data" AS "t0" ) SELECT - t3.street, - t3."key" -FROM t3 -JOIN t4 - ON t3."key" = t4."key" \ No newline at end of file + "t8"."street", + "t8"."key" +FROM "t6" AS "t8" +INNER JOIN ( + SELECT + "t7"."key" + FROM "t6" AS "t7" +) AS "t10" + ON "t8"."key" = "t10"."key" \ No newline at end of file diff --git a/ibis/backends/tests/snapshots/test_interactive/test_default_limit/bigquery/out.sql b/ibis/backends/tests/snapshots/test_interactive/test_default_limit/bigquery/out.sql index 09e7f95d3580..b26705406420 100644 --- a/ibis/backends/tests/snapshots/test_interactive/test_default_limit/bigquery/out.sql +++ b/ibis/backends/tests/snapshots/test_interactive/test_default_limit/bigquery/out.sql @@ -1,5 +1,5 @@ SELECT - t0.id, - t0.bool_col -FROM `ibis-gbq`.ibis_gbq_testing.functional_alltypes AS t0 + `t0`.`id`, + `t0`.`bool_col` +FROM `ibis-gbq`.`ibis_gbq_testing`.`functional_alltypes` AS `t0` LIMIT 11 \ No newline at end of file diff --git a/ibis/backends/tests/snapshots/test_interactive/test_default_limit/clickhouse/out.sql b/ibis/backends/tests/snapshots/test_interactive/test_default_limit/clickhouse/out.sql index f26c12ac78c8..b309cd65374d 100644 --- a/ibis/backends/tests/snapshots/test_interactive/test_default_limit/clickhouse/out.sql +++ b/ibis/backends/tests/snapshots/test_interactive/test_default_limit/clickhouse/out.sql @@ -1,5 +1,5 @@ SELECT - t0.id, - t0.bool_col -FROM functional_alltypes AS t0 + "t0"."id", + "t0"."bool_col" +FROM "functional_alltypes" AS "t0" LIMIT 11 \ No newline at end of file diff --git a/ibis/backends/tests/snapshots/test_interactive/test_default_limit/duckdb/out.sql b/ibis/backends/tests/snapshots/test_interactive/test_default_limit/duckdb/out.sql index f26c12ac78c8..b309cd65374d 100644 --- a/ibis/backends/tests/snapshots/test_interactive/test_default_limit/duckdb/out.sql +++ b/ibis/backends/tests/snapshots/test_interactive/test_default_limit/duckdb/out.sql @@ -1,5 +1,5 @@ SELECT - t0.id, - t0.bool_col -FROM functional_alltypes AS t0 + "t0"."id", + "t0"."bool_col" +FROM "functional_alltypes" AS "t0" LIMIT 11 \ No newline at end of file diff --git a/ibis/backends/tests/snapshots/test_interactive/test_disable_query_limit/bigquery/out.sql b/ibis/backends/tests/snapshots/test_interactive/test_disable_query_limit/bigquery/out.sql index 09e7f95d3580..b26705406420 100644 --- a/ibis/backends/tests/snapshots/test_interactive/test_disable_query_limit/bigquery/out.sql +++ b/ibis/backends/tests/snapshots/test_interactive/test_disable_query_limit/bigquery/out.sql @@ -1,5 +1,5 @@ SELECT - t0.id, - t0.bool_col -FROM `ibis-gbq`.ibis_gbq_testing.functional_alltypes AS t0 + `t0`.`id`, + `t0`.`bool_col` +FROM `ibis-gbq`.`ibis_gbq_testing`.`functional_alltypes` AS `t0` LIMIT 11 \ No newline at end of file diff --git a/ibis/backends/tests/snapshots/test_interactive/test_disable_query_limit/clickhouse/out.sql b/ibis/backends/tests/snapshots/test_interactive/test_disable_query_limit/clickhouse/out.sql index f26c12ac78c8..b309cd65374d 100644 --- a/ibis/backends/tests/snapshots/test_interactive/test_disable_query_limit/clickhouse/out.sql +++ b/ibis/backends/tests/snapshots/test_interactive/test_disable_query_limit/clickhouse/out.sql @@ -1,5 +1,5 @@ SELECT - t0.id, - t0.bool_col -FROM functional_alltypes AS t0 + "t0"."id", + "t0"."bool_col" +FROM "functional_alltypes" AS "t0" LIMIT 11 \ No newline at end of file diff --git a/ibis/backends/tests/snapshots/test_interactive/test_disable_query_limit/duckdb/out.sql b/ibis/backends/tests/snapshots/test_interactive/test_disable_query_limit/duckdb/out.sql index f26c12ac78c8..b309cd65374d 100644 --- a/ibis/backends/tests/snapshots/test_interactive/test_disable_query_limit/duckdb/out.sql +++ b/ibis/backends/tests/snapshots/test_interactive/test_disable_query_limit/duckdb/out.sql @@ -1,5 +1,5 @@ SELECT - t0.id, - t0.bool_col -FROM functional_alltypes AS t0 + "t0"."id", + "t0"."bool_col" +FROM "functional_alltypes" AS "t0" LIMIT 11 \ No newline at end of file diff --git a/ibis/backends/tests/snapshots/test_interactive/test_interactive_execute_on_repr/bigquery/out.sql b/ibis/backends/tests/snapshots/test_interactive/test_interactive_execute_on_repr/bigquery/out.sql index 7601954ae202..56100fb38053 100644 --- a/ibis/backends/tests/snapshots/test_interactive/test_interactive_execute_on_repr/bigquery/out.sql +++ b/ibis/backends/tests/snapshots/test_interactive/test_interactive_execute_on_repr/bigquery/out.sql @@ -1,3 +1,3 @@ SELECT - SUM(t0.bigint_col) AS Sum_bigint_col -FROM `ibis-gbq`.ibis_gbq_testing.functional_alltypes AS t0 \ No newline at end of file + SUM(`t0`.`bigint_col`) AS `Sum_bigint_col` +FROM `ibis-gbq`.`ibis_gbq_testing`.`functional_alltypes` AS `t0` \ No newline at end of file diff --git a/ibis/backends/tests/snapshots/test_interactive/test_interactive_execute_on_repr/clickhouse/out.sql b/ibis/backends/tests/snapshots/test_interactive/test_interactive_execute_on_repr/clickhouse/out.sql index eb7db2731364..6bd0ba8c995d 100644 --- a/ibis/backends/tests/snapshots/test_interactive/test_interactive_execute_on_repr/clickhouse/out.sql +++ b/ibis/backends/tests/snapshots/test_interactive/test_interactive_execute_on_repr/clickhouse/out.sql @@ -1,3 +1,3 @@ SELECT - SUM(t0.bigint_col) AS "Sum(bigint_col)" -FROM functional_alltypes AS t0 \ No newline at end of file + SUM("t0"."bigint_col") AS "Sum(bigint_col)" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/tests/snapshots/test_interactive/test_interactive_execute_on_repr/duckdb/out.sql b/ibis/backends/tests/snapshots/test_interactive/test_interactive_execute_on_repr/duckdb/out.sql index eb7db2731364..6bd0ba8c995d 100644 --- a/ibis/backends/tests/snapshots/test_interactive/test_interactive_execute_on_repr/duckdb/out.sql +++ b/ibis/backends/tests/snapshots/test_interactive/test_interactive_execute_on_repr/duckdb/out.sql @@ -1,3 +1,3 @@ SELECT - SUM(t0.bigint_col) AS "Sum(bigint_col)" -FROM functional_alltypes AS t0 \ No newline at end of file + SUM("t0"."bigint_col") AS "Sum(bigint_col)" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/tests/snapshots/test_interactive/test_respect_set_limit/bigquery/out.sql b/ibis/backends/tests/snapshots/test_interactive/test_respect_set_limit/bigquery/out.sql index 1f1906f84e03..62279f6d2e1b 100644 --- a/ibis/backends/tests/snapshots/test_interactive/test_respect_set_limit/bigquery/out.sql +++ b/ibis/backends/tests/snapshots/test_interactive/test_respect_set_limit/bigquery/out.sql @@ -2,9 +2,9 @@ SELECT * FROM ( SELECT - t0.id, - t0.bool_col - FROM `ibis-gbq`.ibis_gbq_testing.functional_alltypes AS t0 + `t0`.`id`, + `t0`.`bool_col` + FROM `ibis-gbq`.`ibis_gbq_testing`.`functional_alltypes` AS `t0` LIMIT 10 -) AS t2 +) AS `t2` LIMIT 11 \ No newline at end of file diff --git a/ibis/backends/tests/snapshots/test_interactive/test_respect_set_limit/clickhouse/out.sql b/ibis/backends/tests/snapshots/test_interactive/test_respect_set_limit/clickhouse/out.sql index 88b2af3a2cc3..97338646649f 100644 --- a/ibis/backends/tests/snapshots/test_interactive/test_respect_set_limit/clickhouse/out.sql +++ b/ibis/backends/tests/snapshots/test_interactive/test_respect_set_limit/clickhouse/out.sql @@ -2,9 +2,9 @@ SELECT * FROM ( SELECT - t0.id, - t0.bool_col - FROM functional_alltypes AS t0 + "t0"."id", + "t0"."bool_col" + FROM "functional_alltypes" AS "t0" LIMIT 10 -) AS t2 +) AS "t2" LIMIT 11 \ No newline at end of file diff --git a/ibis/backends/tests/snapshots/test_interactive/test_respect_set_limit/duckdb/out.sql b/ibis/backends/tests/snapshots/test_interactive/test_respect_set_limit/duckdb/out.sql index 88b2af3a2cc3..97338646649f 100644 --- a/ibis/backends/tests/snapshots/test_interactive/test_respect_set_limit/duckdb/out.sql +++ b/ibis/backends/tests/snapshots/test_interactive/test_respect_set_limit/duckdb/out.sql @@ -2,9 +2,9 @@ SELECT * FROM ( SELECT - t0.id, - t0.bool_col - FROM functional_alltypes AS t0 + "t0"."id", + "t0"."bool_col" + FROM "functional_alltypes" AS "t0" LIMIT 10 -) AS t2 +) AS "t2" LIMIT 11 \ No newline at end of file diff --git a/ibis/backends/tests/snapshots/test_join/test_complex_join_agg/out.sql b/ibis/backends/tests/snapshots/test_join/test_complex_join_agg/out.sql index c454d75c63aa..07089341f0a2 100644 --- a/ibis/backends/tests/snapshots/test_join/test_complex_join_agg/out.sql +++ b/ibis/backends/tests/snapshots/test_join/test_complex_join_agg/out.sql @@ -1,17 +1,17 @@ SELECT - t3.key1 AS key1, - AVG(t3.value1 - t3.value2) AS avg_diff + "t4"."key1", + AVG("t4"."value1" - "t4"."value2") AS "avg_diff" FROM ( SELECT - t0.value1 AS value1, - t0.key1 AS key1, - t0.key2 AS key2, - t1.value2 AS value2, - t1.key1 AS key1_right, - t1.key4 AS key4 - FROM table1 AS t0 - LEFT OUTER JOIN table2 AS t1 - ON t0.key1 = t1.key1 -) AS t3 + "t2"."value1", + "t2"."key1", + "t2"."key2", + "t3"."value2", + "t3"."key1" AS "key1_right", + "t3"."key4" + FROM "table1" AS "t2" + LEFT OUTER JOIN "table2" AS "t3" + ON "t2"."key1" = "t3"."key1" +) AS "t4" GROUP BY 1 \ No newline at end of file diff --git a/ibis/backends/tests/snapshots/test_sql/test_cte_refs_in_topo_order/clickhouse/out.sql b/ibis/backends/tests/snapshots/test_sql/test_cte_refs_in_topo_order/clickhouse/out.sql index d0b7a174d49a..3cccc7356173 100644 --- a/ibis/backends/tests/snapshots/test_sql/test_cte_refs_in_topo_order/clickhouse/out.sql +++ b/ibis/backends/tests/snapshots/test_sql/test_cte_refs_in_topo_order/clickhouse/out.sql @@ -1,20 +1,20 @@ -WITH t1 AS ( +WITH "t1" AS ( SELECT - t0.key - FROM leaf AS t0 + "t0"."key" + FROM "leaf" AS "t0" WHERE TRUE ) SELECT - t3.key -FROM t1 AS t3 -INNER JOIN t1 AS t4 - ON t3.key = t4.key + "t3"."key" +FROM "t1" AS "t3" +INNER JOIN "t1" AS "t4" + ON "t3"."key" = "t4"."key" INNER JOIN ( SELECT - t3.key - FROM t1 AS t3 - INNER JOIN t1 AS t4 - ON t3.key = t4.key -) AS t6 - ON t3.key = t6.key \ No newline at end of file + "t3"."key" + FROM "t1" AS "t3" + INNER JOIN "t1" AS "t4" + ON "t3"."key" = "t4"."key" +) AS "t6" + ON "t3"."key" = "t6"."key" \ No newline at end of file diff --git a/ibis/backends/tests/snapshots/test_sql/test_cte_refs_in_topo_order/duckdb/out.sql b/ibis/backends/tests/snapshots/test_sql/test_cte_refs_in_topo_order/duckdb/out.sql index d0b7a174d49a..3cccc7356173 100644 --- a/ibis/backends/tests/snapshots/test_sql/test_cte_refs_in_topo_order/duckdb/out.sql +++ b/ibis/backends/tests/snapshots/test_sql/test_cte_refs_in_topo_order/duckdb/out.sql @@ -1,20 +1,20 @@ -WITH t1 AS ( +WITH "t1" AS ( SELECT - t0.key - FROM leaf AS t0 + "t0"."key" + FROM "leaf" AS "t0" WHERE TRUE ) SELECT - t3.key -FROM t1 AS t3 -INNER JOIN t1 AS t4 - ON t3.key = t4.key + "t3"."key" +FROM "t1" AS "t3" +INNER JOIN "t1" AS "t4" + ON "t3"."key" = "t4"."key" INNER JOIN ( SELECT - t3.key - FROM t1 AS t3 - INNER JOIN t1 AS t4 - ON t3.key = t4.key -) AS t6 - ON t3.key = t6.key \ No newline at end of file + "t3"."key" + FROM "t1" AS "t3" + INNER JOIN "t1" AS "t4" + ON "t3"."key" = "t4"."key" +) AS "t6" + ON "t3"."key" = "t6"."key" \ No newline at end of file diff --git a/ibis/backends/tests/snapshots/test_sql/test_cte_refs_in_topo_order/risingwave/out.sql b/ibis/backends/tests/snapshots/test_sql/test_cte_refs_in_topo_order/risingwave/out.sql new file mode 100644 index 000000000000..3cccc7356173 --- /dev/null +++ b/ibis/backends/tests/snapshots/test_sql/test_cte_refs_in_topo_order/risingwave/out.sql @@ -0,0 +1,20 @@ +WITH "t1" AS ( + SELECT + "t0"."key" + FROM "leaf" AS "t0" + WHERE + TRUE +) +SELECT + "t3"."key" +FROM "t1" AS "t3" +INNER JOIN "t1" AS "t4" + ON "t3"."key" = "t4"."key" +INNER JOIN ( + SELECT + "t3"."key" + FROM "t1" AS "t3" + INNER JOIN "t1" AS "t4" + ON "t3"."key" = "t4"."key" +) AS "t6" + ON "t3"."key" = "t6"."key" \ No newline at end of file diff --git a/ibis/backends/tests/snapshots/test_sql/test_cte_refs_in_topo_order/sqlite/out.sql b/ibis/backends/tests/snapshots/test_sql/test_cte_refs_in_topo_order/sqlite/out.sql index 14bef4d230ef..3cccc7356173 100644 --- a/ibis/backends/tests/snapshots/test_sql/test_cte_refs_in_topo_order/sqlite/out.sql +++ b/ibis/backends/tests/snapshots/test_sql/test_cte_refs_in_topo_order/sqlite/out.sql @@ -1,22 +1,20 @@ -WITH t0 AS ( +WITH "t1" AS ( SELECT - t4."key" AS "key" - FROM leaf AS t4 + "t0"."key" + FROM "leaf" AS "t0" WHERE - 1 = 1 -), t1 AS ( - SELECT - t0."key" AS "key" - FROM t0 -), t2 AS ( - SELECT - t0."key" AS "key" - FROM t0 - JOIN t1 - ON t0."key" = t1."key" + TRUE ) SELECT - t2."key" -FROM t2 -JOIN t2 AS t3 - ON t2."key" = t3."key" \ No newline at end of file + "t3"."key" +FROM "t1" AS "t3" +INNER JOIN "t1" AS "t4" + ON "t3"."key" = "t4"."key" +INNER JOIN ( + SELECT + "t3"."key" + FROM "t1" AS "t3" + INNER JOIN "t1" AS "t4" + ON "t3"."key" = "t4"."key" +) AS "t6" + ON "t3"."key" = "t6"."key" \ No newline at end of file diff --git a/ibis/backends/tests/snapshots/test_sql/test_group_by_has_index/bigquery/out.sql b/ibis/backends/tests/snapshots/test_sql/test_group_by_has_index/bigquery/out.sql index fc16f2428d16..ac006b1d5f25 100644 --- a/ibis/backends/tests/snapshots/test_sql/test_group_by_has_index/bigquery/out.sql +++ b/ibis/backends/tests/snapshots/test_sql/test_group_by_has_index/bigquery/out.sql @@ -1,5 +1,5 @@ SELECT - CASE t0.continent + CASE `t0`.`continent` WHEN 'NA' THEN 'North America' WHEN 'SA' @@ -15,8 +15,8 @@ SELECT WHEN 'AN' THEN 'Antarctica' ELSE 'Unknown continent' - END AS cont, - SUM(t0.population) AS total_pop -FROM countries AS t0 + END AS `cont`, + SUM(`t0`.`population`) AS `total_pop` +FROM `countries` AS `t0` GROUP BY 1 \ No newline at end of file diff --git a/ibis/backends/tests/snapshots/test_sql/test_group_by_has_index/clickhouse/out.sql b/ibis/backends/tests/snapshots/test_sql/test_group_by_has_index/clickhouse/out.sql index 0b9554f4c048..3abd937a1e28 100644 --- a/ibis/backends/tests/snapshots/test_sql/test_group_by_has_index/clickhouse/out.sql +++ b/ibis/backends/tests/snapshots/test_sql/test_group_by_has_index/clickhouse/out.sql @@ -1,5 +1,5 @@ SELECT - CASE t0.continent + CASE "t0"."continent" WHEN 'NA' THEN 'North America' WHEN 'SA' @@ -15,11 +15,11 @@ SELECT WHEN 'AN' THEN 'Antarctica' ELSE 'Unknown continent' - END AS cont, - SUM(t0.population) AS total_pop -FROM countries AS t0 + END AS "cont", + SUM("t0"."population") AS "total_pop" +FROM "countries" AS "t0" GROUP BY - CASE t0.continent + CASE "t0"."continent" WHEN 'NA' THEN 'North America' WHEN 'SA' diff --git a/ibis/backends/tests/snapshots/test_sql/test_group_by_has_index/duckdb/out.sql b/ibis/backends/tests/snapshots/test_sql/test_group_by_has_index/duckdb/out.sql index fc16f2428d16..d3969647c9ea 100644 --- a/ibis/backends/tests/snapshots/test_sql/test_group_by_has_index/duckdb/out.sql +++ b/ibis/backends/tests/snapshots/test_sql/test_group_by_has_index/duckdb/out.sql @@ -1,5 +1,5 @@ SELECT - CASE t0.continent + CASE "t0"."continent" WHEN 'NA' THEN 'North America' WHEN 'SA' @@ -15,8 +15,8 @@ SELECT WHEN 'AN' THEN 'Antarctica' ELSE 'Unknown continent' - END AS cont, - SUM(t0.population) AS total_pop -FROM countries AS t0 + END AS "cont", + SUM("t0"."population") AS "total_pop" +FROM "countries" AS "t0" GROUP BY 1 \ No newline at end of file diff --git a/ibis/backends/tests/snapshots/test_sql/test_isin_bug/bigquery/out.sql b/ibis/backends/tests/snapshots/test_sql/test_isin_bug/bigquery/out.sql index 9e6bcbdd13af..ab4017d56b0f 100644 --- a/ibis/backends/tests/snapshots/test_sql/test_isin_bug/bigquery/out.sql +++ b/ibis/backends/tests/snapshots/test_sql/test_isin_bug/bigquery/out.sql @@ -1,9 +1,9 @@ SELECT - t0.x IN ( + `t0`.`x` IN ( SELECT - t0.x - FROM t AS t0 + `t0`.`x` + FROM `t` AS `t0` WHERE - t0.x > 2 - ) AS InSubquery_x -FROM t AS t0 \ No newline at end of file + `t0`.`x` > 2 + ) AS `InSubquery_x` +FROM `t` AS `t0` \ No newline at end of file diff --git a/ibis/backends/tests/snapshots/test_sql/test_isin_bug/clickhouse/out.sql b/ibis/backends/tests/snapshots/test_sql/test_isin_bug/clickhouse/out.sql index cd122964c87e..c1611d8cecc3 100644 --- a/ibis/backends/tests/snapshots/test_sql/test_isin_bug/clickhouse/out.sql +++ b/ibis/backends/tests/snapshots/test_sql/test_isin_bug/clickhouse/out.sql @@ -1,9 +1,9 @@ SELECT - t0.x IN ( + "t0"."x" IN ( SELECT - t0.x - FROM t AS t0 + "t0"."x" + FROM "t" AS "t0" WHERE - t0.x > 2 + "t0"."x" > 2 ) AS "InSubquery(x)" -FROM t AS t0 \ No newline at end of file +FROM "t" AS "t0" \ No newline at end of file diff --git a/ibis/backends/tests/snapshots/test_sql/test_isin_bug/duckdb/out.sql b/ibis/backends/tests/snapshots/test_sql/test_isin_bug/duckdb/out.sql index dd1d25118977..fa4484d15c6a 100644 --- a/ibis/backends/tests/snapshots/test_sql/test_isin_bug/duckdb/out.sql +++ b/ibis/backends/tests/snapshots/test_sql/test_isin_bug/duckdb/out.sql @@ -1,9 +1,9 @@ SELECT - t0.x IN ( + "t0"."x" IN ( SELECT - t0.x - FROM t AS t0 + "t0"."x" + FROM "t" AS "t0" WHERE - t0.x > CAST(2 AS TINYINT) + "t0"."x" > CAST(2 AS TINYINT) ) AS "InSubquery(x)" -FROM t AS t0 \ No newline at end of file +FROM "t" AS "t0" \ No newline at end of file diff --git a/ibis/backends/tests/snapshots/test_sql/test_union_aliasing/bigquery/out.sql b/ibis/backends/tests/snapshots/test_sql/test_union_aliasing/bigquery/out.sql index a5ee8fb42f14..31cedc71e60b 100644 --- a/ibis/backends/tests/snapshots/test_sql/test_union_aliasing/bigquery/out.sql +++ b/ibis/backends/tests/snapshots/test_sql/test_union_aliasing/bigquery/out.sql @@ -1,81 +1,81 @@ -WITH t5 AS ( +WITH `t5` AS ( SELECT - t4.field_of_study, - ANY_VALUE(t4.diff) AS diff + `t4`.`field_of_study`, + ANY_VALUE(`t4`.`diff`) AS `diff` FROM ( SELECT - t3.field_of_study, - t3.years, - t3.degrees, - t3.earliest_degrees, - t3.latest_degrees, - t3.latest_degrees - t3.earliest_degrees AS diff + `t3`.`field_of_study`, + `t3`.`years`, + `t3`.`degrees`, + `t3`.`earliest_degrees`, + `t3`.`latest_degrees`, + `t3`.`latest_degrees` - `t3`.`earliest_degrees` AS `diff` FROM ( SELECT - t2.field_of_study, - t2.years, - t2.degrees, - first_value(t2.degrees) OVER (PARTITION BY t2.field_of_study ORDER BY t2.years ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS earliest_degrees, - last_value(t2.degrees) OVER (PARTITION BY t2.field_of_study ORDER BY t2.years ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS latest_degrees + `t2`.`field_of_study`, + `t2`.`years`, + `t2`.`degrees`, + first_value(`t2`.`degrees`) OVER (PARTITION BY `t2`.`field_of_study` ORDER BY `t2`.`years` ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS `earliest_degrees`, + last_value(`t2`.`degrees`) OVER (PARTITION BY `t2`.`field_of_study` ORDER BY `t2`.`years` ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS `latest_degrees` FROM ( SELECT - t1.field_of_study, - t1.__pivoted__.years AS years, - t1.__pivoted__.degrees AS degrees + `t1`.`field_of_study`, + `t1`.`__pivoted__`.`years` AS `years`, + `t1`.`__pivoted__`.`degrees` AS `degrees` FROM ( SELECT - t0.field_of_study, - IF(pos = pos_2, __pivoted__, NULL) AS __pivoted__ - FROM humanities AS t0 + `t0`.`field_of_study`, + IF(pos = pos_2, `__pivoted__`, NULL) AS `__pivoted__` + FROM `humanities` AS `t0` CROSS JOIN UNNEST(GENERATE_ARRAY( 0, GREATEST( ARRAY_LENGTH( - [STRUCT('1970-71' AS years, t0.`1970-71` AS degrees), STRUCT('1975-76' AS years, t0.`1975-76` AS degrees), STRUCT('1980-81' AS years, t0.`1980-81` AS degrees), STRUCT('1985-86' AS years, t0.`1985-86` AS degrees), STRUCT('1990-91' AS years, t0.`1990-91` AS degrees), STRUCT('1995-96' AS years, t0.`1995-96` AS degrees), STRUCT('2000-01' AS years, t0.`2000-01` AS degrees), STRUCT('2005-06' AS years, t0.`2005-06` AS degrees), STRUCT('2010-11' AS years, t0.`2010-11` AS degrees), STRUCT('2011-12' AS years, t0.`2011-12` AS degrees), STRUCT('2012-13' AS years, t0.`2012-13` AS degrees), STRUCT('2013-14' AS years, t0.`2013-14` AS degrees), STRUCT('2014-15' AS years, t0.`2014-15` AS degrees), STRUCT('2015-16' AS years, t0.`2015-16` AS degrees), STRUCT('2016-17' AS years, t0.`2016-17` AS degrees), STRUCT('2017-18' AS years, t0.`2017-18` AS degrees), STRUCT('2018-19' AS years, t0.`2018-19` AS degrees), STRUCT('2019-20' AS years, t0.`2019-20` AS degrees)] + [STRUCT('1970-71' AS `years`, `t0`.`1970-71` AS `degrees`), STRUCT('1975-76' AS `years`, `t0`.`1975-76` AS `degrees`), STRUCT('1980-81' AS `years`, `t0`.`1980-81` AS `degrees`), STRUCT('1985-86' AS `years`, `t0`.`1985-86` AS `degrees`), STRUCT('1990-91' AS `years`, `t0`.`1990-91` AS `degrees`), STRUCT('1995-96' AS `years`, `t0`.`1995-96` AS `degrees`), STRUCT('2000-01' AS `years`, `t0`.`2000-01` AS `degrees`), STRUCT('2005-06' AS `years`, `t0`.`2005-06` AS `degrees`), STRUCT('2010-11' AS `years`, `t0`.`2010-11` AS `degrees`), STRUCT('2011-12' AS `years`, `t0`.`2011-12` AS `degrees`), STRUCT('2012-13' AS `years`, `t0`.`2012-13` AS `degrees`), STRUCT('2013-14' AS `years`, `t0`.`2013-14` AS `degrees`), STRUCT('2014-15' AS `years`, `t0`.`2014-15` AS `degrees`), STRUCT('2015-16' AS `years`, `t0`.`2015-16` AS `degrees`), STRUCT('2016-17' AS `years`, `t0`.`2016-17` AS `degrees`), STRUCT('2017-18' AS `years`, `t0`.`2017-18` AS `degrees`), STRUCT('2018-19' AS `years`, `t0`.`2018-19` AS `degrees`), STRUCT('2019-20' AS `years`, `t0`.`2019-20` AS `degrees`)] ) ) - 1 )) AS pos - CROSS JOIN UNNEST([STRUCT('1970-71' AS years, t0.`1970-71` AS degrees), STRUCT('1975-76' AS years, t0.`1975-76` AS degrees), STRUCT('1980-81' AS years, t0.`1980-81` AS degrees), STRUCT('1985-86' AS years, t0.`1985-86` AS degrees), STRUCT('1990-91' AS years, t0.`1990-91` AS degrees), STRUCT('1995-96' AS years, t0.`1995-96` AS degrees), STRUCT('2000-01' AS years, t0.`2000-01` AS degrees), STRUCT('2005-06' AS years, t0.`2005-06` AS degrees), STRUCT('2010-11' AS years, t0.`2010-11` AS degrees), STRUCT('2011-12' AS years, t0.`2011-12` AS degrees), STRUCT('2012-13' AS years, t0.`2012-13` AS degrees), STRUCT('2013-14' AS years, t0.`2013-14` AS degrees), STRUCT('2014-15' AS years, t0.`2014-15` AS degrees), STRUCT('2015-16' AS years, t0.`2015-16` AS degrees), STRUCT('2016-17' AS years, t0.`2016-17` AS degrees), STRUCT('2017-18' AS years, t0.`2017-18` AS degrees), STRUCT('2018-19' AS years, t0.`2018-19` AS degrees), STRUCT('2019-20' AS years, t0.`2019-20` AS degrees)]) AS __pivoted__ WITH OFFSET AS pos_2 + CROSS JOIN UNNEST([STRUCT('1970-71' AS `years`, `t0`.`1970-71` AS `degrees`), STRUCT('1975-76' AS `years`, `t0`.`1975-76` AS `degrees`), STRUCT('1980-81' AS `years`, `t0`.`1980-81` AS `degrees`), STRUCT('1985-86' AS `years`, `t0`.`1985-86` AS `degrees`), STRUCT('1990-91' AS `years`, `t0`.`1990-91` AS `degrees`), STRUCT('1995-96' AS `years`, `t0`.`1995-96` AS `degrees`), STRUCT('2000-01' AS `years`, `t0`.`2000-01` AS `degrees`), STRUCT('2005-06' AS `years`, `t0`.`2005-06` AS `degrees`), STRUCT('2010-11' AS `years`, `t0`.`2010-11` AS `degrees`), STRUCT('2011-12' AS `years`, `t0`.`2011-12` AS `degrees`), STRUCT('2012-13' AS `years`, `t0`.`2012-13` AS `degrees`), STRUCT('2013-14' AS `years`, `t0`.`2013-14` AS `degrees`), STRUCT('2014-15' AS `years`, `t0`.`2014-15` AS `degrees`), STRUCT('2015-16' AS `years`, `t0`.`2015-16` AS `degrees`), STRUCT('2016-17' AS `years`, `t0`.`2016-17` AS `degrees`), STRUCT('2017-18' AS `years`, `t0`.`2017-18` AS `degrees`), STRUCT('2018-19' AS `years`, `t0`.`2018-19` AS `degrees`), STRUCT('2019-20' AS `years`, `t0`.`2019-20` AS `degrees`)]) AS `__pivoted__` WITH OFFSET AS pos_2 WHERE pos = pos_2 OR ( pos > ( ARRAY_LENGTH( - [STRUCT('1970-71' AS years, t0.`1970-71` AS degrees), STRUCT('1975-76' AS years, t0.`1975-76` AS degrees), STRUCT('1980-81' AS years, t0.`1980-81` AS degrees), STRUCT('1985-86' AS years, t0.`1985-86` AS degrees), STRUCT('1990-91' AS years, t0.`1990-91` AS degrees), STRUCT('1995-96' AS years, t0.`1995-96` AS degrees), STRUCT('2000-01' AS years, t0.`2000-01` AS degrees), STRUCT('2005-06' AS years, t0.`2005-06` AS degrees), STRUCT('2010-11' AS years, t0.`2010-11` AS degrees), STRUCT('2011-12' AS years, t0.`2011-12` AS degrees), STRUCT('2012-13' AS years, t0.`2012-13` AS degrees), STRUCT('2013-14' AS years, t0.`2013-14` AS degrees), STRUCT('2014-15' AS years, t0.`2014-15` AS degrees), STRUCT('2015-16' AS years, t0.`2015-16` AS degrees), STRUCT('2016-17' AS years, t0.`2016-17` AS degrees), STRUCT('2017-18' AS years, t0.`2017-18` AS degrees), STRUCT('2018-19' AS years, t0.`2018-19` AS degrees), STRUCT('2019-20' AS years, t0.`2019-20` AS degrees)] + [STRUCT('1970-71' AS `years`, `t0`.`1970-71` AS `degrees`), STRUCT('1975-76' AS `years`, `t0`.`1975-76` AS `degrees`), STRUCT('1980-81' AS `years`, `t0`.`1980-81` AS `degrees`), STRUCT('1985-86' AS `years`, `t0`.`1985-86` AS `degrees`), STRUCT('1990-91' AS `years`, `t0`.`1990-91` AS `degrees`), STRUCT('1995-96' AS `years`, `t0`.`1995-96` AS `degrees`), STRUCT('2000-01' AS `years`, `t0`.`2000-01` AS `degrees`), STRUCT('2005-06' AS `years`, `t0`.`2005-06` AS `degrees`), STRUCT('2010-11' AS `years`, `t0`.`2010-11` AS `degrees`), STRUCT('2011-12' AS `years`, `t0`.`2011-12` AS `degrees`), STRUCT('2012-13' AS `years`, `t0`.`2012-13` AS `degrees`), STRUCT('2013-14' AS `years`, `t0`.`2013-14` AS `degrees`), STRUCT('2014-15' AS `years`, `t0`.`2014-15` AS `degrees`), STRUCT('2015-16' AS `years`, `t0`.`2015-16` AS `degrees`), STRUCT('2016-17' AS `years`, `t0`.`2016-17` AS `degrees`), STRUCT('2017-18' AS `years`, `t0`.`2017-18` AS `degrees`), STRUCT('2018-19' AS `years`, `t0`.`2018-19` AS `degrees`), STRUCT('2019-20' AS `years`, `t0`.`2019-20` AS `degrees`)] ) - 1 ) AND pos_2 = ( ARRAY_LENGTH( - [STRUCT('1970-71' AS years, t0.`1970-71` AS degrees), STRUCT('1975-76' AS years, t0.`1975-76` AS degrees), STRUCT('1980-81' AS years, t0.`1980-81` AS degrees), STRUCT('1985-86' AS years, t0.`1985-86` AS degrees), STRUCT('1990-91' AS years, t0.`1990-91` AS degrees), STRUCT('1995-96' AS years, t0.`1995-96` AS degrees), STRUCT('2000-01' AS years, t0.`2000-01` AS degrees), STRUCT('2005-06' AS years, t0.`2005-06` AS degrees), STRUCT('2010-11' AS years, t0.`2010-11` AS degrees), STRUCT('2011-12' AS years, t0.`2011-12` AS degrees), STRUCT('2012-13' AS years, t0.`2012-13` AS degrees), STRUCT('2013-14' AS years, t0.`2013-14` AS degrees), STRUCT('2014-15' AS years, t0.`2014-15` AS degrees), STRUCT('2015-16' AS years, t0.`2015-16` AS degrees), STRUCT('2016-17' AS years, t0.`2016-17` AS degrees), STRUCT('2017-18' AS years, t0.`2017-18` AS degrees), STRUCT('2018-19' AS years, t0.`2018-19` AS degrees), STRUCT('2019-20' AS years, t0.`2019-20` AS degrees)] + [STRUCT('1970-71' AS `years`, `t0`.`1970-71` AS `degrees`), STRUCT('1975-76' AS `years`, `t0`.`1975-76` AS `degrees`), STRUCT('1980-81' AS `years`, `t0`.`1980-81` AS `degrees`), STRUCT('1985-86' AS `years`, `t0`.`1985-86` AS `degrees`), STRUCT('1990-91' AS `years`, `t0`.`1990-91` AS `degrees`), STRUCT('1995-96' AS `years`, `t0`.`1995-96` AS `degrees`), STRUCT('2000-01' AS `years`, `t0`.`2000-01` AS `degrees`), STRUCT('2005-06' AS `years`, `t0`.`2005-06` AS `degrees`), STRUCT('2010-11' AS `years`, `t0`.`2010-11` AS `degrees`), STRUCT('2011-12' AS `years`, `t0`.`2011-12` AS `degrees`), STRUCT('2012-13' AS `years`, `t0`.`2012-13` AS `degrees`), STRUCT('2013-14' AS `years`, `t0`.`2013-14` AS `degrees`), STRUCT('2014-15' AS `years`, `t0`.`2014-15` AS `degrees`), STRUCT('2015-16' AS `years`, `t0`.`2015-16` AS `degrees`), STRUCT('2016-17' AS `years`, `t0`.`2016-17` AS `degrees`), STRUCT('2017-18' AS `years`, `t0`.`2017-18` AS `degrees`), STRUCT('2018-19' AS `years`, `t0`.`2018-19` AS `degrees`), STRUCT('2019-20' AS `years`, `t0`.`2019-20` AS `degrees`)] ) - 1 ) ) - ) AS t1 - ) AS t2 - ) AS t3 - ) AS t4 + ) AS `t1` + ) AS `t2` + ) AS `t3` + ) AS `t4` GROUP BY 1 ) SELECT - t11.field_of_study, - t11.diff + `t11`.`field_of_study`, + `t11`.`diff` FROM ( SELECT - t6.field_of_study, - t6.diff - FROM t5 AS t6 + `t6`.`field_of_study`, + `t6`.`diff` + FROM `t5` AS `t6` ORDER BY - t6.diff DESC + `t6`.`diff` DESC LIMIT 10 UNION ALL SELECT - t6.field_of_study, - t6.diff - FROM t5 AS t6 + `t6`.`field_of_study`, + `t6`.`diff` + FROM `t5` AS `t6` WHERE - t6.diff < 0 + `t6`.`diff` < 0 ORDER BY - t6.diff ASC NULLS LAST + `t6`.`diff` ASC NULLS LAST LIMIT 10 -) AS t11 \ No newline at end of file +) AS `t11` \ No newline at end of file diff --git a/ibis/backends/tests/snapshots/test_sql/test_union_aliasing/clickhouse/out.sql b/ibis/backends/tests/snapshots/test_sql/test_union_aliasing/clickhouse/out.sql index 55466dbdea2c..1ca9740613df 100644 --- a/ibis/backends/tests/snapshots/test_sql/test_union_aliasing/clickhouse/out.sql +++ b/ibis/backends/tests/snapshots/test_sql/test_union_aliasing/clickhouse/out.sql @@ -1,60 +1,60 @@ -WITH t5 AS ( +WITH "t5" AS ( SELECT - t4.field_of_study, - any(t4.diff) AS diff + "t4"."field_of_study", + any("t4"."diff") AS "diff" FROM ( SELECT - t3.field_of_study, - t3.years, - t3.degrees, - t3.earliest_degrees, - t3.latest_degrees, - t3.latest_degrees - t3.earliest_degrees AS diff + "t3"."field_of_study", + "t3"."years", + "t3"."degrees", + "t3"."earliest_degrees", + "t3"."latest_degrees", + "t3"."latest_degrees" - "t3"."earliest_degrees" AS "diff" FROM ( SELECT - t2.field_of_study, - t2.years, - t2.degrees, - any(t2.degrees) OVER (PARTITION BY t2.field_of_study ORDER BY t2.years ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS earliest_degrees, - anyLast(t2.degrees) OVER (PARTITION BY t2.field_of_study ORDER BY t2.years ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS latest_degrees + "t2"."field_of_study", + "t2"."years", + "t2"."degrees", + any("t2"."degrees") OVER (PARTITION BY "t2"."field_of_study" ORDER BY "t2"."years" ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS "earliest_degrees", + anyLast("t2"."degrees") OVER (PARTITION BY "t2"."field_of_study" ORDER BY "t2"."years" ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS "latest_degrees" FROM ( SELECT - t1.field_of_study, - CAST(t1.__pivoted__.1 AS Nullable(String)) AS years, - CAST(t1.__pivoted__.2 AS Nullable(Int64)) AS degrees + "t1"."field_of_study", + CAST("t1"."__pivoted__".1 AS Nullable(String)) AS "years", + CAST("t1"."__pivoted__".2 AS Nullable(Int64)) AS "degrees" FROM ( SELECT - t0.field_of_study, + "t0"."field_of_study", arrayJoin( - [CAST(tuple('1970-71', t0."1970-71") AS Tuple(years Nullable(String), degrees Nullable(Int64))), CAST(tuple('1975-76', t0."1975-76") AS Tuple(years Nullable(String), degrees Nullable(Int64))), CAST(tuple('1980-81', t0."1980-81") AS Tuple(years Nullable(String), degrees Nullable(Int64))), CAST(tuple('1985-86', t0."1985-86") AS Tuple(years Nullable(String), degrees Nullable(Int64))), CAST(tuple('1990-91', t0."1990-91") AS Tuple(years Nullable(String), degrees Nullable(Int64))), CAST(tuple('1995-96', t0."1995-96") AS Tuple(years Nullable(String), degrees Nullable(Int64))), CAST(tuple('2000-01', t0."2000-01") AS Tuple(years Nullable(String), degrees Nullable(Int64))), CAST(tuple('2005-06', t0."2005-06") AS Tuple(years Nullable(String), degrees Nullable(Int64))), CAST(tuple('2010-11', t0."2010-11") AS Tuple(years Nullable(String), degrees Nullable(Int64))), CAST(tuple('2011-12', t0."2011-12") AS Tuple(years Nullable(String), degrees Nullable(Int64))), CAST(tuple('2012-13', t0."2012-13") AS Tuple(years Nullable(String), degrees Nullable(Int64))), CAST(tuple('2013-14', t0."2013-14") AS Tuple(years Nullable(String), degrees Nullable(Int64))), CAST(tuple('2014-15', t0."2014-15") AS Tuple(years Nullable(String), degrees Nullable(Int64))), CAST(tuple('2015-16', t0."2015-16") AS Tuple(years Nullable(String), degrees Nullable(Int64))), CAST(tuple('2016-17', t0."2016-17") AS Tuple(years Nullable(String), degrees Nullable(Int64))), CAST(tuple('2017-18', t0."2017-18") AS Tuple(years Nullable(String), degrees Nullable(Int64))), CAST(tuple('2018-19', t0."2018-19") AS Tuple(years Nullable(String), degrees Nullable(Int64))), CAST(tuple('2019-20', t0."2019-20") AS Tuple(years Nullable(String), degrees Nullable(Int64)))] - ) AS __pivoted__ - FROM humanities AS t0 - ) AS t1 - ) AS t2 - ) AS t3 - ) AS t4 + [CAST(tuple('1970-71', "t0"."1970-71") AS Tuple(years Nullable(String), degrees Nullable(Int64))), CAST(tuple('1975-76', "t0"."1975-76") AS Tuple(years Nullable(String), degrees Nullable(Int64))), CAST(tuple('1980-81', "t0"."1980-81") AS Tuple(years Nullable(String), degrees Nullable(Int64))), CAST(tuple('1985-86', "t0"."1985-86") AS Tuple(years Nullable(String), degrees Nullable(Int64))), CAST(tuple('1990-91', "t0"."1990-91") AS Tuple(years Nullable(String), degrees Nullable(Int64))), CAST(tuple('1995-96', "t0"."1995-96") AS Tuple(years Nullable(String), degrees Nullable(Int64))), CAST(tuple('2000-01', "t0"."2000-01") AS Tuple(years Nullable(String), degrees Nullable(Int64))), CAST(tuple('2005-06', "t0"."2005-06") AS Tuple(years Nullable(String), degrees Nullable(Int64))), CAST(tuple('2010-11', "t0"."2010-11") AS Tuple(years Nullable(String), degrees Nullable(Int64))), CAST(tuple('2011-12', "t0"."2011-12") AS Tuple(years Nullable(String), degrees Nullable(Int64))), CAST(tuple('2012-13', "t0"."2012-13") AS Tuple(years Nullable(String), degrees Nullable(Int64))), CAST(tuple('2013-14', "t0"."2013-14") AS Tuple(years Nullable(String), degrees Nullable(Int64))), CAST(tuple('2014-15', "t0"."2014-15") AS Tuple(years Nullable(String), degrees Nullable(Int64))), CAST(tuple('2015-16', "t0"."2015-16") AS Tuple(years Nullable(String), degrees Nullable(Int64))), CAST(tuple('2016-17', "t0"."2016-17") AS Tuple(years Nullable(String), degrees Nullable(Int64))), CAST(tuple('2017-18', "t0"."2017-18") AS Tuple(years Nullable(String), degrees Nullable(Int64))), CAST(tuple('2018-19', "t0"."2018-19") AS Tuple(years Nullable(String), degrees Nullable(Int64))), CAST(tuple('2019-20', "t0"."2019-20") AS Tuple(years Nullable(String), degrees Nullable(Int64)))] + ) AS "__pivoted__" + FROM "humanities" AS "t0" + ) AS "t1" + ) AS "t2" + ) AS "t3" + ) AS "t4" GROUP BY - t4.field_of_study + "t4"."field_of_study" ) SELECT - t11.field_of_study, - t11.diff + "t11"."field_of_study", + "t11"."diff" FROM ( SELECT - t6.field_of_study, - t6.diff - FROM t5 AS t6 + "t6"."field_of_study", + "t6"."diff" + FROM "t5" AS "t6" ORDER BY - t6.diff DESC + "t6"."diff" DESC LIMIT 10 UNION ALL SELECT - t6.field_of_study, - t6.diff - FROM t5 AS t6 + "t6"."field_of_study", + "t6"."diff" + FROM "t5" AS "t6" WHERE - t6.diff < 0 + "t6"."diff" < 0 ORDER BY - t6.diff ASC + "t6"."diff" ASC LIMIT 10 -) AS t11 \ No newline at end of file +) AS "t11" \ No newline at end of file diff --git a/ibis/backends/tests/snapshots/test_sql/test_union_aliasing/duckdb/out.sql b/ibis/backends/tests/snapshots/test_sql/test_union_aliasing/duckdb/out.sql index 52d685293884..997a167e6479 100644 --- a/ibis/backends/tests/snapshots/test_sql/test_union_aliasing/duckdb/out.sql +++ b/ibis/backends/tests/snapshots/test_sql/test_union_aliasing/duckdb/out.sql @@ -1,60 +1,60 @@ -WITH t5 AS ( +WITH "t5" AS ( SELECT - t4.field_of_study, - FIRST(t4.diff) AS diff + "t4"."field_of_study", + FIRST("t4"."diff") AS "diff" FROM ( SELECT - t3.field_of_study, - t3.years, - t3.degrees, - t3.earliest_degrees, - t3.latest_degrees, - t3.latest_degrees - t3.earliest_degrees AS diff + "t3"."field_of_study", + "t3"."years", + "t3"."degrees", + "t3"."earliest_degrees", + "t3"."latest_degrees", + "t3"."latest_degrees" - "t3"."earliest_degrees" AS "diff" FROM ( SELECT - t2.field_of_study, - t2.years, - t2.degrees, - FIRST(t2.degrees) OVER (PARTITION BY t2.field_of_study ORDER BY t2.years ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS earliest_degrees, - LAST(t2.degrees) OVER (PARTITION BY t2.field_of_study ORDER BY t2.years ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS latest_degrees + "t2"."field_of_study", + "t2"."years", + "t2"."degrees", + FIRST("t2"."degrees") OVER (PARTITION BY "t2"."field_of_study" ORDER BY "t2"."years" ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS "earliest_degrees", + LAST("t2"."degrees") OVER (PARTITION BY "t2"."field_of_study" ORDER BY "t2"."years" ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS "latest_degrees" FROM ( SELECT - t1.field_of_study, - t1.__pivoted__.years AS years, - t1.__pivoted__.degrees AS degrees + "t1"."field_of_study", + "t1"."__pivoted__"."years" AS "years", + "t1"."__pivoted__"."degrees" AS "degrees" FROM ( SELECT - t0.field_of_study, + "t0"."field_of_study", UNNEST( - [{'years': '1970-71', 'degrees': t0."1970-71"}, {'years': '1975-76', 'degrees': t0."1975-76"}, {'years': '1980-81', 'degrees': t0."1980-81"}, {'years': '1985-86', 'degrees': t0."1985-86"}, {'years': '1990-91', 'degrees': t0."1990-91"}, {'years': '1995-96', 'degrees': t0."1995-96"}, {'years': '2000-01', 'degrees': t0."2000-01"}, {'years': '2005-06', 'degrees': t0."2005-06"}, {'years': '2010-11', 'degrees': t0."2010-11"}, {'years': '2011-12', 'degrees': t0."2011-12"}, {'years': '2012-13', 'degrees': t0."2012-13"}, {'years': '2013-14', 'degrees': t0."2013-14"}, {'years': '2014-15', 'degrees': t0."2014-15"}, {'years': '2015-16', 'degrees': t0."2015-16"}, {'years': '2016-17', 'degrees': t0."2016-17"}, {'years': '2017-18', 'degrees': t0."2017-18"}, {'years': '2018-19', 'degrees': t0."2018-19"}, {'years': '2019-20', 'degrees': t0."2019-20"}] - ) AS __pivoted__ - FROM humanities AS t0 - ) AS t1 - ) AS t2 - ) AS t3 - ) AS t4 + [{'years': '1970-71', 'degrees': "t0"."1970-71"}, {'years': '1975-76', 'degrees': "t0"."1975-76"}, {'years': '1980-81', 'degrees': "t0"."1980-81"}, {'years': '1985-86', 'degrees': "t0"."1985-86"}, {'years': '1990-91', 'degrees': "t0"."1990-91"}, {'years': '1995-96', 'degrees': "t0"."1995-96"}, {'years': '2000-01', 'degrees': "t0"."2000-01"}, {'years': '2005-06', 'degrees': "t0"."2005-06"}, {'years': '2010-11', 'degrees': "t0"."2010-11"}, {'years': '2011-12', 'degrees': "t0"."2011-12"}, {'years': '2012-13', 'degrees': "t0"."2012-13"}, {'years': '2013-14', 'degrees': "t0"."2013-14"}, {'years': '2014-15', 'degrees': "t0"."2014-15"}, {'years': '2015-16', 'degrees': "t0"."2015-16"}, {'years': '2016-17', 'degrees': "t0"."2016-17"}, {'years': '2017-18', 'degrees': "t0"."2017-18"}, {'years': '2018-19', 'degrees': "t0"."2018-19"}, {'years': '2019-20', 'degrees': "t0"."2019-20"}] + ) AS "__pivoted__" + FROM "humanities" AS "t0" + ) AS "t1" + ) AS "t2" + ) AS "t3" + ) AS "t4" GROUP BY 1 ) SELECT - t11.field_of_study, - t11.diff + "t11"."field_of_study", + "t11"."diff" FROM ( SELECT - t6.field_of_study, - t6.diff - FROM t5 AS t6 + "t6"."field_of_study", + "t6"."diff" + FROM "t5" AS "t6" ORDER BY - t6.diff DESC + "t6"."diff" DESC LIMIT 10 UNION ALL SELECT - t6.field_of_study, - t6.diff - FROM t5 AS t6 + "t6"."field_of_study", + "t6"."diff" + FROM "t5" AS "t6" WHERE - t6.diff < CAST(0 AS TINYINT) + "t6"."diff" < CAST(0 AS TINYINT) ORDER BY - t6.diff ASC + "t6"."diff" ASC LIMIT 10 -) AS t11 \ No newline at end of file +) AS "t11" \ No newline at end of file diff --git a/ibis/backends/tests/snapshots/test_temporal/test_temporal_literal_sql/bigquery-date/out.sql b/ibis/backends/tests/snapshots/test_temporal/test_temporal_literal_sql/bigquery-date/out.sql index 9fac0141f2b3..81b7f00cff51 100644 --- a/ibis/backends/tests/snapshots/test_temporal/test_temporal_literal_sql/bigquery-date/out.sql +++ b/ibis/backends/tests/snapshots/test_temporal/test_temporal_literal_sql/bigquery-date/out.sql @@ -1,2 +1,2 @@ SELECT - CAST('2023-04-07' AS DATE) AS `datetime_date_2023_ 4_ 7` \ No newline at end of file + DATE(2023, 4, 7) AS `datetime_date_2023_ 4_ 7` \ No newline at end of file diff --git a/ibis/backends/tests/snapshots/test_temporal/test_temporal_literal_sql/bigquery-timestamp/out.sql b/ibis/backends/tests/snapshots/test_temporal/test_temporal_literal_sql/bigquery-timestamp/out.sql index 16d7e15ea1c2..2dc7b53b2103 100644 --- a/ibis/backends/tests/snapshots/test_temporal/test_temporal_literal_sql/bigquery-timestamp/out.sql +++ b/ibis/backends/tests/snapshots/test_temporal/test_temporal_literal_sql/bigquery-timestamp/out.sql @@ -1,2 +1,2 @@ SELECT - CAST('2023-04-07 04:05:06.230136' AS DATETIME) AS `datetime_datetime_2023_ 4_ 7_ 4_ 5_ 6_ 230136` \ No newline at end of file + datetime('2023-04-07T04:05:06.230136') AS `datetime_datetime_2023_ 4_ 7_ 4_ 5_ 6_ 230136` \ No newline at end of file diff --git a/ibis/backends/tests/snapshots/test_temporal/test_temporal_literal_sql/clickhouse-timestamp/out.sql b/ibis/backends/tests/snapshots/test_temporal/test_temporal_literal_sql/clickhouse-timestamp/out.sql index 4a134cb9473a..e5586cf6d91f 100644 --- a/ibis/backends/tests/snapshots/test_temporal/test_temporal_literal_sql/clickhouse-timestamp/out.sql +++ b/ibis/backends/tests/snapshots/test_temporal/test_temporal_literal_sql/clickhouse-timestamp/out.sql @@ -1,2 +1,2 @@ SELECT - toDateTime64('2023-04-07T04:05:06.230136', 6) AS "datetime.datetime(2023, 4, 7, 4, 5, 6, 230136)" \ No newline at end of file + parseDateTime64BestEffort('2023-04-07T04:05:06.230136', 6) AS "datetime.datetime(2023, 4, 7, 4, 5, 6, 230136)" \ No newline at end of file diff --git a/ibis/backends/tests/snapshots/test_temporal/test_temporal_literal_sql/datafusion-date/out.sql b/ibis/backends/tests/snapshots/test_temporal/test_temporal_literal_sql/datafusion-date/out.sql new file mode 100644 index 000000000000..917dd77ad76f --- /dev/null +++ b/ibis/backends/tests/snapshots/test_temporal/test_temporal_literal_sql/datafusion-date/out.sql @@ -0,0 +1,2 @@ +SELECT + DATE_TRUNC('DAY', '2023-04-07') AS "datetime.date(2023, 4, 7)" \ No newline at end of file diff --git a/ibis/backends/tests/snapshots/test_temporal/test_temporal_literal_sql/datafusion-timestamp/out.sql b/ibis/backends/tests/snapshots/test_temporal/test_temporal_literal_sql/datafusion-timestamp/out.sql new file mode 100644 index 000000000000..42e6d3e8cc94 --- /dev/null +++ b/ibis/backends/tests/snapshots/test_temporal/test_temporal_literal_sql/datafusion-timestamp/out.sql @@ -0,0 +1,2 @@ +SELECT + ARROW_CAST('2023-04-07 04:05:06.230136', 'Timestamp(Microsecond, None)') AS "datetime.datetime(2023, 4, 7, 4, 5, 6, 230136)" \ No newline at end of file diff --git a/ibis/backends/tests/snapshots/test_temporal/test_temporal_literal_sql/druid-date/out.sql b/ibis/backends/tests/snapshots/test_temporal/test_temporal_literal_sql/druid-date/out.sql new file mode 100644 index 000000000000..7dd4e139e3fd --- /dev/null +++ b/ibis/backends/tests/snapshots/test_temporal/test_temporal_literal_sql/druid-date/out.sql @@ -0,0 +1,2 @@ +SELECT + DATE_FROM_PARTS(2023, 4, 7) AS "datetime.date(2023, 4, 7)" \ No newline at end of file diff --git a/ibis/backends/tests/snapshots/test_temporal/test_temporal_literal_sql/druid-timestamp/out.sql b/ibis/backends/tests/snapshots/test_temporal/test_temporal_literal_sql/druid-timestamp/out.sql new file mode 100644 index 000000000000..3add9bb0ad1c --- /dev/null +++ b/ibis/backends/tests/snapshots/test_temporal/test_temporal_literal_sql/druid-timestamp/out.sql @@ -0,0 +1,2 @@ +SELECT + CAST('2023-04-07T04:05:06.230136' AS TIMESTAMP) AS "datetime.datetime(2023, 4, 7, 4, 5, 6, 230136)" \ No newline at end of file diff --git a/ibis/backends/tests/snapshots/test_temporal/test_temporal_literal_sql/duckdb-timestamp/out.sql b/ibis/backends/tests/snapshots/test_temporal/test_temporal_literal_sql/duckdb-timestamp/out.sql index 3add9bb0ad1c..3e36a03d4c62 100644 --- a/ibis/backends/tests/snapshots/test_temporal/test_temporal_literal_sql/duckdb-timestamp/out.sql +++ b/ibis/backends/tests/snapshots/test_temporal/test_temporal_literal_sql/duckdb-timestamp/out.sql @@ -1,2 +1,2 @@ SELECT - CAST('2023-04-07T04:05:06.230136' AS TIMESTAMP) AS "datetime.datetime(2023, 4, 7, 4, 5, 6, 230136)" \ No newline at end of file + MAKE_TIMESTAMP(2023, 4, 7, 4, 5, 6.230136) AS "datetime.datetime(2023, 4, 7, 4, 5, 6, 230136)" \ No newline at end of file diff --git a/ibis/backends/tests/snapshots/test_temporal/test_temporal_literal_sql/exasol-date/out.sql b/ibis/backends/tests/snapshots/test_temporal/test_temporal_literal_sql/exasol-date/out.sql new file mode 100644 index 000000000000..fd66b4fee3cb --- /dev/null +++ b/ibis/backends/tests/snapshots/test_temporal/test_temporal_literal_sql/exasol-date/out.sql @@ -0,0 +1,2 @@ +SELECT + CAST('2023-04-07' AS DATE) AS "datetime_date(2023, 4, 7)" \ No newline at end of file diff --git a/ibis/backends/tests/snapshots/test_temporal/test_temporal_literal_sql/exasol-timestamp/out.sql b/ibis/backends/tests/snapshots/test_temporal/test_temporal_literal_sql/exasol-timestamp/out.sql new file mode 100644 index 000000000000..6e447fb277d7 --- /dev/null +++ b/ibis/backends/tests/snapshots/test_temporal/test_temporal_literal_sql/exasol-timestamp/out.sql @@ -0,0 +1,2 @@ +SELECT + CAST('2023-04-07 04:05:06.230' AS TIMESTAMP) AS "datetime_datetime(2023, 4, 7, 4, 5, 6, 230136)" \ No newline at end of file diff --git a/ibis/backends/tests/snapshots/test_temporal/test_temporal_literal_sql/mssql-date/out.sql b/ibis/backends/tests/snapshots/test_temporal/test_temporal_literal_sql/mssql-date/out.sql index 4636132576f6..184d125e696e 100644 --- a/ibis/backends/tests/snapshots/test_temporal/test_temporal_literal_sql/mssql-date/out.sql +++ b/ibis/backends/tests/snapshots/test_temporal/test_temporal_literal_sql/mssql-date/out.sql @@ -1,2 +1,2 @@ SELECT - DATEFROMPARTS(2023, 4, 7) AS "datetime.date(2023, 4, 7)" \ No newline at end of file + DATEFROMPARTS(2023, 4, 7) AS [datetime.date(2023, 4, 7)] \ No newline at end of file diff --git a/ibis/backends/tests/snapshots/test_temporal/test_temporal_literal_sql/mssql-timestamp/out.sql b/ibis/backends/tests/snapshots/test_temporal/test_temporal_literal_sql/mssql-timestamp/out.sql index e2fe11d84ee9..384bef1d80fb 100644 --- a/ibis/backends/tests/snapshots/test_temporal/test_temporal_literal_sql/mssql-timestamp/out.sql +++ b/ibis/backends/tests/snapshots/test_temporal/test_temporal_literal_sql/mssql-timestamp/out.sql @@ -1,2 +1,2 @@ SELECT - DATETIME2FROMPARTS(2023, 4, 7, 4, 5, 6, 230136, 6) AS "datetime.datetime(2023, 4, 7, 4, 5, 6, 230136)" \ No newline at end of file + DATETIME2FROMPARTS(2023, 4, 7, 4, 5, 6, 230136, 6) AS [datetime.datetime(2023, 4, 7, 4, 5, 6, 230136)] \ No newline at end of file diff --git a/ibis/backends/tests/snapshots/test_temporal/test_temporal_literal_sql/oracle-date/out.sql b/ibis/backends/tests/snapshots/test_temporal/test_temporal_literal_sql/oracle-date/out.sql index 73b72c7b2ab9..c2b4de850a75 100644 --- a/ibis/backends/tests/snapshots/test_temporal/test_temporal_literal_sql/oracle-date/out.sql +++ b/ibis/backends/tests/snapshots/test_temporal/test_temporal_literal_sql/oracle-date/out.sql @@ -1,3 +1,2 @@ SELECT - TO_DATE('2023-04-07', 'FXYYYY-MM-DD') AS "datetime.date(2023, 4, 7)" -FROM DUAL \ No newline at end of file + TO_DATE('2023-04-07', 'FXYYYY-MM-DD') AS "datetime.date(2023, 4, 7)" \ No newline at end of file diff --git a/ibis/backends/tests/snapshots/test_temporal/test_temporal_literal_sql/oracle-timestamp/out.sql b/ibis/backends/tests/snapshots/test_temporal/test_temporal_literal_sql/oracle-timestamp/out.sql index 4459c360b49e..891de4604dc9 100644 --- a/ibis/backends/tests/snapshots/test_temporal/test_temporal_literal_sql/oracle-timestamp/out.sql +++ b/ibis/backends/tests/snapshots/test_temporal/test_temporal_literal_sql/oracle-timestamp/out.sql @@ -1,3 +1,2 @@ SELECT - TO_TIMESTAMP('2023-04-07,04:05:06.230136', 'FXYYYY-MM-DD,HH24:MI:SS.FF6') AS "datetime.datetime(2023, 4, 7, 4, 5, 6, 230136)" -FROM DUAL \ No newline at end of file + TO_TIMESTAMP('2023-04-07T04:05:06.230136', 'YYYY-MM-DD"T"HH24:MI:SS.FF6') AS "datetime.datetime(2023, 4, 7, 4, 5, 6, 230136)" \ No newline at end of file diff --git a/ibis/backends/tests/snapshots/test_temporal/test_time_literal_sql/0-bigquery/out.sql b/ibis/backends/tests/snapshots/test_temporal/test_time_literal_sql/0-bigquery/out.sql index 917b7bb475f4..22a61be84c29 100644 --- a/ibis/backends/tests/snapshots/test_temporal/test_time_literal_sql/0-bigquery/out.sql +++ b/ibis/backends/tests/snapshots/test_temporal/test_time_literal_sql/0-bigquery/out.sql @@ -1,2 +1,2 @@ SELECT - CAST('04:05:06' AS TIME) AS `datetime_time_4_ 5_ 6` \ No newline at end of file + TIME(4, 5, 6) AS `datetime_time_4_ 5_ 6` \ No newline at end of file diff --git a/ibis/backends/tests/snapshots/test_temporal/test_time_literal_sql/0-clickhouse/out.sql b/ibis/backends/tests/snapshots/test_temporal/test_time_literal_sql/0-clickhouse/out.sql new file mode 100644 index 000000000000..2b9d3ef5da1e --- /dev/null +++ b/ibis/backends/tests/snapshots/test_temporal/test_time_literal_sql/0-clickhouse/out.sql @@ -0,0 +1,2 @@ +SELECT + CAST('04:05:06' AS Nullable(TIME)) AS "datetime.time(4, 5, 6)" \ No newline at end of file diff --git a/ibis/backends/tests/snapshots/test_temporal/test_time_literal_sql/0-datafusion/out.sql b/ibis/backends/tests/snapshots/test_temporal/test_time_literal_sql/0-datafusion/out.sql new file mode 100644 index 000000000000..eaa35ee21d81 --- /dev/null +++ b/ibis/backends/tests/snapshots/test_temporal/test_time_literal_sql/0-datafusion/out.sql @@ -0,0 +1,2 @@ +SELECT + CAST('04:05:06' AS TIME) AS "datetime.time(4, 5, 6)" \ No newline at end of file diff --git a/ibis/backends/tests/snapshots/test_temporal/test_time_literal_sql/0-druid/out.sql b/ibis/backends/tests/snapshots/test_temporal/test_time_literal_sql/0-druid/out.sql new file mode 100644 index 000000000000..eaa35ee21d81 --- /dev/null +++ b/ibis/backends/tests/snapshots/test_temporal/test_time_literal_sql/0-druid/out.sql @@ -0,0 +1,2 @@ +SELECT + CAST('04:05:06' AS TIME) AS "datetime.time(4, 5, 6)" \ No newline at end of file diff --git a/ibis/backends/tests/snapshots/test_temporal/test_time_literal_sql/0-exasol/out.sql b/ibis/backends/tests/snapshots/test_temporal/test_time_literal_sql/0-exasol/out.sql new file mode 100644 index 000000000000..38076fc94a2f --- /dev/null +++ b/ibis/backends/tests/snapshots/test_temporal/test_time_literal_sql/0-exasol/out.sql @@ -0,0 +1,2 @@ +SELECT + CAST('04:05:06' AS TIME) AS "datetime_time(4, 5, 6)" \ No newline at end of file diff --git a/ibis/backends/tests/snapshots/test_temporal/test_time_literal_sql/0-impala/out.sql b/ibis/backends/tests/snapshots/test_temporal/test_time_literal_sql/0-impala/out.sql new file mode 100644 index 000000000000..379517f88186 --- /dev/null +++ b/ibis/backends/tests/snapshots/test_temporal/test_time_literal_sql/0-impala/out.sql @@ -0,0 +1,2 @@ +SELECT + CAST('04:05:06' AS TIMESTAMP) AS `datetime.time(4, 5, 6)` \ No newline at end of file diff --git a/ibis/backends/tests/snapshots/test_temporal/test_time_literal_sql/0-mssql/out.sql b/ibis/backends/tests/snapshots/test_temporal/test_time_literal_sql/0-mssql/out.sql index 1081342a8f7b..0010d9f01874 100644 --- a/ibis/backends/tests/snapshots/test_temporal/test_time_literal_sql/0-mssql/out.sql +++ b/ibis/backends/tests/snapshots/test_temporal/test_time_literal_sql/0-mssql/out.sql @@ -1,2 +1,2 @@ SELECT - TIMEFROMPARTS(4, 5, 6, 0, 0) AS "datetime.time(4, 5, 6)" \ No newline at end of file + TIMEFROMPARTS(4, 5, 6, 0, 0) AS [datetime.time(4, 5, 6)] \ No newline at end of file diff --git a/ibis/backends/tests/snapshots/test_temporal/test_time_literal_sql/0-oracle/out.sql b/ibis/backends/tests/snapshots/test_temporal/test_time_literal_sql/0-oracle/out.sql new file mode 100644 index 000000000000..f3d6c27bf4c6 --- /dev/null +++ b/ibis/backends/tests/snapshots/test_temporal/test_time_literal_sql/0-oracle/out.sql @@ -0,0 +1,2 @@ +SELECT + TO_TIMESTAMP('04:05:06', 'YYYY-MM-DD"T"HH24:MI:SS.FF6') AS "datetime.time(4, 5, 6)" \ No newline at end of file diff --git a/ibis/backends/tests/snapshots/test_temporal/test_time_literal_sql/0-postgres/out.sql b/ibis/backends/tests/snapshots/test_temporal/test_time_literal_sql/0-postgres/out.sql index fab689db2dde..47d684023da8 100644 --- a/ibis/backends/tests/snapshots/test_temporal/test_time_literal_sql/0-postgres/out.sql +++ b/ibis/backends/tests/snapshots/test_temporal/test_time_literal_sql/0-postgres/out.sql @@ -1,2 +1,2 @@ SELECT - MAKE_TIME(4, 5, 6.0) AS "datetime.time(4, 5, 6)" \ No newline at end of file + MAKE_TIME(CAST(4 AS INT), CAST(5 AS INT), CAST(6.0 AS DOUBLE PRECISION)) AS "datetime.time(4, 5, 6)" \ No newline at end of file diff --git a/ibis/backends/tests/snapshots/test_temporal/test_time_literal_sql/0-sqlite/out.sql b/ibis/backends/tests/snapshots/test_temporal/test_time_literal_sql/0-sqlite/out.sql index 399b76c6254d..0a95157910a6 100644 --- a/ibis/backends/tests/snapshots/test_temporal/test_time_literal_sql/0-sqlite/out.sql +++ b/ibis/backends/tests/snapshots/test_temporal/test_time_literal_sql/0-sqlite/out.sql @@ -1,2 +1,2 @@ SELECT - '04:05:06.000000' AS "datetime.time(4, 5, 6)" \ No newline at end of file + '04:05:06' AS "datetime.time(4, 5, 6)" \ No newline at end of file diff --git a/ibis/backends/tests/snapshots/test_temporal/test_time_literal_sql/234567-bigquery/out.sql b/ibis/backends/tests/snapshots/test_temporal/test_time_literal_sql/234567-bigquery/out.sql index bad9e484fcb9..e94cc480ee9c 100644 --- a/ibis/backends/tests/snapshots/test_temporal/test_time_literal_sql/234567-bigquery/out.sql +++ b/ibis/backends/tests/snapshots/test_temporal/test_time_literal_sql/234567-bigquery/out.sql @@ -1,2 +1,2 @@ SELECT - CAST('04:05:06.234567' AS TIME) AS `datetime_time_4_ 5_ 6_ 234567` \ No newline at end of file + TIME(4, 5, 6) AS `datetime_time_4_ 5_ 6_ 234567` \ No newline at end of file diff --git a/ibis/backends/tests/snapshots/test_temporal/test_time_literal_sql/234567-clickhouse/out.sql b/ibis/backends/tests/snapshots/test_temporal/test_time_literal_sql/234567-clickhouse/out.sql new file mode 100644 index 000000000000..41473b7fd96b --- /dev/null +++ b/ibis/backends/tests/snapshots/test_temporal/test_time_literal_sql/234567-clickhouse/out.sql @@ -0,0 +1,2 @@ +SELECT + CAST('04:05:06.234567' AS Nullable(TIME)) AS "datetime.time(4, 5, 6, 234567)" \ No newline at end of file diff --git a/ibis/backends/tests/snapshots/test_temporal/test_time_literal_sql/234567-datafusion/out.sql b/ibis/backends/tests/snapshots/test_temporal/test_time_literal_sql/234567-datafusion/out.sql new file mode 100644 index 000000000000..af024e962bf1 --- /dev/null +++ b/ibis/backends/tests/snapshots/test_temporal/test_time_literal_sql/234567-datafusion/out.sql @@ -0,0 +1,2 @@ +SELECT + CAST('04:05:06.234567' AS TIME) AS "datetime.time(4, 5, 6, 234567)" \ No newline at end of file diff --git a/ibis/backends/tests/snapshots/test_temporal/test_time_literal_sql/234567-druid/out.sql b/ibis/backends/tests/snapshots/test_temporal/test_time_literal_sql/234567-druid/out.sql new file mode 100644 index 000000000000..af024e962bf1 --- /dev/null +++ b/ibis/backends/tests/snapshots/test_temporal/test_time_literal_sql/234567-druid/out.sql @@ -0,0 +1,2 @@ +SELECT + CAST('04:05:06.234567' AS TIME) AS "datetime.time(4, 5, 6, 234567)" \ No newline at end of file diff --git a/ibis/backends/tests/snapshots/test_temporal/test_time_literal_sql/234567-exasol/out.sql b/ibis/backends/tests/snapshots/test_temporal/test_time_literal_sql/234567-exasol/out.sql new file mode 100644 index 000000000000..5e300b8ade04 --- /dev/null +++ b/ibis/backends/tests/snapshots/test_temporal/test_time_literal_sql/234567-exasol/out.sql @@ -0,0 +1,2 @@ +SELECT + CAST('04:05:06.234567' AS TIME) AS "datetime_time(4, 5, 6, 234567)" \ No newline at end of file diff --git a/ibis/backends/tests/snapshots/test_temporal/test_time_literal_sql/234567-impala/out.sql b/ibis/backends/tests/snapshots/test_temporal/test_time_literal_sql/234567-impala/out.sql new file mode 100644 index 000000000000..e216ee9a485f --- /dev/null +++ b/ibis/backends/tests/snapshots/test_temporal/test_time_literal_sql/234567-impala/out.sql @@ -0,0 +1,2 @@ +SELECT + CAST('04:05:06.234567' AS TIMESTAMP) AS `datetime.time(4, 5, 6, 234567)` \ No newline at end of file diff --git a/ibis/backends/tests/snapshots/test_temporal/test_time_literal_sql/234567-mssql/out.sql b/ibis/backends/tests/snapshots/test_temporal/test_time_literal_sql/234567-mssql/out.sql index bd1d495137b7..819cd2c669bd 100644 --- a/ibis/backends/tests/snapshots/test_temporal/test_time_literal_sql/234567-mssql/out.sql +++ b/ibis/backends/tests/snapshots/test_temporal/test_time_literal_sql/234567-mssql/out.sql @@ -1,2 +1,2 @@ SELECT - TIMEFROMPARTS(4, 5, 6, 234567, 0) AS "datetime.time(4, 5, 6, 234567)" \ No newline at end of file + TIMEFROMPARTS(4, 5, 6, 0, 0) AS [datetime.time(4, 5, 6, 234567)] \ No newline at end of file diff --git a/ibis/backends/tests/snapshots/test_temporal/test_time_literal_sql/234567-oracle/out.sql b/ibis/backends/tests/snapshots/test_temporal/test_time_literal_sql/234567-oracle/out.sql new file mode 100644 index 000000000000..5af4117fd8e1 --- /dev/null +++ b/ibis/backends/tests/snapshots/test_temporal/test_time_literal_sql/234567-oracle/out.sql @@ -0,0 +1,2 @@ +SELECT + TO_TIMESTAMP('04:05:06.234567', 'YYYY-MM-DD"T"HH24:MI:SS.FF6') AS "datetime.time(4, 5, 6, 234567)" \ No newline at end of file diff --git a/ibis/backends/tests/snapshots/test_temporal/test_time_literal_sql/234567-postgres/out.sql b/ibis/backends/tests/snapshots/test_temporal/test_time_literal_sql/234567-postgres/out.sql index ac6ca0601526..1302de8ffaff 100644 --- a/ibis/backends/tests/snapshots/test_temporal/test_time_literal_sql/234567-postgres/out.sql +++ b/ibis/backends/tests/snapshots/test_temporal/test_time_literal_sql/234567-postgres/out.sql @@ -1,2 +1,2 @@ SELECT - MAKE_TIME(4, 5, 6.234567) AS "datetime.time(4, 5, 6, 234567)" \ No newline at end of file + MAKE_TIME(CAST(4 AS INT), CAST(5 AS INT), CAST(6.234567 AS DOUBLE PRECISION)) AS "datetime.time(4, 5, 6, 234567)" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_compiler/test_agg_and_non_agg_filter/out.sql b/ibis/backends/tests/sql/snapshots/test_compiler/test_agg_and_non_agg_filter/out.sql index 4a8b9ef4cb44..c7745e622b92 100644 --- a/ibis/backends/tests/sql/snapshots/test_compiler/test_agg_and_non_agg_filter/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_compiler/test_agg_and_non_agg_filter/out.sql @@ -1,19 +1,19 @@ SELECT - t0.a, - t0.b -FROM my_table AS t0 + "t0"."a", + "t0"."b" +FROM "my_table" AS "t0" WHERE - t0.a < CAST(100 AS TINYINT) - AND t0.a = ( + "t0"."a" < CAST(100 AS TINYINT) + AND "t0"."a" = ( SELECT - MAX(t1.a) AS "Max(a)" + MAX("t1"."a") AS "Max(a)" FROM ( SELECT - t0.a, - t0.b - FROM my_table AS t0 + "t0"."a", + "t0"."b" + FROM "my_table" AS "t0" WHERE - t0.a < CAST(100 AS TINYINT) - ) AS t1 + "t0"."a" < CAST(100 AS TINYINT) + ) AS "t1" ) - AND t0.b = 'a' \ No newline at end of file + AND "t0"."b" = 'a' \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_compiler/test_agg_filter/out.sql b/ibis/backends/tests/sql/snapshots/test_compiler/test_agg_filter/out.sql index 37c5668f835b..6ccba780d897 100644 --- a/ibis/backends/tests/sql/snapshots/test_compiler/test_agg_filter/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_compiler/test_agg_filter/out.sql @@ -1,18 +1,18 @@ SELECT - t0.a, - t0.b * CAST(2 AS TINYINT) AS b2 -FROM my_table AS t0 + "t0"."a", + "t0"."b" * CAST(2 AS TINYINT) AS "b2" +FROM "my_table" AS "t0" WHERE - t0.a < CAST(100 AS TINYINT) - AND t0.a = ( + "t0"."a" < CAST(100 AS TINYINT) + AND "t0"."a" = ( SELECT - MAX(t1.a) AS "Max(a)" + MAX("t1"."a") AS "Max(a)" FROM ( SELECT - t0.a, - t0.b * CAST(2 AS TINYINT) AS b2 - FROM my_table AS t0 + "t0"."a", + "t0"."b" * CAST(2 AS TINYINT) AS "b2" + FROM "my_table" AS "t0" WHERE - t0.a < CAST(100 AS TINYINT) - ) AS t1 + "t0"."a" < CAST(100 AS TINYINT) + ) AS "t1" ) \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_compiler/test_agg_filter_with_alias/out.sql b/ibis/backends/tests/sql/snapshots/test_compiler/test_agg_filter_with_alias/out.sql index 37c5668f835b..6ccba780d897 100644 --- a/ibis/backends/tests/sql/snapshots/test_compiler/test_agg_filter_with_alias/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_compiler/test_agg_filter_with_alias/out.sql @@ -1,18 +1,18 @@ SELECT - t0.a, - t0.b * CAST(2 AS TINYINT) AS b2 -FROM my_table AS t0 + "t0"."a", + "t0"."b" * CAST(2 AS TINYINT) AS "b2" +FROM "my_table" AS "t0" WHERE - t0.a < CAST(100 AS TINYINT) - AND t0.a = ( + "t0"."a" < CAST(100 AS TINYINT) + AND "t0"."a" = ( SELECT - MAX(t1.a) AS "Max(a)" + MAX("t1"."a") AS "Max(a)" FROM ( SELECT - t0.a, - t0.b * CAST(2 AS TINYINT) AS b2 - FROM my_table AS t0 + "t0"."a", + "t0"."b" * CAST(2 AS TINYINT) AS "b2" + FROM "my_table" AS "t0" WHERE - t0.a < CAST(100 AS TINYINT) - ) AS t1 + "t0"."a" < CAST(100 AS TINYINT) + ) AS "t1" ) \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_compiler/test_column_distinct/out.sql b/ibis/backends/tests/sql/snapshots/test_compiler/test_column_distinct/out.sql index d38aa10366c4..0913c0727447 100644 --- a/ibis/backends/tests/sql/snapshots/test_compiler/test_column_distinct/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_compiler/test_column_distinct/out.sql @@ -2,6 +2,6 @@ SELECT DISTINCT * FROM ( SELECT - t0.string_col - FROM functional_alltypes AS t0 -) AS t1 \ No newline at end of file + "t0"."string_col" + FROM "functional_alltypes" AS "t0" +) AS "t1" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_compiler/test_column_expr_default_name/out.sql b/ibis/backends/tests/sql/snapshots/test_compiler/test_column_expr_default_name/out.sql index 1e1635a607bf..2e86d41c48ea 100644 --- a/ibis/backends/tests/sql/snapshots/test_compiler/test_column_expr_default_name/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_compiler/test_column_expr_default_name/out.sql @@ -1,3 +1,3 @@ SELECT - t0.int_col + CAST(4 AS TINYINT) AS "Add(int_col, 4)" -FROM int_col_table AS t0 \ No newline at end of file + "t0"."int_col" + CAST(4 AS TINYINT) AS "Add(int_col, 4)" +FROM "int_col_table" AS "t0" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_compiler/test_column_expr_retains_name/out.sql b/ibis/backends/tests/sql/snapshots/test_compiler/test_column_expr_retains_name/out.sql index 0237f96353c1..26c4292ded48 100644 --- a/ibis/backends/tests/sql/snapshots/test_compiler/test_column_expr_retains_name/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_compiler/test_column_expr_retains_name/out.sql @@ -1,3 +1,3 @@ SELECT - t0.int_col + CAST(4 AS TINYINT) AS foo -FROM int_col_table AS t0 \ No newline at end of file + "t0"."int_col" + CAST(4 AS TINYINT) AS "foo" +FROM "int_col_table" AS "t0" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_compiler/test_count_distinct/out.sql b/ibis/backends/tests/sql/snapshots/test_compiler/test_count_distinct/out.sql index 1203afe54f42..d7306679c60a 100644 --- a/ibis/backends/tests/sql/snapshots/test_compiler/test_count_distinct/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_compiler/test_count_distinct/out.sql @@ -1,24 +1,24 @@ SELECT - t1.string_col, - COUNT(DISTINCT t1.int_col) AS nunique + "t1"."string_col", + COUNT(DISTINCT "t1"."int_col") AS "nunique" FROM ( SELECT - t0.id, - t0.bool_col, - t0.tinyint_col, - t0.smallint_col, - t0.int_col, - t0.bigint_col, - t0.float_col, - t0.double_col, - t0.date_string_col, - t0.string_col, - t0.timestamp_col, - t0.year, - t0.month - FROM functional_alltypes AS t0 + "t0"."id", + "t0"."bool_col", + "t0"."tinyint_col", + "t0"."smallint_col", + "t0"."int_col", + "t0"."bigint_col", + "t0"."float_col", + "t0"."double_col", + "t0"."date_string_col", + "t0"."string_col", + "t0"."timestamp_col", + "t0"."year", + "t0"."month" + FROM "functional_alltypes" AS "t0" WHERE - t0.bigint_col > CAST(0 AS TINYINT) -) AS t1 + "t0"."bigint_col" > CAST(0 AS TINYINT) +) AS "t1" GROUP BY 1 \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_compiler/test_difference_project_column/out.sql b/ibis/backends/tests/sql/snapshots/test_compiler/test_difference_project_column/out.sql index 65eba6a3a4c8..a3eb8d979926 100644 --- a/ibis/backends/tests/sql/snapshots/test_compiler/test_difference_project_column/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_compiler/test_difference_project_column/out.sql @@ -1,17 +1,17 @@ SELECT - t3.key + "t3"."key" FROM ( SELECT - t0.string_col AS key, - CAST(t0.float_col AS DOUBLE) AS value - FROM functional_alltypes AS t0 + "t0"."string_col" AS "key", + CAST("t0"."float_col" AS DOUBLE) AS "value" + FROM "functional_alltypes" AS "t0" WHERE - t0.int_col > CAST(0 AS TINYINT) + "t0"."int_col" > CAST(0 AS TINYINT) EXCEPT SELECT - t0.string_col AS key, - t0.double_col AS value - FROM functional_alltypes AS t0 + "t0"."string_col" AS "key", + "t0"."double_col" AS "value" + FROM "functional_alltypes" AS "t0" WHERE - t0.int_col <= CAST(0 AS TINYINT) -) AS t3 \ No newline at end of file + "t0"."int_col" <= CAST(0 AS TINYINT) +) AS "t3" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_compiler/test_having_from_filter/out.sql b/ibis/backends/tests/sql/snapshots/test_compiler/test_having_from_filter/out.sql index 0043337a96ee..99aff4bed43c 100644 --- a/ibis/backends/tests/sql/snapshots/test_compiler/test_having_from_filter/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_compiler/test_having_from_filter/out.sql @@ -1,21 +1,21 @@ SELECT - t2.b, - t2.sum + "t2"."b", + "t2"."sum" FROM ( SELECT - t1.b, - SUM(t1.a) AS sum, - MAX(t1.a) AS "Max(a)" + "t1"."b", + SUM("t1"."a") AS "sum", + MAX("t1"."a") AS "Max(a)" FROM ( SELECT - t0.a, - t0.b - FROM t AS t0 + "t0"."a", + "t0"."b" + FROM "t" AS "t0" WHERE - t0.b = 'm' - ) AS t1 + "t0"."b" = 'm' + ) AS "t1" GROUP BY 1 -) AS t2 +) AS "t2" WHERE - t2."Max(a)" = CAST(2 AS TINYINT) \ No newline at end of file + "t2"."Max(a)" = CAST(2 AS TINYINT) \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_compiler/test_having_size/out.sql b/ibis/backends/tests/sql/snapshots/test_compiler/test_having_size/out.sql index 6691834ce1b5..80fa982abf7a 100644 --- a/ibis/backends/tests/sql/snapshots/test_compiler/test_having_size/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_compiler/test_having_size/out.sql @@ -1,14 +1,14 @@ SELECT - t1.string_col, - t1."CountStar()" + "t1"."string_col", + "t1"."CountStar()" FROM ( SELECT - t0.string_col, + "t0"."string_col", COUNT(*) AS "CountStar()", - MAX(t0.double_col) AS "Max(double_col)" - FROM functional_alltypes AS t0 + MAX("t0"."double_col") AS "Max(double_col)" + FROM "functional_alltypes" AS "t0" GROUP BY 1 -) AS t1 +) AS "t1" WHERE - t1."Max(double_col)" = CAST(1 AS TINYINT) \ No newline at end of file + "t1"."Max(double_col)" = CAST(1 AS TINYINT) \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_compiler/test_intersect_project_column/out.sql b/ibis/backends/tests/sql/snapshots/test_compiler/test_intersect_project_column/out.sql index 7c3cbc2fdf12..f9f8dec98698 100644 --- a/ibis/backends/tests/sql/snapshots/test_compiler/test_intersect_project_column/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_compiler/test_intersect_project_column/out.sql @@ -1,17 +1,17 @@ SELECT - t3.key + "t3"."key" FROM ( SELECT - t0.string_col AS key, - CAST(t0.float_col AS DOUBLE) AS value - FROM functional_alltypes AS t0 + "t0"."string_col" AS "key", + CAST("t0"."float_col" AS DOUBLE) AS "value" + FROM "functional_alltypes" AS "t0" WHERE - t0.int_col > CAST(0 AS TINYINT) + "t0"."int_col" > CAST(0 AS TINYINT) INTERSECT SELECT - t0.string_col AS key, - t0.double_col AS value - FROM functional_alltypes AS t0 + "t0"."string_col" AS "key", + "t0"."double_col" AS "value" + FROM "functional_alltypes" AS "t0" WHERE - t0.int_col <= CAST(0 AS TINYINT) -) AS t3 \ No newline at end of file + "t0"."int_col" <= CAST(0 AS TINYINT) +) AS "t3" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_compiler/test_multiple_count_distinct/out.sql b/ibis/backends/tests/sql/snapshots/test_compiler/test_multiple_count_distinct/out.sql index cbb6ac1079a3..bc9d9115d855 100644 --- a/ibis/backends/tests/sql/snapshots/test_compiler/test_multiple_count_distinct/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_compiler/test_multiple_count_distinct/out.sql @@ -1,7 +1,7 @@ SELECT - t0.string_col, - COUNT(DISTINCT t0.int_col) AS int_card, - COUNT(DISTINCT t0.smallint_col) AS smallint_card -FROM functional_alltypes AS t0 + "t0"."string_col", + COUNT(DISTINCT "t0"."int_col") AS "int_card", + COUNT(DISTINCT "t0"."smallint_col") AS "smallint_card" +FROM "functional_alltypes" AS "t0" GROUP BY 1 \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_compiler/test_pushdown_with_or/out.sql b/ibis/backends/tests/sql/snapshots/test_compiler/test_pushdown_with_or/out.sql index 45fa51a79cba..cd5a9be3059b 100644 --- a/ibis/backends/tests/sql/snapshots/test_compiler/test_pushdown_with_or/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_compiler/test_pushdown_with_or/out.sql @@ -1,19 +1,19 @@ SELECT - t0.double_col, - t0.string_col, - t0.int_col, - t0.float_col -FROM functional_alltypes AS t0 + "t0"."double_col", + "t0"."string_col", + "t0"."int_col", + "t0"."float_col" +FROM "functional_alltypes" AS "t0" WHERE - t0.double_col > CAST(3.14 AS DOUBLE) - AND CONTAINS(t0.string_col, 'foo') + "t0"."double_col" > CAST(3.14 AS DOUBLE) + AND CONTAINS("t0"."string_col", 'foo') AND ( ( ( - t0.int_col - CAST(1 AS TINYINT) + "t0"."int_col" - CAST(1 AS TINYINT) ) = CAST(0 AS TINYINT) ) OR ( - t0.float_col <= CAST(1.34 AS DOUBLE) + "t0"."float_col" <= CAST(1.34 AS DOUBLE) ) ) \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_compiler/test_simple_agg_filter/out.sql b/ibis/backends/tests/sql/snapshots/test_compiler/test_simple_agg_filter/out.sql index c1410ecdac47..d3733046981b 100644 --- a/ibis/backends/tests/sql/snapshots/test_compiler/test_simple_agg_filter/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_compiler/test_simple_agg_filter/out.sql @@ -1,18 +1,18 @@ SELECT - t0.a, - t0.b -FROM my_table AS t0 + "t0"."a", + "t0"."b" +FROM "my_table" AS "t0" WHERE - t0.a < CAST(100 AS TINYINT) - AND t0.a = ( + "t0"."a" < CAST(100 AS TINYINT) + AND "t0"."a" = ( SELECT - MAX(t1.a) AS "Max(a)" + MAX("t1"."a") AS "Max(a)" FROM ( SELECT - t0.a, - t0.b - FROM my_table AS t0 + "t0"."a", + "t0"."b" + FROM "my_table" AS "t0" WHERE - t0.a < CAST(100 AS TINYINT) - ) AS t1 + "t0"."a" < CAST(100 AS TINYINT) + ) AS "t1" ) \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_compiler/test_subquery_where_location/out.sql b/ibis/backends/tests/sql/snapshots/test_compiler/test_subquery_where_location/out.sql index 7ceaa3d33e79..01918d46ff36 100644 --- a/ibis/backends/tests/sql/snapshots/test_compiler/test_subquery_where_location/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_compiler/test_subquery_where_location/out.sql @@ -1,19 +1,19 @@ SELECT - COUNT(t2.foo) AS "Count(foo)" + COUNT("t2"."foo") AS "Count(foo)" FROM ( SELECT - t1.string_col, - SUM(t1.float_col) AS foo + "t1"."string_col", + SUM("t1"."float_col") AS "foo" FROM ( SELECT - t0.float_col, - t0.timestamp_col, - t0.int_col, - t0.string_col - FROM alltypes AS t0 + "t0"."float_col", + "t0"."timestamp_col", + "t0"."int_col", + "t0"."string_col" + FROM "alltypes" AS "t0" WHERE - t0.timestamp_col < MAKE_TIMESTAMP(2014, 1, 1, 0, 0, 0.0) - ) AS t1 + "t0"."timestamp_col" < MAKE_TIMESTAMP(2014, 1, 1, 0, 0, 0.0) + ) AS "t1" GROUP BY 1 -) AS t2 \ No newline at end of file +) AS "t2" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_compiler/test_table_difference/out.sql b/ibis/backends/tests/sql/snapshots/test_compiler/test_table_difference/out.sql index 4d00f47c36b0..fff41a520ec4 100644 --- a/ibis/backends/tests/sql/snapshots/test_compiler/test_table_difference/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_compiler/test_table_difference/out.sql @@ -1,18 +1,18 @@ SELECT - t3.key, - t3.value + "t3"."key", + "t3"."value" FROM ( SELECT - t0.string_col AS key, - CAST(t0.float_col AS DOUBLE) AS value - FROM functional_alltypes AS t0 + "t0"."string_col" AS "key", + CAST("t0"."float_col" AS DOUBLE) AS "value" + FROM "functional_alltypes" AS "t0" WHERE - t0.int_col > CAST(0 AS TINYINT) + "t0"."int_col" > CAST(0 AS TINYINT) EXCEPT SELECT - t0.string_col AS key, - t0.double_col AS value - FROM functional_alltypes AS t0 + "t0"."string_col" AS "key", + "t0"."double_col" AS "value" + FROM "functional_alltypes" AS "t0" WHERE - t0.int_col <= CAST(0 AS TINYINT) -) AS t3 \ No newline at end of file + "t0"."int_col" <= CAST(0 AS TINYINT) +) AS "t3" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_compiler/test_table_distinct/out.sql b/ibis/backends/tests/sql/snapshots/test_compiler/test_table_distinct/out.sql index 483b4fef6f49..098405dd6f82 100644 --- a/ibis/backends/tests/sql/snapshots/test_compiler/test_table_distinct/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_compiler/test_table_distinct/out.sql @@ -2,7 +2,7 @@ SELECT DISTINCT * FROM ( SELECT - t0.string_col, - t0.int_col - FROM functional_alltypes AS t0 -) AS t1 \ No newline at end of file + "t0"."string_col", + "t0"."int_col" + FROM "functional_alltypes" AS "t0" +) AS "t1" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_compiler/test_table_drop_with_filter/out.sql b/ibis/backends/tests/sql/snapshots/test_compiler/test_table_drop_with_filter/out.sql index db148ea33a9f..f5ce6636c22b 100644 --- a/ibis/backends/tests/sql/snapshots/test_compiler/test_table_drop_with_filter/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_compiler/test_table_drop_with_filter/out.sql @@ -1,19 +1,19 @@ SELECT - t5.a + "t5"."a" FROM ( SELECT - t4.a + "t4"."a" FROM ( SELECT - t0.a, - t0.b, - MAKE_TIMESTAMP(2018, 1, 1, 0, 0, 0.0) AS the_date - FROM t AS t0 + "t0"."a", + "t0"."b", + MAKE_TIMESTAMP(2018, 1, 1, 0, 0, 0.0) AS "the_date" + FROM "t" AS "t0" WHERE - t0.c = MAKE_TIMESTAMP(2018, 1, 1, 0, 0, 0.0) - ) AS t4 - INNER JOIN s AS t2 - ON t4.b = t2.b -) AS t5 + "t0"."c" = MAKE_TIMESTAMP(2018, 1, 1, 0, 0, 0.0) + ) AS "t4" + INNER JOIN "s" AS "t2" + ON "t4"."b" = "t2"."b" +) AS "t5" WHERE - t5.a < CAST(1.0 AS DOUBLE) \ No newline at end of file + "t5"."a" < CAST(1.0 AS DOUBLE) \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_compiler/test_table_intersect/out.sql b/ibis/backends/tests/sql/snapshots/test_compiler/test_table_intersect/out.sql index 72a05ef24e92..d7b9f61d48dc 100644 --- a/ibis/backends/tests/sql/snapshots/test_compiler/test_table_intersect/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_compiler/test_table_intersect/out.sql @@ -1,18 +1,18 @@ SELECT - t3.key, - t3.value + "t3"."key", + "t3"."value" FROM ( SELECT - t0.string_col AS key, - CAST(t0.float_col AS DOUBLE) AS value - FROM functional_alltypes AS t0 + "t0"."string_col" AS "key", + CAST("t0"."float_col" AS DOUBLE) AS "value" + FROM "functional_alltypes" AS "t0" WHERE - t0.int_col > CAST(0 AS TINYINT) + "t0"."int_col" > CAST(0 AS TINYINT) INTERSECT SELECT - t0.string_col AS key, - t0.double_col AS value - FROM functional_alltypes AS t0 + "t0"."string_col" AS "key", + "t0"."double_col" AS "value" + FROM "functional_alltypes" AS "t0" WHERE - t0.int_col <= CAST(0 AS TINYINT) -) AS t3 \ No newline at end of file + "t0"."int_col" <= CAST(0 AS TINYINT) +) AS "t3" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_compiler/test_union/out.sql b/ibis/backends/tests/sql/snapshots/test_compiler/test_union/out.sql index 0bf62fa423da..cf49db40dbea 100644 --- a/ibis/backends/tests/sql/snapshots/test_compiler/test_union/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_compiler/test_union/out.sql @@ -1,18 +1,18 @@ SELECT - t3.key, - t3.value + "t3"."key", + "t3"."value" FROM ( SELECT - t0.string_col AS key, - CAST(t0.float_col AS DOUBLE) AS value - FROM functional_alltypes AS t0 + "t0"."string_col" AS "key", + CAST("t0"."float_col" AS DOUBLE) AS "value" + FROM "functional_alltypes" AS "t0" WHERE - t0.int_col > CAST(0 AS TINYINT) + "t0"."int_col" > CAST(0 AS TINYINT) UNION SELECT - t0.string_col AS key, - t0.double_col AS value - FROM functional_alltypes AS t0 + "t0"."string_col" AS "key", + "t0"."double_col" AS "value" + FROM "functional_alltypes" AS "t0" WHERE - t0.int_col <= CAST(0 AS TINYINT) -) AS t3 \ No newline at end of file + "t0"."int_col" <= CAST(0 AS TINYINT) +) AS "t3" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_compiler/test_union_order_by/out.sql b/ibis/backends/tests/sql/snapshots/test_compiler/test_union_order_by/out.sql index 2afa8074bb0c..3a8f09ded485 100644 --- a/ibis/backends/tests/sql/snapshots/test_compiler/test_union_order_by/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_compiler/test_union_order_by/out.sql @@ -1,20 +1,20 @@ -WITH t1 AS ( +WITH "t1" AS ( SELECT - t0.a, - t0.b - FROM t AS t0 + "t0"."a", + "t0"."b" + FROM "t" AS "t0" ORDER BY - t0.b ASC + "t0"."b" ASC ) SELECT - t3.a, - t3.b + "t3"."a", + "t3"."b" FROM ( SELECT * - FROM t1 AS t2 + FROM "t1" AS "t2" UNION ALL SELECT * - FROM t1 AS t2 -) AS t3 \ No newline at end of file + FROM "t1" AS "t2" +) AS "t3" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_compiler/test_union_project_column/out.sql b/ibis/backends/tests/sql/snapshots/test_compiler/test_union_project_column/out.sql index b2fb8620109b..b57144bd31c9 100644 --- a/ibis/backends/tests/sql/snapshots/test_compiler/test_union_project_column/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_compiler/test_union_project_column/out.sql @@ -1,17 +1,17 @@ SELECT - t3.key + "t3"."key" FROM ( SELECT - t0.string_col AS key, - CAST(t0.float_col AS DOUBLE) AS value - FROM functional_alltypes AS t0 + "t0"."string_col" AS "key", + CAST("t0"."float_col" AS DOUBLE) AS "value" + FROM "functional_alltypes" AS "t0" WHERE - t0.int_col > CAST(0 AS TINYINT) + "t0"."int_col" > CAST(0 AS TINYINT) UNION ALL SELECT - t0.string_col AS key, - t0.double_col AS value - FROM functional_alltypes AS t0 + "t0"."string_col" AS "key", + "t0"."double_col" AS "value" + FROM "functional_alltypes" AS "t0" WHERE - t0.int_col <= CAST(0 AS TINYINT) -) AS t3 \ No newline at end of file + "t0"."int_col" <= CAST(0 AS TINYINT) +) AS "t3" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_aggregate_count_joined/out.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_aggregate_count_joined/out.sql index 889345c4621d..efe7f2b9b631 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_aggregate_count_joined/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_aggregate_count_joined/out.sql @@ -2,12 +2,12 @@ SELECT COUNT(*) AS "CountStar()" FROM ( SELECT - t3.n_nationkey, - t3.n_name, - t3.n_regionkey, - t3.n_comment, - t2.r_name AS region - FROM tpch_region AS t2 - INNER JOIN tpch_nation AS t3 - ON t2.r_regionkey = t3.n_regionkey -) AS t4 \ No newline at end of file + "t3"."n_nationkey", + "t3"."n_name", + "t3"."n_regionkey", + "t3"."n_comment", + "t2"."r_name" AS "region" + FROM "tpch_region" AS "t2" + INNER JOIN "tpch_nation" AS "t3" + ON "t2"."r_regionkey" = "t3"."n_regionkey" +) AS "t4" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_aggregate_having/explicit.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_aggregate_having/explicit.sql index 47945167c00a..bb81eda40239 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_aggregate_having/explicit.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_aggregate_having/explicit.sql @@ -1,13 +1,13 @@ SELECT - t1.foo_id, - t1.total + "t1"."foo_id", + "t1"."total" FROM ( SELECT - t0.foo_id, - SUM(t0.f) AS total - FROM star1 AS t0 + "t0"."foo_id", + SUM("t0"."f") AS "total" + FROM "star1" AS "t0" GROUP BY 1 -) AS t1 +) AS "t1" WHERE - t1.total > CAST(10 AS TINYINT) \ No newline at end of file + "t1"."total" > CAST(10 AS TINYINT) \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_aggregate_having/inline.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_aggregate_having/inline.sql index 35e4fe0adc24..65116af02a75 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_aggregate_having/inline.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_aggregate_having/inline.sql @@ -1,14 +1,14 @@ SELECT - t1.foo_id, - t1.total + "t1"."foo_id", + "t1"."total" FROM ( SELECT - t0.foo_id, - SUM(t0.f) AS total, + "t0"."foo_id", + SUM("t0"."f") AS "total", COUNT(*) AS "CountStar()" - FROM star1 AS t0 + FROM "star1" AS "t0" GROUP BY 1 -) AS t1 +) AS "t1" WHERE - t1."CountStar()" > CAST(100 AS TINYINT) \ No newline at end of file + "t1"."CountStar()" > CAST(100 AS TINYINT) \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_aggregate_projection_alias_bug/out.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_aggregate_projection_alias_bug/out.sql index 0a483c1315c4..eb990a67c04d 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_aggregate_projection_alias_bug/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_aggregate_projection_alias_bug/out.sql @@ -1,16 +1,16 @@ SELECT - t4.foo_id, - SUM(t4.value1) AS total + "t4"."foo_id", + SUM("t4"."value1") AS "total" FROM ( SELECT - t2.c, - t2.f, - t2.foo_id, - t2.bar_id, - t3.value1 - FROM star1 AS t2 - INNER JOIN star2 AS t3 - ON t2.foo_id = t3.foo_id -) AS t4 + "t2"."c", + "t2"."f", + "t2"."foo_id", + "t2"."bar_id", + "t3"."value1" + FROM "star1" AS "t2" + INNER JOIN "star2" AS "t3" + ON "t2"."foo_id" = "t3"."foo_id" +) AS "t4" GROUP BY 1 \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_aggregate_projection_subquery/agg_filtered.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_aggregate_projection_subquery/agg_filtered.sql index 82d666c54c3f..808c9de5c6fc 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_aggregate_projection_subquery/agg_filtered.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_aggregate_projection_subquery/agg_filtered.sql @@ -1,23 +1,23 @@ SELECT - t1.g, - SUM(t1.foo) AS "foo total" + "t1"."g", + SUM("t1"."foo") AS "foo total" FROM ( SELECT - t0.a, - t0.b, - t0.c, - t0.d, - t0.e, - t0.f, - t0.g, - t0.h, - t0.i, - t0.j, - t0.k, - t0.a + t0.b AS foo - FROM alltypes AS t0 + "t0"."a", + "t0"."b", + "t0"."c", + "t0"."d", + "t0"."e", + "t0"."f", + "t0"."g", + "t0"."h", + "t0"."i", + "t0"."j", + "t0"."k", + "t0"."a" + "t0"."b" AS "foo" + FROM "alltypes" AS "t0" WHERE - t0.f > CAST(0 AS TINYINT) AND t0.g = 'bar' -) AS t1 + "t0"."f" > CAST(0 AS TINYINT) AND "t0"."g" = 'bar' +) AS "t1" GROUP BY 1 \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_aggregate_projection_subquery/agg_filtered2.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_aggregate_projection_subquery/agg_filtered2.sql index 32772c5a969d..84b289f68fc3 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_aggregate_projection_subquery/agg_filtered2.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_aggregate_projection_subquery/agg_filtered2.sql @@ -1,25 +1,25 @@ SELECT - t1.g, - SUM(t1.foo) AS "foo total" + "t1"."g", + SUM("t1"."foo") AS "foo total" FROM ( SELECT - t0.a, - t0.b, - t0.c, - t0.d, - t0.e, - t0.f, - t0.g, - t0.h, - t0.i, - t0.j, - t0.k, - t0.a + t0.b AS foo - FROM alltypes AS t0 + "t0"."a", + "t0"."b", + "t0"."c", + "t0"."d", + "t0"."e", + "t0"."f", + "t0"."g", + "t0"."h", + "t0"."i", + "t0"."j", + "t0"."k", + "t0"."a" + "t0"."b" AS "foo" + FROM "alltypes" AS "t0" WHERE - t0.f > CAST(0 AS TINYINT) AND ( - t0.a + t0.b + "t0"."f" > CAST(0 AS TINYINT) AND ( + "t0"."a" + "t0"."b" ) < CAST(10 AS TINYINT) -) AS t1 +) AS "t1" GROUP BY 1 \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_aggregate_projection_subquery/filtered.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_aggregate_projection_subquery/filtered.sql index 7407d5fcf78b..802747adcc8c 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_aggregate_projection_subquery/filtered.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_aggregate_projection_subquery/filtered.sql @@ -1,16 +1,16 @@ SELECT - t0.a, - t0.b, - t0.c, - t0.d, - t0.e, - t0.f, - t0.g, - t0.h, - t0.i, - t0.j, - t0.k, - t0.a + t0.b AS foo -FROM alltypes AS t0 + "t0"."a", + "t0"."b", + "t0"."c", + "t0"."d", + "t0"."e", + "t0"."f", + "t0"."g", + "t0"."h", + "t0"."i", + "t0"."j", + "t0"."k", + "t0"."a" + "t0"."b" AS "foo" +FROM "alltypes" AS "t0" WHERE - t0.f > CAST(0 AS TINYINT) AND t0.g = 'bar' \ No newline at end of file + "t0"."f" > CAST(0 AS TINYINT) AND "t0"."g" = 'bar' \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_aggregate_projection_subquery/proj.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_aggregate_projection_subquery/proj.sql index 0917ea29aae1..f41268dc8f89 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_aggregate_projection_subquery/proj.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_aggregate_projection_subquery/proj.sql @@ -1,16 +1,16 @@ SELECT - t0.a, - t0.b, - t0.c, - t0.d, - t0.e, - t0.f, - t0.g, - t0.h, - t0.i, - t0.j, - t0.k, - t0.a + t0.b AS foo -FROM alltypes AS t0 + "t0"."a", + "t0"."b", + "t0"."c", + "t0"."d", + "t0"."e", + "t0"."f", + "t0"."g", + "t0"."h", + "t0"."i", + "t0"."j", + "t0"."k", + "t0"."a" + "t0"."b" AS "foo" +FROM "alltypes" AS "t0" WHERE - t0.f > CAST(0 AS TINYINT) \ No newline at end of file + "t0"."f" > CAST(0 AS TINYINT) \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_anti_join/out.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_anti_join/out.sql index f2ef0d0d3f67..0b4227109539 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_anti_join/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_anti_join/out.sql @@ -1,8 +1,8 @@ SELECT - t2.c, - t2.f, - t2.foo_id, - t2.bar_id -FROM star1 AS t2 -ANTI JOIN star2 AS t3 - ON t2.foo_id = t3.foo_id \ No newline at end of file + "t2"."c", + "t2"."f", + "t2"."foo_id", + "t2"."bar_id" +FROM "star1" AS "t2" +ANTI JOIN "star2" AS "t3" + ON "t2"."foo_id" = "t3"."foo_id" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_bool_bool/out.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_bool_bool/out.sql index b110ecf4f3b8..3dea0500f604 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_bool_bool/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_bool_bool/out.sql @@ -1,9 +1,9 @@ SELECT - t0.dest, - t0.origin, - t0.arrdelay -FROM airlines AS t0 + "t0"."dest", + "t0"."origin", + "t0"."arrdelay" +FROM "airlines" AS "t0" WHERE ( - CAST(t0.dest AS BIGINT) = CAST(0 AS TINYINT) + CAST("t0"."dest" AS BIGINT) = CAST(0 AS TINYINT) ) = TRUE \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_bug_duplicated_where/out.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_bug_duplicated_where/out.sql index 173b6323b243..49071225a5db 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_bug_duplicated_where/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_bug_duplicated_where/out.sql @@ -1,23 +1,23 @@ SELECT - t2.arrdelay, - t2.dest, - t2.dest_avg, - t2.dev + "t2"."arrdelay", + "t2"."dest", + "t2"."dest_avg", + "t2"."dev" FROM ( SELECT - t1.arrdelay, - t1.dest, - AVG(t1.arrdelay) OVER (PARTITION BY t1.dest ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS dest_avg, - t1.arrdelay - AVG(t1.arrdelay) OVER (PARTITION BY t1.dest ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS dev + "t1"."arrdelay", + "t1"."dest", + AVG("t1"."arrdelay") OVER (PARTITION BY "t1"."dest" ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS "dest_avg", + "t1"."arrdelay" - AVG("t1"."arrdelay") OVER (PARTITION BY "t1"."dest" ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS "dev" FROM ( SELECT - t0.arrdelay, - t0.dest - FROM airlines AS t0 - ) AS t1 -) AS t2 + "t0"."arrdelay", + "t0"."dest" + FROM "airlines" AS "t0" + ) AS "t1" +) AS "t2" WHERE - NOT t2.dev IS NULL + NOT "t2"."dev" IS NULL ORDER BY - t2.dev DESC + "t2"."dev" DESC LIMIT 10 \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_bug_project_multiple_times/out.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_bug_project_multiple_times/out.sql index f498893a25cb..190eb7c08f1a 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_bug_project_multiple_times/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_bug_project_multiple_times/out.sql @@ -1,43 +1,43 @@ SELECT - t3.c_name, - t5.r_name, - t4.n_name -FROM tpch_customer AS t3 -INNER JOIN tpch_nation AS t4 - ON t3.c_nationkey = t4.n_nationkey -INNER JOIN tpch_region AS t5 - ON t4.n_regionkey = t5.r_regionkey + "t3"."c_name", + "t5"."r_name", + "t4"."n_name" +FROM "tpch_customer" AS "t3" +INNER JOIN "tpch_nation" AS "t4" + ON "t3"."c_nationkey" = "t4"."n_nationkey" +INNER JOIN "tpch_region" AS "t5" + ON "t4"."n_regionkey" = "t5"."r_regionkey" SEMI JOIN ( SELECT - t7.n_name, - t7."Sum(Cast(c_acctbal, float64))" + "t7"."n_name", + "t7"."Sum(Cast(c_acctbal, float64))" FROM ( SELECT - t6.n_name, - SUM(CAST(t6.c_acctbal AS DOUBLE)) AS "Sum(Cast(c_acctbal, float64))" + "t6"."n_name", + SUM(CAST("t6"."c_acctbal" AS DOUBLE)) AS "Sum(Cast(c_acctbal, float64))" FROM ( SELECT - t3.c_custkey, - t3.c_name, - t3.c_address, - t3.c_nationkey, - t3.c_phone, - t3.c_acctbal, - t3.c_mktsegment, - t3.c_comment, - t4.n_name, - t5.r_name - FROM tpch_customer AS t3 - INNER JOIN tpch_nation AS t4 - ON t3.c_nationkey = t4.n_nationkey - INNER JOIN tpch_region AS t5 - ON t4.n_regionkey = t5.r_regionkey - ) AS t6 + "t3"."c_custkey", + "t3"."c_name", + "t3"."c_address", + "t3"."c_nationkey", + "t3"."c_phone", + "t3"."c_acctbal", + "t3"."c_mktsegment", + "t3"."c_comment", + "t4"."n_name", + "t5"."r_name" + FROM "tpch_customer" AS "t3" + INNER JOIN "tpch_nation" AS "t4" + ON "t3"."c_nationkey" = "t4"."n_nationkey" + INNER JOIN "tpch_region" AS "t5" + ON "t4"."n_regionkey" = "t5"."r_regionkey" + ) AS "t6" GROUP BY 1 - ) AS t7 + ) AS "t7" ORDER BY - t7."Sum(Cast(c_acctbal, float64))" DESC + "t7"."Sum(Cast(c_acctbal, float64))" DESC LIMIT 10 -) AS t10 - ON t4.n_name = t10.n_name \ No newline at end of file +) AS "t10" + ON "t4"."n_name" = "t10"."n_name" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_case_in_projection/out.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_case_in_projection/out.sql index 4b25c0cd6d1e..3f14a3c53b88 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_case_in_projection/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_case_in_projection/out.sql @@ -1,21 +1,21 @@ SELECT - CASE t0.g WHEN 'foo' THEN 'bar' WHEN 'baz' THEN 'qux' ELSE 'default' END AS col1, + CASE "t0"."g" WHEN 'foo' THEN 'bar' WHEN 'baz' THEN 'qux' ELSE 'default' END AS "col1", CASE - WHEN t0.g = 'foo' + WHEN "t0"."g" = 'foo' THEN 'bar' - WHEN t0.g = 'baz' - THEN t0.g + WHEN "t0"."g" = 'baz' + THEN "t0"."g" ELSE CAST(NULL AS TEXT) - END AS col2, - t0.a, - t0.b, - t0.c, - t0.d, - t0.e, - t0.f, - t0.g, - t0.h, - t0.i, - t0.j, - t0.k -FROM alltypes AS t0 \ No newline at end of file + END AS "col2", + "t0"."a", + "t0"."b", + "t0"."c", + "t0"."d", + "t0"."e", + "t0"."f", + "t0"."g", + "t0"."h", + "t0"."i", + "t0"."j", + "t0"."k" +FROM "alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_chain_limit_doesnt_collapse/result.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_chain_limit_doesnt_collapse/result.sql index df7349fd3de0..03e2f6c0473f 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_chain_limit_doesnt_collapse/result.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_chain_limit_doesnt_collapse/result.sql @@ -2,38 +2,38 @@ SELECT * FROM ( SELECT - t1.city, - t1."Count(city)" + "t1"."city", + "t1"."Count(city)" FROM ( SELECT - t0.city, - COUNT(t0.city) AS "Count(city)" - FROM tbl AS t0 + "t0"."city", + COUNT("t0"."city") AS "Count(city)" + FROM "tbl" AS "t0" GROUP BY 1 - ) AS t1 + ) AS "t1" ORDER BY - t1."Count(city)" DESC + "t1"."Count(city)" DESC LIMIT 10 -) AS t3 +) AS "t3" LIMIT 5 OFFSET ( SELECT COUNT(*) + CAST(-5 AS TINYINT) FROM ( SELECT - t1.city, - t1."Count(city)" + "t1"."city", + "t1"."Count(city)" FROM ( SELECT - t0.city, - COUNT(t0.city) AS "Count(city)" - FROM tbl AS t0 + "t0"."city", + COUNT("t0"."city") AS "Count(city)" + FROM "tbl" AS "t0" GROUP BY 1 - ) AS t1 + ) AS "t1" ORDER BY - t1."Count(city)" DESC + "t1"."Count(city)" DESC LIMIT 10 - ) AS t3 + ) AS "t3" ) \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_complex_union/result.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_complex_union/result.sql index 57f027a897ec..f0f9981d0e25 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_complex_union/result.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_complex_union/result.sql @@ -1,14 +1,14 @@ SELECT - t4.diag, - t4.status + "t4"."diag", + "t4"."status" FROM ( SELECT - CAST(t0.diag + CAST(1 AS TINYINT) AS INT) AS diag, - t0.status - FROM aids2_one AS t0 + CAST("t0"."diag" + CAST(1 AS TINYINT) AS INT) AS "diag", + "t0"."status" + FROM "aids2_one" AS "t0" UNION ALL SELECT - CAST(t1.diag + CAST(1 AS TINYINT) AS INT) AS diag, - t1.status - FROM aids2_two AS t1 -) AS t4 \ No newline at end of file + CAST("t1"."diag" + CAST(1 AS TINYINT) AS INT) AS "diag", + "t1"."status" + FROM "aids2_two" AS "t1" +) AS "t4" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_double_nested_subquery_no_aliases/out.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_double_nested_subquery_no_aliases/out.sql index 6578a858c971..6d2946c5d8fb 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_double_nested_subquery_no_aliases/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_double_nested_subquery_no_aliases/out.sql @@ -1,26 +1,26 @@ SELECT - t2.key1, - SUM(t2.total) AS total + "t2"."key1", + SUM("t2"."total") AS "total" FROM ( SELECT - t1.key1, - t1.key2, - SUM(t1.total) AS total + "t1"."key1", + "t1"."key2", + SUM("t1"."total") AS "total" FROM ( SELECT - t0.key1, - t0.key2, - t0.key3, - SUM(t0.value) AS total - FROM foo_table AS t0 + "t0"."key1", + "t0"."key2", + "t0"."key3", + SUM("t0"."value") AS "total" + FROM "foo_table" AS "t0" GROUP BY 1, 2, 3 - ) AS t1 + ) AS "t1" GROUP BY 1, 2 -) AS t2 +) AS "t2" GROUP BY 1 \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_endswith/out.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_endswith/out.sql index 8114e54d3695..f03acf1df5fa 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_endswith/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_endswith/out.sql @@ -1,3 +1,3 @@ SELECT - SUFFIX(t0.foo_id, 'foo') AS tmp -FROM star1 AS t0 \ No newline at end of file + SUFFIX("t0"."foo_id", 'foo') AS "tmp" +FROM "star1" AS "t0" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_exists_subquery/out.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_exists_subquery/out.sql index 89f8c66d24dc..dcb94c24b5a1 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_exists_subquery/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_exists_subquery/out.sql @@ -1,13 +1,13 @@ SELECT - t0.key1, - t0.key2, - t0.value1 -FROM t1 AS t0 + "t0"."key1", + "t0"."key2", + "t0"."value1" +FROM "t1" AS "t0" WHERE EXISTS( SELECT CAST(1 AS TINYINT) AS "1" - FROM t2 AS t1 + FROM "t2" AS "t1" WHERE - t0.key1 = t1.key1 + "t0"."key1" = "t1"."key1" ) \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_filter_inside_exists/out.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_filter_inside_exists/out.sql index bffa5a6720b0..fff249c2693e 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_filter_inside_exists/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_filter_inside_exists/out.sql @@ -1,14 +1,14 @@ SELECT - t0.session_id, - t0.user_id, - t0.event_type, - t0.ts -FROM events AS t0 + "t0"."session_id", + "t0"."user_id", + "t0"."event_type", + "t0"."ts" +FROM "events" AS "t0" WHERE EXISTS( SELECT CAST(1 AS TINYINT) AS "1" - FROM purchases AS t1 + FROM "purchases" AS "t1" WHERE - t1.ts > '2015-08-15' AND t0.user_id = t1.user_id + "t1"."ts" > '2015-08-15' AND "t0"."user_id" = "t1"."user_id" ) \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_filter_predicates/out.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_filter_predicates/out.sql index 918ff235ee2a..85a4bc48e639 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_filter_predicates/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_filter_predicates/out.sql @@ -1,7 +1,7 @@ SELECT - t0.color -FROM t AS t0 + "t0"."color" +FROM "t" AS "t0" WHERE - LOWER(t0.color) LIKE '%de%' - AND CONTAINS(LOWER(t0.color), 'de') - AND REGEXP_MATCHES(LOWER(t0.color), '.*ge.*') \ No newline at end of file + LOWER("t0"."color") LIKE '%de%' + AND CONTAINS(LOWER("t0"."color"), 'de') + AND REGEXP_MATCHES(LOWER("t0"."color"), '.*ge.*') \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_filter_self_join_analysis_bug/result.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_filter_self_join_analysis_bug/result.sql index 68396dd92fca..89976ca29622 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_filter_self_join_analysis_bug/result.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_filter_self_join_analysis_bug/result.sql @@ -1,32 +1,32 @@ -WITH t1 AS ( +WITH "t1" AS ( SELECT - t0.region, - t0.kind, - SUM(t0.amount) AS total - FROM purchases AS t0 + "t0"."region", + "t0"."kind", + SUM("t0"."amount") AS "total" + FROM "purchases" AS "t0" GROUP BY 1, 2 ) SELECT - t5.region, - t5.total - t6.total AS diff + "t5"."region", + "t5"."total" - "t6"."total" AS "diff" FROM ( SELECT - t2.region, - t2.kind, - t2.total - FROM t1 AS t2 + "t2"."region", + "t2"."kind", + "t2"."total" + FROM "t1" AS "t2" WHERE - t2.kind = 'foo' -) AS t5 + "t2"."kind" = 'foo' +) AS "t5" INNER JOIN ( SELECT - t2.region, - t2.kind, - t2.total - FROM t1 AS t2 + "t2"."region", + "t2"."kind", + "t2"."total" + FROM "t1" AS "t2" WHERE - t2.kind = 'bar' -) AS t6 - ON t5.region = t6.region \ No newline at end of file + "t2"."kind" = 'bar' +) AS "t6" + ON "t5"."region" = "t6"."region" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_filter_subquery_derived_reduction/expr3.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_filter_subquery_derived_reduction/expr3.sql index 4f1205ba038e..9b99151402d1 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_filter_subquery_derived_reduction/expr3.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_filter_subquery_derived_reduction/expr3.sql @@ -1,23 +1,23 @@ SELECT - t0.c, - t0.f, - t0.foo_id, - t0.bar_id -FROM star1 AS t0 + "t0"."c", + "t0"."f", + "t0"."foo_id", + "t0"."bar_id" +FROM "star1" AS "t0" WHERE - t0.f > LN( + "t0"."f" > LN( ( SELECT - AVG(t1.f) AS "Mean(f)" + AVG("t1"."f") AS "Mean(f)" FROM ( SELECT - t0.c, - t0.f, - t0.foo_id, - t0.bar_id - FROM star1 AS t0 + "t0"."c", + "t0"."f", + "t0"."foo_id", + "t0"."bar_id" + FROM "star1" AS "t0" WHERE - t0.foo_id = 'foo' - ) AS t1 + "t0"."foo_id" = 'foo' + ) AS "t1" ) ) \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_filter_subquery_derived_reduction/expr4.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_filter_subquery_derived_reduction/expr4.sql index 640d7f8d09a4..a42ab6964031 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_filter_subquery_derived_reduction/expr4.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_filter_subquery_derived_reduction/expr4.sql @@ -1,25 +1,25 @@ SELECT - t0.c, - t0.f, - t0.foo_id, - t0.bar_id -FROM star1 AS t0 + "t0"."c", + "t0"."f", + "t0"."foo_id", + "t0"."bar_id" +FROM "star1" AS "t0" WHERE - t0.f > ( + "t0"."f" > ( LN( ( SELECT - AVG(t1.f) AS "Mean(f)" + AVG("t1"."f") AS "Mean(f)" FROM ( SELECT - t0.c, - t0.f, - t0.foo_id, - t0.bar_id - FROM star1 AS t0 + "t0"."c", + "t0"."f", + "t0"."foo_id", + "t0"."bar_id" + FROM "star1" AS "t0" WHERE - t0.foo_id = 'foo' - ) AS t1 + "t0"."foo_id" = 'foo' + ) AS "t1" ) ) + CAST(1 AS TINYINT) ) \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_fuse_projections/project.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_fuse_projections/project.sql index bc1d0cc45118..79d8cee79e9d 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_fuse_projections/project.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_fuse_projections/project.sql @@ -1,7 +1,7 @@ SELECT - t0.foo, - t0.bar, - t0.value, - t0.foo + t0.bar AS baz, - t0.foo * CAST(2 AS TINYINT) AS qux -FROM tbl AS t0 \ No newline at end of file + "t0"."foo", + "t0"."bar", + "t0"."value", + "t0"."foo" + "t0"."bar" AS "baz", + "t0"."foo" * CAST(2 AS TINYINT) AS "qux" +FROM "tbl" AS "t0" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_fuse_projections/project_filter.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_fuse_projections/project_filter.sql index 4f8cda85cc5c..d91e991fa6d7 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_fuse_projections/project_filter.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_fuse_projections/project_filter.sql @@ -1,9 +1,9 @@ SELECT - t0.foo, - t0.bar, - t0.value, - t0.foo + t0.bar AS baz, - t0.foo * CAST(2 AS TINYINT) AS qux -FROM tbl AS t0 + "t0"."foo", + "t0"."bar", + "t0"."value", + "t0"."foo" + "t0"."bar" AS "baz", + "t0"."foo" * CAST(2 AS TINYINT) AS "qux" +FROM "tbl" AS "t0" WHERE - t0.value > CAST(0 AS TINYINT) \ No newline at end of file + "t0"."value" > CAST(0 AS TINYINT) \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_identifier_quoting/out.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_identifier_quoting/out.sql index f768122da94c..33c608e128ff 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_identifier_quoting/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_identifier_quoting/out.sql @@ -1,4 +1,4 @@ SELECT - t0.date AS else, - t0.explain AS join -FROM table AS t0 \ No newline at end of file + "t0"."date" AS "else", + "t0"."explain" AS "join" +FROM "table" AS "t0" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_incorrect_predicate_pushdown/result.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_incorrect_predicate_pushdown/result.sql index dc33ad4a62ff..4d92015cc1bd 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_incorrect_predicate_pushdown/result.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_incorrect_predicate_pushdown/result.sql @@ -1,7 +1,7 @@ SELECT - t0.x + CAST(1 AS TINYINT) AS x -FROM t AS t0 + "t0"."x" + CAST(1 AS TINYINT) AS "x" +FROM "t" AS "t0" WHERE ( - t0.x + CAST(1 AS TINYINT) + "t0"."x" + CAST(1 AS TINYINT) ) > CAST(1 AS TINYINT) \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_incorrect_predicate_pushdown_with_literal/result.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_incorrect_predicate_pushdown_with_literal/result.sql index 2fd5fe2ddc07..11159dee0f92 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_incorrect_predicate_pushdown_with_literal/result.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_incorrect_predicate_pushdown_with_literal/result.sql @@ -1,5 +1,5 @@ SELECT - CAST(1 AS TINYINT) AS a -FROM t AS t0 + CAST(1 AS TINYINT) AS "a" +FROM "t" AS "t0" WHERE CAST(1 AS TINYINT) > CAST(1 AS TINYINT) \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_join_between_joins/out.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_join_between_joins/out.sql index 396306956a81..bbfe6934de2d 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_join_between_joins/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_join_between_joins/out.sql @@ -1,21 +1,21 @@ SELECT - t4.key1, - t4.key2, - t4.value1, - t5.value2, - t9.value3, - t9.value4 -FROM first AS t4 -INNER JOIN second AS t5 - ON t4.key1 = t5.key1 + "t4"."key1", + "t4"."key2", + "t4"."value1", + "t5"."value2", + "t9"."value3", + "t9"."value4" +FROM "first" AS "t4" +INNER JOIN "second" AS "t5" + ON "t4"."key1" = "t5"."key1" INNER JOIN ( SELECT - t6.key2, - t6.key3, - t6.value3, - t7.value4 - FROM third AS t6 - INNER JOIN fourth AS t7 - ON t6.key3 = t7.key3 -) AS t9 - ON t4.key2 = t9.key2 \ No newline at end of file + "t6"."key2", + "t6"."key3", + "t6"."value3", + "t7"."value4" + FROM "third" AS "t6" + INNER JOIN "fourth" AS "t7" + ON "t6"."key3" = "t7"."key3" +) AS "t9" + ON "t4"."key2" = "t9"."key2" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_join_filtered_tables_no_pushdown/out.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_join_filtered_tables_no_pushdown/out.sql index 879cd074a3ac..cf8bb36c3c11 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_join_filtered_tables_no_pushdown/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_join_filtered_tables_no_pushdown/out.sql @@ -1,28 +1,28 @@ SELECT - t4.value_a, - t5.value_b + "t4"."value_a", + "t5"."value_b" FROM ( SELECT - t0.year, - t0.month, - t0.day, - t0.value_a - FROM a AS t0 + "t0"."year", + "t0"."month", + "t0"."day", + "t0"."value_a" + FROM "a" AS "t0" WHERE - t0.year = CAST(2016 AS SMALLINT) - AND t0.month = CAST(2 AS TINYINT) - AND t0.day = CAST(29 AS TINYINT) -) AS t4 + "t0"."year" = CAST(2016 AS SMALLINT) + AND "t0"."month" = CAST(2 AS TINYINT) + AND "t0"."day" = CAST(29 AS TINYINT) +) AS "t4" LEFT OUTER JOIN ( SELECT - t1.year, - t1.month, - t1.day, - t1.value_b - FROM b AS t1 + "t1"."year", + "t1"."month", + "t1"."day", + "t1"."value_b" + FROM "b" AS "t1" WHERE - t1.year = CAST(2016 AS SMALLINT) - AND t1.month = CAST(2 AS TINYINT) - AND t1.day = CAST(29 AS TINYINT) -) AS t5 - ON t4.year = t5.year AND t4.month = t5.month AND t4.day = t5.day \ No newline at end of file + "t1"."year" = CAST(2016 AS SMALLINT) + AND "t1"."month" = CAST(2 AS TINYINT) + AND "t1"."day" = CAST(29 AS TINYINT) +) AS "t5" + ON "t4"."year" = "t5"."year" AND "t4"."month" = "t5"."month" AND "t4"."day" = "t5"."day" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_join_just_materialized/out.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_join_just_materialized/out.sql index 28ef4cadbb22..03ed7e8d464c 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_join_just_materialized/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_join_just_materialized/out.sql @@ -1,21 +1,21 @@ SELECT - t3.n_nationkey, - t3.n_name, - t3.n_regionkey, - t3.n_comment, - t4.r_regionkey, - t4.r_name, - t4.r_comment, - t5.c_custkey, - t5.c_name, - t5.c_address, - t5.c_nationkey, - t5.c_phone, - t5.c_acctbal, - t5.c_mktsegment, - t5.c_comment -FROM tpch_nation AS t3 -INNER JOIN tpch_region AS t4 - ON t3.n_regionkey = t4.r_regionkey -INNER JOIN tpch_customer AS t5 - ON t3.n_nationkey = t5.c_nationkey \ No newline at end of file + "t3"."n_nationkey", + "t3"."n_name", + "t3"."n_regionkey", + "t3"."n_comment", + "t4"."r_regionkey", + "t4"."r_name", + "t4"."r_comment", + "t5"."c_custkey", + "t5"."c_name", + "t5"."c_address", + "t5"."c_nationkey", + "t5"."c_phone", + "t5"."c_acctbal", + "t5"."c_mktsegment", + "t5"."c_comment" +FROM "tpch_nation" AS "t3" +INNER JOIN "tpch_region" AS "t4" + ON "t3"."n_regionkey" = "t4"."r_regionkey" +INNER JOIN "tpch_customer" AS "t5" + ON "t3"."n_nationkey" = "t5"."c_nationkey" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_join_projection_subquery_bug/out.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_join_projection_subquery_bug/out.sql index ccaf14d42229..e5c3c2f2aa77 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_join_projection_subquery_bug/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_join_projection_subquery_bug/out.sql @@ -1,17 +1,17 @@ SELECT - t5.c_custkey, - t5.c_name, - t5.c_address, - t5.c_nationkey, - t5.c_phone, - t5.c_acctbal, - t5.c_mktsegment, - t5.c_comment, - t3.n_nationkey, - t3.n_name AS nation, - t4.r_name AS region -FROM tpch_nation AS t3 -INNER JOIN tpch_region AS t4 - ON t3.n_regionkey = t4.r_regionkey -INNER JOIN tpch_customer AS t5 - ON t3.n_nationkey = t5.c_nationkey \ No newline at end of file + "t5"."c_custkey", + "t5"."c_name", + "t5"."c_address", + "t5"."c_nationkey", + "t5"."c_phone", + "t5"."c_acctbal", + "t5"."c_mktsegment", + "t5"."c_comment", + "t3"."n_nationkey", + "t3"."n_name" AS "nation", + "t4"."r_name" AS "region" +FROM "tpch_nation" AS "t3" +INNER JOIN "tpch_region" AS "t4" + ON "t3"."n_regionkey" = "t4"."r_regionkey" +INNER JOIN "tpch_customer" AS "t5" + ON "t3"."n_nationkey" = "t5"."c_nationkey" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_join_with_conditional_aggregate/result.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_join_with_conditional_aggregate/result.sql index cf540b867fb9..cdc5697c2d3d 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_join_with_conditional_aggregate/result.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_join_with_conditional_aggregate/result.sql @@ -1,31 +1,31 @@ SELECT - t5.on, - t5.by, - t5.on_right, - t5.by_right, - t5.val + "t5"."on", + "t5"."by", + "t5"."on_right", + "t5"."by_right", + "t5"."val" FROM ( SELECT - t2.on, - t2.by, - t3.on AS on_right, - t3.by AS by_right, - t3.val - FROM left AS t2 - LEFT OUTER JOIN right AS t3 - ON t2.by = t3.by -) AS t5 + "t2"."on", + "t2"."by", + "t3"."on" AS "on_right", + "t3"."by" AS "by_right", + "t3"."val" + FROM "left" AS "t2" + LEFT OUTER JOIN "right" AS "t3" + ON "t2"."by" = "t3"."by" +) AS "t5" WHERE - t5.on_right = ( + "t5"."on_right" = ( SELECT - MAX(t4.on) AS "Max(on)" + MAX("t4"."on") AS "Max(on)" FROM ( SELECT - t1.on, - t1.by, - t1.val - FROM right AS t1 + "t1"."on", + "t1"."by", + "t1"."val" + FROM "right" AS "t1" WHERE - t1.by = t0.by AND t1.on <= t0.on - ) AS t4 + "t1"."by" = "t0"."by" AND "t1"."on" <= "t0"."on" + ) AS "t4" ) \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_join_with_limited_table/out.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_join_with_limited_table/out.sql index 1ea81d25a312..c27a7b3da739 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_join_with_limited_table/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_join_with_limited_table/out.sql @@ -1,13 +1,13 @@ SELECT - t4.c, - t4.f, - t4.foo_id, - t4.bar_id + "t4"."c", + "t4"."f", + "t4"."foo_id", + "t4"."bar_id" FROM ( SELECT * - FROM star1 AS t0 + FROM "star1" AS "t0" LIMIT 100 -) AS t4 -INNER JOIN star2 AS t3 - ON t4.foo_id = t3.foo_id \ No newline at end of file +) AS "t4" +INNER JOIN "star2" AS "t3" + ON "t4"."foo_id" = "t3"."foo_id" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_limit_cte_extract/out.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_limit_cte_extract/out.sql index 12799aaebd5a..ca9b89c74630 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_limit_cte_extract/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_limit_cte_extract/out.sql @@ -1,23 +1,23 @@ -WITH t1 AS ( +WITH "t1" AS ( SELECT * - FROM functional_alltypes AS t0 + FROM "functional_alltypes" AS "t0" LIMIT 100 ) SELECT - t3.id, - t3.bool_col, - t3.tinyint_col, - t3.smallint_col, - t3.int_col, - t3.bigint_col, - t3.float_col, - t3.double_col, - t3.date_string_col, - t3.string_col, - t3.timestamp_col, - t3.year, - t3.month -FROM t1 AS t3 -INNER JOIN t1 AS t5 + "t3"."id", + "t3"."bool_col", + "t3"."tinyint_col", + "t3"."smallint_col", + "t3"."int_col", + "t3"."bigint_col", + "t3"."float_col", + "t3"."double_col", + "t3"."date_string_col", + "t3"."string_col", + "t3"."timestamp_col", + "t3"."year", + "t3"."month" +FROM "t1" AS "t3" +INNER JOIN "t1" AS "t5" ON TRUE \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_limit_with_self_join/out.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_limit_with_self_join/out.sql index bb7c1b27ee01..2cda81f9a69c 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_limit_with_self_join/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_limit_with_self_join/out.sql @@ -2,33 +2,33 @@ SELECT COUNT(*) AS "CountStar()" FROM ( 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, - t3.id AS id_right, - t3.bool_col AS bool_col_right, - t3.tinyint_col AS tinyint_col_right, - t3.smallint_col AS smallint_col_right, - t3.int_col AS int_col_right, - t3.bigint_col AS bigint_col_right, - t3.float_col AS float_col_right, - t3.double_col AS double_col_right, - t3.date_string_col AS date_string_col_right, - t3.string_col AS string_col_right, - t3.timestamp_col AS timestamp_col_right, - t3.year AS year_right, - t3.month AS month_right - FROM functional_alltypes AS t1 - INNER JOIN functional_alltypes AS t3 - ON t1.tinyint_col < EXTRACT(minute FROM t3.timestamp_col) -) AS t4 \ No newline at end of file + "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", + "t3"."id" AS "id_right", + "t3"."bool_col" AS "bool_col_right", + "t3"."tinyint_col" AS "tinyint_col_right", + "t3"."smallint_col" AS "smallint_col_right", + "t3"."int_col" AS "int_col_right", + "t3"."bigint_col" AS "bigint_col_right", + "t3"."float_col" AS "float_col_right", + "t3"."double_col" AS "double_col_right", + "t3"."date_string_col" AS "date_string_col_right", + "t3"."string_col" AS "string_col_right", + "t3"."timestamp_col" AS "timestamp_col_right", + "t3"."year" AS "year_right", + "t3"."month" AS "month_right" + FROM "functional_alltypes" AS "t1" + INNER JOIN "functional_alltypes" AS "t3" + ON "t1"."tinyint_col" < EXTRACT(minute FROM "t3"."timestamp_col") +) AS "t4" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_loj_subquery_filter_handling/out.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_loj_subquery_filter_handling/out.sql index fd5640b69685..2dba0c8f36ec 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_loj_subquery_filter_handling/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_loj_subquery_filter_handling/out.sql @@ -1,22 +1,22 @@ SELECT - t4.id AS left_id, - t4.desc AS left_desc, - t5.id AS right_id, - t5.desc AS right_desc + "t4"."id" AS "left_id", + "t4"."desc" AS "left_desc", + "t5"."id" AS "right_id", + "t5"."desc" AS "right_desc" FROM ( SELECT - t0.id, - t0.desc - FROM foo AS t0 + "t0"."id", + "t0"."desc" + FROM "foo" AS "t0" WHERE - t0.id < CAST(2 AS TINYINT) -) AS t4 + "t0"."id" < CAST(2 AS TINYINT) +) AS "t4" LEFT OUTER JOIN ( SELECT - t1.id, - t1.desc - FROM bar AS t1 + "t1"."id", + "t1"."desc" + FROM "bar" AS "t1" WHERE - t1.id < CAST(3 AS TINYINT) -) AS t5 - ON t4.id = t5.id AND t4.desc = t5.desc \ No newline at end of file + "t1"."id" < CAST(3 AS TINYINT) +) AS "t5" + ON "t4"."id" = "t5"."id" AND "t4"."desc" = "t5"."desc" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_multiple_joins/out.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_multiple_joins/out.sql index 4d414f398697..cc050d3028c4 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_multiple_joins/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_multiple_joins/out.sql @@ -1,12 +1,12 @@ SELECT - t3.c, - t3.f, - t3.foo_id, - t3.bar_id, - t4.value1, - t5.value2 -FROM star1 AS t3 -LEFT OUTER JOIN star2 AS t4 - ON t3.foo_id = t4.foo_id -INNER JOIN star3 AS t5 - ON t3.bar_id = t5.bar_id \ No newline at end of file + "t3"."c", + "t3"."f", + "t3"."foo_id", + "t3"."bar_id", + "t4"."value1", + "t5"."value2" +FROM "star1" AS "t3" +LEFT OUTER JOIN "star2" AS "t4" + ON "t3"."foo_id" = "t4"."foo_id" +INNER JOIN "star3" AS "t5" + ON "t3"."bar_id" = "t5"."bar_id" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_multiple_limits/out.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_multiple_limits/out.sql index 7f7d28627c2f..266babfbbfeb 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_multiple_limits/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_multiple_limits/out.sql @@ -3,7 +3,7 @@ SELECT FROM ( SELECT * - FROM functional_alltypes AS t0 + FROM "functional_alltypes" AS "t0" LIMIT 20 -) AS t1 +) AS "t1" LIMIT 10 \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_order_by_on_limit_yield_subquery/out.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_order_by_on_limit_yield_subquery/out.sql index 315083748ef8..45c3e7cfc10a 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_order_by_on_limit_yield_subquery/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_order_by_on_limit_yield_subquery/out.sql @@ -1,14 +1,14 @@ SELECT - t2.string_col, - t2.nrows + "t2"."string_col", + "t2"."nrows" FROM ( SELECT - t0.string_col, - COUNT(*) AS nrows - FROM functional_alltypes AS t0 + "t0"."string_col", + COUNT(*) AS "nrows" + FROM "functional_alltypes" AS "t0" GROUP BY 1 LIMIT 5 -) AS t2 +) AS "t2" ORDER BY - t2.string_col ASC \ No newline at end of file + "t2"."string_col" ASC \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_projection_filter_fuse/out.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_projection_filter_fuse/out.sql index c93dbd9ab8dc..4c7c35d3c442 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_projection_filter_fuse/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_projection_filter_fuse/out.sql @@ -1,7 +1,7 @@ SELECT - t0.a, - t0.b, - t0.c -FROM foo AS t0 + "t0"."a", + "t0"."b", + "t0"."c" +FROM "foo" AS "t0" WHERE - t0.a > CAST(0 AS TINYINT) \ No newline at end of file + "t0"."a" > CAST(0 AS TINYINT) \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_scalar_subquery_different_table/out.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_scalar_subquery_different_table/out.sql index fdc7cf00bcd2..40ef73b9ea30 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_scalar_subquery_different_table/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_scalar_subquery_different_table/out.sql @@ -1,12 +1,12 @@ SELECT - t0.job, - t0.dept_id, - t0.year, - t0.y -FROM foo AS t0 + "t0"."job", + "t0"."dept_id", + "t0"."year", + "t0"."y" +FROM "foo" AS "t0" WHERE - t0.y > ( + "t0"."y" > ( SELECT - MAX(t1.x) AS "Max(x)" - FROM bar AS t1 + MAX("t1"."x") AS "Max(x)" + FROM "bar" AS "t1" ) \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_select_sql/agg_explicit_column/out.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_select_sql/agg_explicit_column/out.sql index dbf4aadac203..34e180525498 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_select_sql/agg_explicit_column/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_select_sql/agg_explicit_column/out.sql @@ -1,6 +1,6 @@ SELECT - t0.foo_id, - SUM(t0.f) AS total -FROM star1 AS t0 + "t0"."foo_id", + SUM("t0"."f") AS "total" +FROM "star1" AS "t0" GROUP BY 1 \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_select_sql/agg_string_columns/out.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_select_sql/agg_string_columns/out.sql index be9b430bd3d3..c5b36f1f25d4 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_select_sql/agg_string_columns/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_select_sql/agg_string_columns/out.sql @@ -1,8 +1,8 @@ SELECT - t0.foo_id, - t0.bar_id, - SUM(t0.f) AS total -FROM star1 AS t0 + "t0"."foo_id", + "t0"."bar_id", + SUM("t0"."f") AS "total" +FROM "star1" AS "t0" GROUP BY 1, 2 \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_select_sql/aggregate_table_count_metric/out.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_select_sql/aggregate_table_count_metric/out.sql index a924af63f39d..c6776a20fb0a 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_select_sql/aggregate_table_count_metric/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_select_sql/aggregate_table_count_metric/out.sql @@ -1,3 +1,3 @@ SELECT COUNT(*) AS "CountStar()" -FROM star1 AS t0 \ No newline at end of file +FROM "star1" AS "t0" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_select_sql/filter_then_limit/out.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_select_sql/filter_then_limit/out.sql index 31e87b57f3ea..7ce2d03a7aec 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_select_sql/filter_then_limit/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_select_sql/filter_then_limit/out.sql @@ -1,9 +1,9 @@ SELECT - t0.c, - t0.f, - t0.foo_id, - t0.bar_id -FROM star1 AS t0 + "t0"."c", + "t0"."f", + "t0"."foo_id", + "t0"."bar_id" +FROM "star1" AS "t0" WHERE - t0.f > CAST(0 AS TINYINT) + "t0"."f" > CAST(0 AS TINYINT) LIMIT 10 \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_select_sql/limit_simple/out.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_select_sql/limit_simple/out.sql index 2b6d0fe52716..651d57bbc4c8 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_select_sql/limit_simple/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_select_sql/limit_simple/out.sql @@ -1,4 +1,4 @@ SELECT * -FROM star1 AS t0 +FROM "star1" AS "t0" LIMIT 10 \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_select_sql/limit_then_filter/out.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_select_sql/limit_then_filter/out.sql index ab4dd6df7158..6a53e9d7fec3 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_select_sql/limit_then_filter/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_select_sql/limit_then_filter/out.sql @@ -1,13 +1,13 @@ SELECT - t1.c, - t1.f, - t1.foo_id, - t1.bar_id + "t1"."c", + "t1"."f", + "t1"."foo_id", + "t1"."bar_id" FROM ( SELECT * - FROM star1 AS t0 + FROM "star1" AS "t0" LIMIT 10 -) AS t1 +) AS "t1" WHERE - t1.f > CAST(0 AS TINYINT) \ No newline at end of file + "t1"."f" > CAST(0 AS TINYINT) \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_select_sql/limit_with_offset/out.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_select_sql/limit_with_offset/out.sql index 3c71bda9b962..0f11f2394924 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_select_sql/limit_with_offset/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_select_sql/limit_with_offset/out.sql @@ -1,5 +1,5 @@ SELECT * -FROM star1 AS t0 +FROM "star1" AS "t0" LIMIT 10 OFFSET 5 \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_select_sql/single_column/out.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_select_sql/single_column/out.sql index bb666f269b2a..b5450abae2a7 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_select_sql/single_column/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_select_sql/single_column/out.sql @@ -1,8 +1,8 @@ SELECT - t0.c, - t0.f, - t0.foo_id, - t0.bar_id -FROM star1 AS t0 + "t0"."c", + "t0"."f", + "t0"."foo_id", + "t0"."bar_id" +FROM "star1" AS "t0" ORDER BY - t0.f ASC \ No newline at end of file + "t0"."f" ASC \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_select_sql/test_physical_table_reference_translate/out.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_select_sql/test_physical_table_reference_translate/out.sql index f223e15ca36b..9b15a47d945c 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_select_sql/test_physical_table_reference_translate/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_select_sql/test_physical_table_reference_translate/out.sql @@ -1,3 +1,3 @@ SELECT * -FROM alltypes \ No newline at end of file +FROM "alltypes" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_self_join_subquery_distinct_equal/out.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_self_join_subquery_distinct_equal/out.sql index 3d676c32001a..52fe23dbf9e4 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_self_join_subquery_distinct_equal/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_self_join_subquery_distinct_equal/out.sql @@ -1,20 +1,20 @@ SELECT - t2.r_name, - t6.n_name -FROM tpch_region AS t2 -INNER JOIN tpch_nation AS t3 - ON t2.r_regionkey = t3.n_regionkey + "t2"."r_name", + "t6"."n_name" +FROM "tpch_region" AS "t2" +INNER JOIN "tpch_nation" AS "t3" + ON "t2"."r_regionkey" = "t3"."n_regionkey" INNER JOIN ( SELECT - t2.r_regionkey, - t2.r_name, - t2.r_comment, - t3.n_nationkey, - t3.n_name, - t3.n_regionkey, - t3.n_comment - FROM tpch_region AS t2 - INNER JOIN tpch_nation AS t3 - ON t2.r_regionkey = t3.n_regionkey -) AS t6 - ON t2.r_regionkey = t6.r_regionkey \ No newline at end of file + "t2"."r_regionkey", + "t2"."r_name", + "t2"."r_comment", + "t3"."n_nationkey", + "t3"."n_name", + "t3"."n_regionkey", + "t3"."n_comment" + FROM "tpch_region" AS "t2" + INNER JOIN "tpch_nation" AS "t3" + ON "t2"."r_regionkey" = "t3"."n_regionkey" +) AS "t6" + ON "t2"."r_regionkey" = "t6"."r_regionkey" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_semi_join/out.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_semi_join/out.sql index 802ea0aad1c6..3bcfd0d04c11 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_semi_join/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_semi_join/out.sql @@ -1,8 +1,8 @@ SELECT - t2.c, - t2.f, - t2.foo_id, - t2.bar_id -FROM star1 AS t2 -SEMI JOIN star2 AS t3 - ON t2.foo_id = t3.foo_id \ No newline at end of file + "t2"."c", + "t2"."f", + "t2"."foo_id", + "t2"."bar_id" +FROM "star1" AS "t2" +SEMI JOIN "star2" AS "t3" + ON "t2"."foo_id" = "t3"."foo_id" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_simple_joins/inner.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_simple_joins/inner.sql index 56f5488cdde3..540e9df3ccb0 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_simple_joins/inner.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_simple_joins/inner.sql @@ -1,8 +1,8 @@ SELECT - t2.c, - t2.f, - t2.foo_id, - t2.bar_id -FROM star1 AS t2 -INNER JOIN star2 AS t3 - ON t2.foo_id = t3.foo_id \ No newline at end of file + "t2"."c", + "t2"."f", + "t2"."foo_id", + "t2"."bar_id" +FROM "star1" AS "t2" +INNER JOIN "star2" AS "t3" + ON "t2"."foo_id" = "t3"."foo_id" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_simple_joins/inner_two_preds.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_simple_joins/inner_two_preds.sql index 59916704c75d..733df816e0c2 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_simple_joins/inner_two_preds.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_simple_joins/inner_two_preds.sql @@ -1,8 +1,8 @@ SELECT - t2.c, - t2.f, - t2.foo_id, - t2.bar_id -FROM star1 AS t2 -INNER JOIN star2 AS t3 - ON t2.foo_id = t3.foo_id AND t2.bar_id = t3.foo_id \ No newline at end of file + "t2"."c", + "t2"."f", + "t2"."foo_id", + "t2"."bar_id" +FROM "star1" AS "t2" +INNER JOIN "star2" AS "t3" + ON "t2"."foo_id" = "t3"."foo_id" AND "t2"."bar_id" = "t3"."foo_id" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_simple_joins/left.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_simple_joins/left.sql index 0b9cd8c00921..6fe0cfaafa6b 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_simple_joins/left.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_simple_joins/left.sql @@ -1,8 +1,8 @@ SELECT - t2.c, - t2.f, - t2.foo_id, - t2.bar_id -FROM star1 AS t2 -LEFT OUTER JOIN star2 AS t3 - ON t2.foo_id = t3.foo_id \ No newline at end of file + "t2"."c", + "t2"."f", + "t2"."foo_id", + "t2"."bar_id" +FROM "star1" AS "t2" +LEFT OUTER JOIN "star2" AS "t3" + ON "t2"."foo_id" = "t3"."foo_id" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_simple_joins/outer.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_simple_joins/outer.sql index 91950bc952c5..39e54c234e2d 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_simple_joins/outer.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_simple_joins/outer.sql @@ -1,8 +1,8 @@ SELECT - t2.c, - t2.f, - t2.foo_id, - t2.bar_id -FROM star1 AS t2 -FULL OUTER JOIN star2 AS t3 - ON t2.foo_id = t3.foo_id \ No newline at end of file + "t2"."c", + "t2"."f", + "t2"."foo_id", + "t2"."bar_id" +FROM "star1" AS "t2" +FULL OUTER JOIN "star2" AS "t3" + ON "t2"."foo_id" = "t3"."foo_id" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_sort_then_group_by_propagates_keys/result1.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_sort_then_group_by_propagates_keys/result1.sql index 5877da115f7b..b32c0c3a5a02 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_sort_then_group_by_propagates_keys/result1.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_sort_then_group_by_propagates_keys/result1.sql @@ -1,12 +1,12 @@ SELECT - t1.b, - COUNT(*) AS b_count + "t1"."b", + COUNT(*) AS "b_count" FROM ( SELECT - t0.b - FROM t AS t0 + "t0"."b" + FROM "t" AS "t0" ORDER BY - t0.a ASC -) AS t1 + "t0"."a" ASC +) AS "t1" GROUP BY 1 \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_sort_then_group_by_propagates_keys/result2.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_sort_then_group_by_propagates_keys/result2.sql index b40324745e05..0471b87d4908 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_sort_then_group_by_propagates_keys/result2.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_sort_then_group_by_propagates_keys/result2.sql @@ -1,12 +1,12 @@ SELECT - t1.b, - COUNT(*) AS b_count + "t1"."b", + COUNT(*) AS "b_count" FROM ( SELECT - t0.b - FROM t AS t0 + "t0"."b" + FROM "t" AS "t0" ORDER BY - t0.b ASC -) AS t1 + "t0"."b" ASC +) AS "t1" GROUP BY 1 \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_startswith/out.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_startswith/out.sql index 05528dd5f869..717ada6a7cac 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_startswith/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_startswith/out.sql @@ -1,3 +1,3 @@ SELECT - STARTS_WITH(t0.foo_id, 'foo') AS tmp -FROM star1 AS t0 \ No newline at end of file + STARTS_WITH("t0"."foo_id", 'foo') AS "tmp" +FROM "star1" AS "t0" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_subquery_factor_correlated_subquery/out.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_subquery_factor_correlated_subquery/out.sql index d400eab10c82..6c353f9e889a 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_subquery_factor_correlated_subquery/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_subquery_factor_correlated_subquery/out.sql @@ -1,76 +1,76 @@ SELECT - t8.c_custkey, - t8.c_name, - t8.c_address, - t8.c_nationkey, - t8.c_phone, - t8.c_acctbal, - t8.c_mktsegment, - t8.c_comment, - t8.region, - t8.amount, - t8.odate + "t8"."c_custkey", + "t8"."c_name", + "t8"."c_address", + "t8"."c_nationkey", + "t8"."c_phone", + "t8"."c_acctbal", + "t8"."c_mktsegment", + "t8"."c_comment", + "t8"."region", + "t8"."amount", + "t8"."odate" FROM ( SELECT - t6.c_custkey, - t6.c_name, - t6.c_address, - t6.c_nationkey, - t6.c_phone, - t6.c_acctbal, - t6.c_mktsegment, - t6.c_comment, - t4.r_name AS region, - t7.o_totalprice AS amount, - CAST(t7.o_orderdate AS TIMESTAMP) AS odate - FROM tpch_region AS t4 - INNER JOIN tpch_nation AS t5 - ON t4.r_regionkey = t5.n_regionkey - INNER JOIN tpch_customer AS t6 - ON t6.c_nationkey = t5.n_nationkey - INNER JOIN tpch_orders AS t7 - ON t7.o_custkey = t6.c_custkey -) AS t8 + "t6"."c_custkey", + "t6"."c_name", + "t6"."c_address", + "t6"."c_nationkey", + "t6"."c_phone", + "t6"."c_acctbal", + "t6"."c_mktsegment", + "t6"."c_comment", + "t4"."r_name" AS "region", + "t7"."o_totalprice" AS "amount", + CAST("t7"."o_orderdate" AS TIMESTAMP) AS "odate" + FROM "tpch_region" AS "t4" + INNER JOIN "tpch_nation" AS "t5" + ON "t4"."r_regionkey" = "t5"."n_regionkey" + INNER JOIN "tpch_customer" AS "t6" + ON "t6"."c_nationkey" = "t5"."n_nationkey" + INNER JOIN "tpch_orders" AS "t7" + ON "t7"."o_custkey" = "t6"."c_custkey" +) AS "t8" WHERE - t8.amount > ( + "t8"."amount" > ( SELECT - AVG(t10.amount) AS "Mean(amount)" + AVG("t10"."amount") AS "Mean(amount)" FROM ( SELECT - t9.c_custkey, - t9.c_name, - t9.c_address, - t9.c_nationkey, - t9.c_phone, - t9.c_acctbal, - t9.c_mktsegment, - t9.c_comment, - t9.region, - t9.amount, - t9.odate + "t9"."c_custkey", + "t9"."c_name", + "t9"."c_address", + "t9"."c_nationkey", + "t9"."c_phone", + "t9"."c_acctbal", + "t9"."c_mktsegment", + "t9"."c_comment", + "t9"."region", + "t9"."amount", + "t9"."odate" FROM ( SELECT - t6.c_custkey, - t6.c_name, - t6.c_address, - t6.c_nationkey, - t6.c_phone, - t6.c_acctbal, - t6.c_mktsegment, - t6.c_comment, - t4.r_name AS region, - t7.o_totalprice AS amount, - CAST(t7.o_orderdate AS TIMESTAMP) AS odate - FROM tpch_region AS t4 - INNER JOIN tpch_nation AS t5 - ON t4.r_regionkey = t5.n_regionkey - INNER JOIN tpch_customer AS t6 - ON t6.c_nationkey = t5.n_nationkey - INNER JOIN tpch_orders AS t7 - ON t7.o_custkey = t6.c_custkey - ) AS t9 + "t6"."c_custkey", + "t6"."c_name", + "t6"."c_address", + "t6"."c_nationkey", + "t6"."c_phone", + "t6"."c_acctbal", + "t6"."c_mktsegment", + "t6"."c_comment", + "t4"."r_name" AS "region", + "t7"."o_totalprice" AS "amount", + CAST("t7"."o_orderdate" AS TIMESTAMP) AS "odate" + FROM "tpch_region" AS "t4" + INNER JOIN "tpch_nation" AS "t5" + ON "t4"."r_regionkey" = "t5"."n_regionkey" + INNER JOIN "tpch_customer" AS "t6" + ON "t6"."c_nationkey" = "t5"."n_nationkey" + INNER JOIN "tpch_orders" AS "t7" + ON "t7"."o_custkey" = "t6"."c_custkey" + ) AS "t9" WHERE - t9.region = t8.region - ) AS t10 + "t9"."region" = "t8"."region" + ) AS "t10" ) LIMIT 10 \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_subquery_in_filter_predicate/expr.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_subquery_in_filter_predicate/expr.sql index 404caac50463..215ec506d232 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_subquery_in_filter_predicate/expr.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_subquery_in_filter_predicate/expr.sql @@ -1,12 +1,12 @@ SELECT - t0.c, - t0.f, - t0.foo_id, - t0.bar_id -FROM star1 AS t0 + "t0"."c", + "t0"."f", + "t0"."foo_id", + "t0"."bar_id" +FROM "star1" AS "t0" WHERE - t0.f > ( + "t0"."f" > ( SELECT - AVG(t0.f) AS "Mean(f)" - FROM star1 AS t0 + AVG("t0"."f") AS "Mean(f)" + FROM "star1" AS "t0" ) \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_subquery_in_filter_predicate/expr2.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_subquery_in_filter_predicate/expr2.sql index fdbdef535ce4..6b73bf2aee0c 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_subquery_in_filter_predicate/expr2.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_subquery_in_filter_predicate/expr2.sql @@ -1,21 +1,21 @@ SELECT - t0.c, - t0.f, - t0.foo_id, - t0.bar_id -FROM star1 AS t0 + "t0"."c", + "t0"."f", + "t0"."foo_id", + "t0"."bar_id" +FROM "star1" AS "t0" WHERE - t0.f > ( + "t0"."f" > ( SELECT - AVG(t1.f) AS "Mean(f)" + AVG("t1"."f") AS "Mean(f)" FROM ( SELECT - t0.c, - t0.f, - t0.foo_id, - t0.bar_id - FROM star1 AS t0 + "t0"."c", + "t0"."f", + "t0"."foo_id", + "t0"."bar_id" + FROM "star1" AS "t0" WHERE - t0.foo_id = 'foo' - ) AS t1 + "t0"."foo_id" = 'foo' + ) AS "t1" ) \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_subquery_in_union/out.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_subquery_in_union/out.sql index 62595b73b907..6c8b142b59cb 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_subquery_in_union/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_subquery_in_union/out.sql @@ -1,49 +1,49 @@ -WITH t5 AS ( +WITH "t5" AS ( SELECT - t2.a, - t2.g, - t2.metric + "t2"."a", + "t2"."g", + "t2"."metric" FROM ( SELECT - t0.a, - t0.g, - SUM(t0.f) AS metric - FROM alltypes AS t0 + "t0"."a", + "t0"."g", + SUM("t0"."f") AS "metric" + FROM "alltypes" AS "t0" GROUP BY 1, 2 - ) AS t2 + ) AS "t2" INNER JOIN ( SELECT - t0.a, - t0.g, - SUM(t0.f) AS metric - FROM alltypes AS t0 + "t0"."a", + "t0"."g", + SUM("t0"."f") AS "metric" + FROM "alltypes" AS "t0" GROUP BY 1, 2 - ) AS t4 - ON t2.g = t4.g -), t1 AS ( + ) AS "t4" + ON "t2"."g" = "t4"."g" +), "t1" AS ( SELECT - t0.a, - t0.g, - SUM(t0.f) AS metric - FROM alltypes AS t0 + "t0"."a", + "t0"."g", + SUM("t0"."f") AS "metric" + FROM "alltypes" AS "t0" GROUP BY 1, 2 ) SELECT - t8.a, - t8.g, - t8.metric + "t8"."a", + "t8"."g", + "t8"."metric" FROM ( SELECT * - FROM t5 AS t6 + FROM "t5" AS "t6" UNION ALL SELECT * - FROM t5 AS t7 -) AS t8 \ No newline at end of file + FROM "t5" AS "t7" +) AS "t8" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_subquery_used_for_self_join/out.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_subquery_used_for_self_join/out.sql index 029dae462da1..4039868d3eac 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_subquery_used_for_self_join/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_subquery_used_for_self_join/out.sql @@ -1,31 +1,31 @@ -WITH t1 AS ( +WITH "t1" AS ( SELECT - t0.g, - t0.a, - t0.b, - SUM(t0.f) AS total - FROM alltypes AS t0 + "t0"."g", + "t0"."a", + "t0"."b", + SUM("t0"."f") AS "total" + FROM "alltypes" AS "t0" GROUP BY 1, 2, 3 ) SELECT - t6.g, - MAX(t6.total - t6.total_right) AS metric + "t6"."g", + MAX("t6"."total" - "t6"."total_right") AS "metric" FROM ( SELECT - t3.g, - t3.a, - t3.b, - t3.total, - t5.g AS g_right, - t5.a AS a_right, - t5.b AS b_right, - t5.total AS total_right - FROM t1 AS t3 - INNER JOIN t1 AS t5 - ON t3.a = t5.b -) AS t6 + "t3"."g", + "t3"."a", + "t3"."b", + "t3"."total", + "t5"."g" AS "g_right", + "t5"."a" AS "a_right", + "t5"."b" AS "b_right", + "t5"."total" AS "total_right" + FROM "t1" AS "t3" + INNER JOIN "t1" AS "t5" + ON "t3"."a" = "t5"."b" +) AS "t6" GROUP BY 1 \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_topk_analysis_bug/out.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_topk_analysis_bug/out.sql index 54240af94422..ce336c1dbd99 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_topk_analysis_bug/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_topk_analysis_bug/out.sql @@ -1,38 +1,38 @@ -WITH t1 AS ( +WITH "t1" AS ( SELECT - t0.dest, - t0.origin, - t0.arrdelay - FROM airlines AS t0 + "t0"."dest", + "t0"."origin", + "t0"."arrdelay" + FROM "airlines" AS "t0" WHERE - t0.dest IN ('ORD', 'JFK', 'SFO') + "t0"."dest" IN ('ORD', 'JFK', 'SFO') ) SELECT - t8.origin, + "t8"."origin", COUNT(*) AS "CountStar()" FROM ( SELECT - t3.dest, - t3.origin, - t3.arrdelay - FROM t1 AS t3 + "t3"."dest", + "t3"."origin", + "t3"."arrdelay" + FROM "t1" AS "t3" SEMI JOIN ( SELECT - t4.dest, - t4."Mean(arrdelay)" + "t4"."dest", + "t4"."Mean(arrdelay)" FROM ( SELECT - t2.dest, - AVG(t2.arrdelay) AS "Mean(arrdelay)" - FROM t1 AS t2 + "t2"."dest", + AVG("t2"."arrdelay") AS "Mean(arrdelay)" + FROM "t1" AS "t2" GROUP BY 1 - ) AS t4 + ) AS "t4" ORDER BY - t4."Mean(arrdelay)" DESC + "t4"."Mean(arrdelay)" DESC LIMIT 10 - ) AS t7 - ON t3.dest = t7.dest -) AS t8 + ) AS "t7" + ON "t3"."dest" = "t7"."dest" +) AS "t8" GROUP BY 1 \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_topk_operation/e1.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_topk_operation/e1.sql index 6d86baa0190c..054cc889c755 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_topk_operation/e1.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_topk_operation/e1.sql @@ -1,24 +1,24 @@ SELECT - t1.foo, - t1.bar, - t1.city, - t1.v1, - t1.v2 -FROM tbl AS t1 + "t1"."foo", + "t1"."bar", + "t1"."city", + "t1"."v1", + "t1"."v2" +FROM "tbl" AS "t1" SEMI JOIN ( SELECT - t2.city, - t2."Mean(v2)" + "t2"."city", + "t2"."Mean(v2)" FROM ( SELECT - t0.city, - AVG(t0.v2) AS "Mean(v2)" - FROM tbl AS t0 + "t0"."city", + AVG("t0"."v2") AS "Mean(v2)" + FROM "tbl" AS "t0" GROUP BY 1 - ) AS t2 + ) AS "t2" ORDER BY - t2."Mean(v2)" DESC + "t2"."Mean(v2)" DESC LIMIT 10 -) AS t5 - ON t1.city = t5.city \ No newline at end of file +) AS "t5" + ON "t1"."city" = "t5"."city" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_topk_operation/e2.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_topk_operation/e2.sql index 53e239ad98c8..d6c6b84b848b 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_topk_operation/e2.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_topk_operation/e2.sql @@ -1,24 +1,24 @@ SELECT - t1.foo, - t1.bar, - t1.city, - t1.v1, - t1.v2 -FROM tbl AS t1 + "t1"."foo", + "t1"."bar", + "t1"."city", + "t1"."v1", + "t1"."v2" +FROM "tbl" AS "t1" SEMI JOIN ( SELECT - t2.city, - t2."Count(city)" + "t2"."city", + "t2"."Count(city)" FROM ( SELECT - t0.city, - COUNT(t0.city) AS "Count(city)" - FROM tbl AS t0 + "t0"."city", + COUNT("t0"."city") AS "Count(city)" + FROM "tbl" AS "t0" GROUP BY 1 - ) AS t2 + ) AS "t2" ORDER BY - t2."Count(city)" DESC + "t2"."Count(city)" DESC LIMIT 10 -) AS t5 - ON t1.city = t5.city \ No newline at end of file +) AS "t5" + ON "t1"."city" = "t5"."city" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_topk_predicate_pushdown_bug/out.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_topk_predicate_pushdown_bug/out.sql index b81d1c1f474a..e9c68902a83c 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_topk_predicate_pushdown_bug/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_topk_predicate_pushdown_bug/out.sql @@ -1,50 +1,50 @@ SELECT - t3.c_custkey, - t3.c_name, - t3.c_address, - t3.c_nationkey, - t3.c_phone, - t3.c_acctbal, - t3.c_mktsegment, - t3.c_comment, - t4.n_name, - t5.r_name -FROM tpch_customer AS t3 -INNER JOIN tpch_nation AS t4 - ON t3.c_nationkey = t4.n_nationkey -INNER JOIN tpch_region AS t5 - ON t4.n_regionkey = t5.r_regionkey + "t3"."c_custkey", + "t3"."c_name", + "t3"."c_address", + "t3"."c_nationkey", + "t3"."c_phone", + "t3"."c_acctbal", + "t3"."c_mktsegment", + "t3"."c_comment", + "t4"."n_name", + "t5"."r_name" +FROM "tpch_customer" AS "t3" +INNER JOIN "tpch_nation" AS "t4" + ON "t3"."c_nationkey" = "t4"."n_nationkey" +INNER JOIN "tpch_region" AS "t5" + ON "t4"."n_regionkey" = "t5"."r_regionkey" SEMI JOIN ( SELECT - t7.n_name, - t7."Sum(c_acctbal)" + "t7"."n_name", + "t7"."Sum(c_acctbal)" FROM ( SELECT - t6.n_name, - SUM(t6.c_acctbal) AS "Sum(c_acctbal)" + "t6"."n_name", + SUM("t6"."c_acctbal") AS "Sum(c_acctbal)" FROM ( SELECT - t3.c_custkey, - t3.c_name, - t3.c_address, - t3.c_nationkey, - t3.c_phone, - t3.c_acctbal, - t3.c_mktsegment, - t3.c_comment, - t4.n_name, - t5.r_name - FROM tpch_customer AS t3 - INNER JOIN tpch_nation AS t4 - ON t3.c_nationkey = t4.n_nationkey - INNER JOIN tpch_region AS t5 - ON t4.n_regionkey = t5.r_regionkey - ) AS t6 + "t3"."c_custkey", + "t3"."c_name", + "t3"."c_address", + "t3"."c_nationkey", + "t3"."c_phone", + "t3"."c_acctbal", + "t3"."c_mktsegment", + "t3"."c_comment", + "t4"."n_name", + "t5"."r_name" + FROM "tpch_customer" AS "t3" + INNER JOIN "tpch_nation" AS "t4" + ON "t3"."c_nationkey" = "t4"."n_nationkey" + INNER JOIN "tpch_region" AS "t5" + ON "t4"."n_regionkey" = "t5"."r_regionkey" + ) AS "t6" GROUP BY 1 - ) AS t7 + ) AS "t7" ORDER BY - t7."Sum(c_acctbal)" DESC + "t7"."Sum(c_acctbal)" DESC LIMIT 10 -) AS t10 - ON t4.n_name = t10.n_name \ No newline at end of file +) AS "t10" + ON "t4"."n_name" = "t10"."n_name" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_topk_to_aggregate/out.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_topk_to_aggregate/out.sql index fe46767993fe..10470883609e 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_topk_to_aggregate/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_topk_to_aggregate/out.sql @@ -1,14 +1,14 @@ SELECT - t1.dest, - t1."Mean(arrdelay)" + "t1"."dest", + "t1"."Mean(arrdelay)" FROM ( SELECT - t0.dest, - AVG(t0.arrdelay) AS "Mean(arrdelay)" - FROM airlines AS t0 + "t0"."dest", + AVG("t0"."arrdelay") AS "Mean(arrdelay)" + FROM "airlines" AS "t0" GROUP BY 1 -) AS t1 +) AS "t1" ORDER BY - t1."Mean(arrdelay)" DESC + "t1"."Mean(arrdelay)" DESC LIMIT 10 \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_tpch_self_join_failure/out.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_tpch_self_join_failure/out.sql index 6a6108dcf40c..bf5316341bdf 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_tpch_self_join_failure/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_tpch_self_join_failure/out.sql @@ -1,32 +1,32 @@ -WITH t9 AS ( +WITH "t9" AS ( SELECT - t8.region, - EXTRACT(year FROM t8.odate) AS year, - CAST(SUM(t8.amount) AS DOUBLE) AS total + "t8"."region", + EXTRACT(year FROM "t8"."odate") AS "year", + CAST(SUM("t8"."amount") AS DOUBLE) AS "total" FROM ( SELECT - t4.r_name AS region, - t5.n_name AS nation, - t7.o_totalprice AS amount, - CAST(t7.o_orderdate AS TIMESTAMP) AS odate - FROM tpch_region AS t4 - INNER JOIN tpch_nation AS t5 - ON t4.r_regionkey = t5.n_regionkey - INNER JOIN tpch_customer AS t6 - ON t6.c_nationkey = t5.n_nationkey - INNER JOIN tpch_orders AS t7 - ON t7.o_custkey = t6.c_custkey - ) AS t8 + "t4"."r_name" AS "region", + "t5"."n_name" AS "nation", + "t7"."o_totalprice" AS "amount", + CAST("t7"."o_orderdate" AS TIMESTAMP) AS "odate" + FROM "tpch_region" AS "t4" + INNER JOIN "tpch_nation" AS "t5" + ON "t4"."r_regionkey" = "t5"."n_regionkey" + INNER JOIN "tpch_customer" AS "t6" + ON "t6"."c_nationkey" = "t5"."n_nationkey" + INNER JOIN "tpch_orders" AS "t7" + ON "t7"."o_custkey" = "t6"."c_custkey" + ) AS "t8" GROUP BY 1, 2 ) SELECT - t11.region, - t11.year, - t11.total - t13.total AS yoy_change -FROM t9 AS t11 -INNER JOIN t9 AS t13 - ON t11.year = ( - t13.year - CAST(1 AS TINYINT) + "t11"."region", + "t11"."year", + "t11"."total" - "t13"."total" AS "yoy_change" +FROM "t9" AS "t11" +INNER JOIN "t9" AS "t13" + ON "t11"."year" = ( + "t13"."year" - CAST(1 AS TINYINT) ) \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_where_analyze_scalar_op/out.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_where_analyze_scalar_op/out.sql index 102f8d7fc152..e66e28b99984 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_where_analyze_scalar_op/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_where_analyze_scalar_op/out.sql @@ -2,25 +2,25 @@ SELECT COUNT(*) AS "CountStar()" FROM ( SELECT - t0.id, - t0.bool_col, - t0.tinyint_col, - t0.smallint_col, - t0.int_col, - t0.bigint_col, - t0.float_col, - t0.double_col, - t0.date_string_col, - t0.string_col, - t0.timestamp_col, - t0.year, - t0.month - FROM functional_alltypes AS t0 + "t0"."id", + "t0"."bool_col", + "t0"."tinyint_col", + "t0"."smallint_col", + "t0"."int_col", + "t0"."bigint_col", + "t0"."float_col", + "t0"."double_col", + "t0"."date_string_col", + "t0"."string_col", + "t0"."timestamp_col", + "t0"."year", + "t0"."month" + FROM "functional_alltypes" AS "t0" WHERE - t0.timestamp_col < ( + "t0"."timestamp_col" < ( MAKE_TIMESTAMP(2010, 1, 1, 0, 0, 0.0) + INTERVAL '3' MONTH ) - AND t0.timestamp_col < ( + AND "t0"."timestamp_col" < ( CAST(CURRENT_TIMESTAMP AS TIMESTAMP) + INTERVAL '10' DAY ) -) AS t1 \ No newline at end of file +) AS "t1" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_where_no_pushdown_possible/out.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_where_no_pushdown_possible/out.sql index e38225fffe4e..0ebb0d67033b 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_where_no_pushdown_possible/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_where_no_pushdown_possible/out.sql @@ -1,19 +1,19 @@ SELECT - t4.c, - t4.f, - t4.foo_id, - t4.bar_id, - t4.diff + "t4"."c", + "t4"."f", + "t4"."foo_id", + "t4"."bar_id", + "t4"."diff" FROM ( SELECT - t2.c, - t2.f, - t2.foo_id, - t2.bar_id, - t2.f - t3.value1 AS diff - FROM star1 AS t2 - INNER JOIN star2 AS t3 - ON t2.foo_id = t3.foo_id -) AS t4 + "t2"."c", + "t2"."f", + "t2"."foo_id", + "t2"."bar_id", + "t2"."f" - "t3"."value1" AS "diff" + FROM "star1" AS "t2" + INNER JOIN "star2" AS "t3" + ON "t2"."foo_id" = "t3"."foo_id" +) AS "t4" WHERE - t4.diff > CAST(1 AS TINYINT) \ No newline at end of file + "t4"."diff" > CAST(1 AS TINYINT) \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_where_with_between/out.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_where_with_between/out.sql index 34036b117531..1cf616302cf5 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_where_with_between/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_where_with_between/out.sql @@ -1,15 +1,16 @@ SELECT - t0.a, - t0.b, - t0.c, - t0.d, - t0.e, - t0.f, - t0.g, - t0.h, - t0.i, - t0.j, - t0.k -FROM alltypes AS t0 + "t0"."a", + "t0"."b", + "t0"."c", + "t0"."d", + "t0"."e", + "t0"."f", + "t0"."g", + "t0"."h", + "t0"."i", + "t0"."j", + "t0"."k" +FROM "alltypes" AS "t0" WHERE - t0.a > CAST(0 AS TINYINT) AND t0.f BETWEEN CAST(0 AS TINYINT) AND CAST(1 AS TINYINT) \ No newline at end of file + "t0"."a" > CAST(0 AS TINYINT) + AND "t0"."f" BETWEEN CAST(0 AS TINYINT) AND CAST(1 AS TINYINT) \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_select_sql/test_where_with_join/out.sql b/ibis/backends/tests/sql/snapshots/test_select_sql/test_where_with_join/out.sql index 338494c9c8e1..e9dcc1060340 100644 --- a/ibis/backends/tests/sql/snapshots/test_select_sql/test_where_with_join/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_select_sql/test_where_with_join/out.sql @@ -1,21 +1,21 @@ SELECT - t4.c, - t4.f, - t4.foo_id, - t4.bar_id, - t4.value1, - t4.value3 + "t4"."c", + "t4"."f", + "t4"."foo_id", + "t4"."bar_id", + "t4"."value1", + "t4"."value3" FROM ( SELECT - t2.c, - t2.f, - t2.foo_id, - t2.bar_id, - t3.value1, - t3.value3 - FROM star1 AS t2 - INNER JOIN star2 AS t3 - ON t2.foo_id = t3.foo_id -) AS t4 + "t2"."c", + "t2"."f", + "t2"."foo_id", + "t2"."bar_id", + "t3"."value1", + "t3"."value3" + FROM "star1" AS "t2" + INNER JOIN "star2" AS "t3" + ON "t2"."foo_id" = "t3"."foo_id" +) AS "t4" WHERE - t4.f > CAST(0 AS TINYINT) AND t4.value3 < CAST(1000 AS SMALLINT) \ No newline at end of file + "t4"."f" > CAST(0 AS TINYINT) AND "t4"."value3" < CAST(1000 AS SMALLINT) \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_sql/test_aggregate/having_count/out.sql b/ibis/backends/tests/sql/snapshots/test_sql/test_aggregate/having_count/out.sql index 35e4fe0adc24..65116af02a75 100644 --- a/ibis/backends/tests/sql/snapshots/test_sql/test_aggregate/having_count/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_sql/test_aggregate/having_count/out.sql @@ -1,14 +1,14 @@ SELECT - t1.foo_id, - t1.total + "t1"."foo_id", + "t1"."total" FROM ( SELECT - t0.foo_id, - SUM(t0.f) AS total, + "t0"."foo_id", + SUM("t0"."f") AS "total", COUNT(*) AS "CountStar()" - FROM star1 AS t0 + FROM "star1" AS "t0" GROUP BY 1 -) AS t1 +) AS "t1" WHERE - t1."CountStar()" > CAST(100 AS TINYINT) \ No newline at end of file + "t1"."CountStar()" > CAST(100 AS TINYINT) \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_sql/test_aggregate/having_sum/out.sql b/ibis/backends/tests/sql/snapshots/test_sql/test_aggregate/having_sum/out.sql index 47945167c00a..bb81eda40239 100644 --- a/ibis/backends/tests/sql/snapshots/test_sql/test_aggregate/having_sum/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_sql/test_aggregate/having_sum/out.sql @@ -1,13 +1,13 @@ SELECT - t1.foo_id, - t1.total + "t1"."foo_id", + "t1"."total" FROM ( SELECT - t0.foo_id, - SUM(t0.f) AS total - FROM star1 AS t0 + "t0"."foo_id", + SUM("t0"."f") AS "total" + FROM "star1" AS "t0" GROUP BY 1 -) AS t1 +) AS "t1" WHERE - t1.total > CAST(10 AS TINYINT) \ No newline at end of file + "t1"."total" > CAST(10 AS TINYINT) \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_sql/test_aggregate/single/out.sql b/ibis/backends/tests/sql/snapshots/test_sql/test_aggregate/single/out.sql index dbf4aadac203..34e180525498 100644 --- a/ibis/backends/tests/sql/snapshots/test_sql/test_aggregate/single/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_sql/test_aggregate/single/out.sql @@ -1,6 +1,6 @@ SELECT - t0.foo_id, - SUM(t0.f) AS total -FROM star1 AS t0 + "t0"."foo_id", + SUM("t0"."f") AS "total" +FROM "star1" AS "t0" GROUP BY 1 \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_sql/test_aggregate/two/out.sql b/ibis/backends/tests/sql/snapshots/test_sql/test_aggregate/two/out.sql index be9b430bd3d3..c5b36f1f25d4 100644 --- a/ibis/backends/tests/sql/snapshots/test_sql/test_aggregate/two/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_sql/test_aggregate/two/out.sql @@ -1,8 +1,8 @@ SELECT - t0.foo_id, - t0.bar_id, - SUM(t0.f) AS total -FROM star1 AS t0 + "t0"."foo_id", + "t0"."bar_id", + SUM("t0"."f") AS "total" +FROM "star1" AS "t0" GROUP BY 1, 2 \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_sql/test_between/out.sql b/ibis/backends/tests/sql/snapshots/test_sql/test_between/out.sql index c4f686443cee..af7f94c32409 100644 --- a/ibis/backends/tests/sql/snapshots/test_sql/test_between/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_sql/test_between/out.sql @@ -1,3 +1,3 @@ SELECT - t0.double_col BETWEEN CAST(5 AS TINYINT) AND CAST(10 AS TINYINT) AS tmp -FROM functional_alltypes AS t0 \ No newline at end of file + "t0"."double_col" BETWEEN CAST(5 AS TINYINT) AND CAST(10 AS TINYINT) AS "tmp" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_sql/test_boolean_conjunction/and/out.sql b/ibis/backends/tests/sql/snapshots/test_sql/test_boolean_conjunction/and/out.sql index d2e722d4fa18..a288a6c325f4 100644 --- a/ibis/backends/tests/sql/snapshots/test_sql/test_boolean_conjunction/and/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_sql/test_boolean_conjunction/and/out.sql @@ -1,7 +1,8 @@ SELECT ( - t0.double_col > CAST(0 AS TINYINT) - ) AND ( - t0.double_col < CAST(5 AS TINYINT) - ) AS tmp -FROM functional_alltypes AS t0 \ No newline at end of file + "t0"."double_col" > CAST(0 AS TINYINT) + ) + AND ( + "t0"."double_col" < CAST(5 AS TINYINT) + ) AS "tmp" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_sql/test_boolean_conjunction/or/out.sql b/ibis/backends/tests/sql/snapshots/test_sql/test_boolean_conjunction/or/out.sql index 4b0542464299..8e7e85a06eef 100644 --- a/ibis/backends/tests/sql/snapshots/test_sql/test_boolean_conjunction/or/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_sql/test_boolean_conjunction/or/out.sql @@ -1,7 +1,8 @@ SELECT ( - t0.double_col < CAST(0 AS TINYINT) - ) OR ( - t0.double_col > CAST(5 AS TINYINT) - ) AS tmp -FROM functional_alltypes AS t0 \ No newline at end of file + "t0"."double_col" < CAST(0 AS TINYINT) + ) + OR ( + "t0"."double_col" > CAST(5 AS TINYINT) + ) AS "tmp" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_sql/test_coalesce/out.sql b/ibis/backends/tests/sql/snapshots/test_sql/test_coalesce/out.sql index df5a9329fcb4..978ba8ae9e67 100644 --- a/ibis/backends/tests/sql/snapshots/test_sql/test_coalesce/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_sql/test_coalesce/out.sql @@ -1,7 +1,11 @@ SELECT COALESCE( - CASE WHEN t0.double_col > CAST(30 AS TINYINT) THEN t0.double_col ELSE NULL END, + CASE + WHEN "t0"."double_col" > CAST(30 AS TINYINT) + THEN "t0"."double_col" + ELSE NULL + END, NULL, - t0.float_col - ) AS tmp -FROM functional_alltypes AS t0 \ No newline at end of file + "t0"."float_col" + ) AS "tmp" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_sql/test_comparisons/eq/out.sql b/ibis/backends/tests/sql/snapshots/test_sql/test_comparisons/eq/out.sql index 2ad44306e1cd..a21e83164c3e 100644 --- a/ibis/backends/tests/sql/snapshots/test_sql/test_comparisons/eq/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_sql/test_comparisons/eq/out.sql @@ -1,3 +1,3 @@ SELECT - t0.double_col = CAST(5 AS TINYINT) AS tmp -FROM functional_alltypes AS t0 \ No newline at end of file + "t0"."double_col" = CAST(5 AS TINYINT) AS "tmp" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_sql/test_comparisons/ge/out.sql b/ibis/backends/tests/sql/snapshots/test_sql/test_comparisons/ge/out.sql index 8b722a819754..3dd5fffe7afe 100644 --- a/ibis/backends/tests/sql/snapshots/test_sql/test_comparisons/ge/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_sql/test_comparisons/ge/out.sql @@ -1,3 +1,3 @@ SELECT - t0.double_col >= CAST(5 AS TINYINT) AS tmp -FROM functional_alltypes AS t0 \ No newline at end of file + "t0"."double_col" >= CAST(5 AS TINYINT) AS "tmp" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_sql/test_comparisons/gt/out.sql b/ibis/backends/tests/sql/snapshots/test_sql/test_comparisons/gt/out.sql index ca8c8d134d60..d1b071460150 100644 --- a/ibis/backends/tests/sql/snapshots/test_sql/test_comparisons/gt/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_sql/test_comparisons/gt/out.sql @@ -1,3 +1,3 @@ SELECT - t0.double_col > CAST(5 AS TINYINT) AS tmp -FROM functional_alltypes AS t0 \ No newline at end of file + "t0"."double_col" > CAST(5 AS TINYINT) AS "tmp" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_sql/test_comparisons/le/out.sql b/ibis/backends/tests/sql/snapshots/test_sql/test_comparisons/le/out.sql index 53bf7d0d2dbb..b09e7d427b7a 100644 --- a/ibis/backends/tests/sql/snapshots/test_sql/test_comparisons/le/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_sql/test_comparisons/le/out.sql @@ -1,3 +1,3 @@ SELECT - t0.double_col <= CAST(5 AS TINYINT) AS tmp -FROM functional_alltypes AS t0 \ No newline at end of file + "t0"."double_col" <= CAST(5 AS TINYINT) AS "tmp" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_sql/test_comparisons/lt/out.sql b/ibis/backends/tests/sql/snapshots/test_sql/test_comparisons/lt/out.sql index 627be1840789..44e538076f9d 100644 --- a/ibis/backends/tests/sql/snapshots/test_sql/test_comparisons/lt/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_sql/test_comparisons/lt/out.sql @@ -1,3 +1,3 @@ SELECT - t0.double_col < CAST(5 AS TINYINT) AS tmp -FROM functional_alltypes AS t0 \ No newline at end of file + "t0"."double_col" < CAST(5 AS TINYINT) AS "tmp" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_sql/test_comparisons/ne/out.sql b/ibis/backends/tests/sql/snapshots/test_sql/test_comparisons/ne/out.sql index 685a418a8eb4..e9b9c60dcac8 100644 --- a/ibis/backends/tests/sql/snapshots/test_sql/test_comparisons/ne/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_sql/test_comparisons/ne/out.sql @@ -1,3 +1,3 @@ SELECT - t0.double_col <> CAST(5 AS TINYINT) AS tmp -FROM functional_alltypes AS t0 \ No newline at end of file + "t0"."double_col" <> CAST(5 AS TINYINT) AS "tmp" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_sql/test_cte_factor_distinct_but_equal/out.sql b/ibis/backends/tests/sql/snapshots/test_sql/test_cte_factor_distinct_but_equal/out.sql index 1aa27939686a..47a9c20dfbed 100644 --- a/ibis/backends/tests/sql/snapshots/test_sql/test_cte_factor_distinct_but_equal/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_sql/test_cte_factor_distinct_but_equal/out.sql @@ -1,20 +1,20 @@ SELECT - t3.g, - t3.metric + "t3"."g", + "t3"."metric" FROM ( SELECT - t0.g, - SUM(t0.f) AS metric - FROM alltypes AS t0 + "t0"."g", + SUM("t0"."f") AS "metric" + FROM "alltypes" AS "t0" GROUP BY 1 -) AS t3 +) AS "t3" INNER JOIN ( SELECT - t1.g, - SUM(t1.f) AS metric - FROM alltypes AS t1 + "t1"."g", + SUM("t1"."f") AS "metric" + FROM "alltypes" AS "t1" GROUP BY 1 -) AS t6 - ON t3.g = t6.g \ No newline at end of file +) AS "t6" + ON "t3"."g" = "t6"."g" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_sql/test_distinct/count_distinct/out.sql b/ibis/backends/tests/sql/snapshots/test_sql/test_distinct/count_distinct/out.sql index 37382bcf5149..402fb340b779 100644 --- a/ibis/backends/tests/sql/snapshots/test_sql/test_distinct/count_distinct/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_sql/test_distinct/count_distinct/out.sql @@ -1,3 +1,3 @@ SELECT - COUNT(DISTINCT t0.int_col) AS nunique -FROM functional_alltypes AS t0 \ No newline at end of file + COUNT(DISTINCT "t0"."int_col") AS "nunique" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_sql/test_distinct/group_by_count_distinct/out.sql b/ibis/backends/tests/sql/snapshots/test_sql/test_distinct/group_by_count_distinct/out.sql index 14b6c6d83477..c46d3552f709 100644 --- a/ibis/backends/tests/sql/snapshots/test_sql/test_distinct/group_by_count_distinct/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_sql/test_distinct/group_by_count_distinct/out.sql @@ -1,6 +1,6 @@ SELECT - t0.string_col, - COUNT(DISTINCT t0.int_col) AS nunique -FROM functional_alltypes AS t0 + "t0"."string_col", + COUNT(DISTINCT "t0"."int_col") AS "nunique" +FROM "functional_alltypes" AS "t0" GROUP BY 1 \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_sql/test_distinct/projection_distinct/out.sql b/ibis/backends/tests/sql/snapshots/test_sql/test_distinct/projection_distinct/out.sql index 483b4fef6f49..098405dd6f82 100644 --- a/ibis/backends/tests/sql/snapshots/test_sql/test_distinct/projection_distinct/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_sql/test_distinct/projection_distinct/out.sql @@ -2,7 +2,7 @@ SELECT DISTINCT * FROM ( SELECT - t0.string_col, - t0.int_col - FROM functional_alltypes AS t0 -) AS t1 \ No newline at end of file + "t0"."string_col", + "t0"."int_col" + FROM "functional_alltypes" AS "t0" +) AS "t1" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_sql/test_distinct/single_column_projection_distinct/out.sql b/ibis/backends/tests/sql/snapshots/test_sql/test_distinct/single_column_projection_distinct/out.sql index d38aa10366c4..0913c0727447 100644 --- a/ibis/backends/tests/sql/snapshots/test_sql/test_distinct/single_column_projection_distinct/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_sql/test_distinct/single_column_projection_distinct/out.sql @@ -2,6 +2,6 @@ SELECT DISTINCT * FROM ( SELECT - t0.string_col - FROM functional_alltypes AS t0 -) AS t1 \ No newline at end of file + "t0"."string_col" + FROM "functional_alltypes" AS "t0" +) AS "t1" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_sql/test_distinct/table_distinct/out.sql b/ibis/backends/tests/sql/snapshots/test_sql/test_distinct/table_distinct/out.sql index dd4c570ec517..22cb0aee7152 100644 --- a/ibis/backends/tests/sql/snapshots/test_sql/test_distinct/table_distinct/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_sql/test_distinct/table_distinct/out.sql @@ -1,3 +1,3 @@ SELECT DISTINCT * -FROM functional_alltypes AS t0 \ No newline at end of file +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_sql/test_exists/e1.sql b/ibis/backends/tests/sql/snapshots/test_sql/test_exists/e1.sql index b0be257b254f..f62872c94e58 100644 --- a/ibis/backends/tests/sql/snapshots/test_sql/test_exists/e1.sql +++ b/ibis/backends/tests/sql/snapshots/test_sql/test_exists/e1.sql @@ -1,13 +1,13 @@ SELECT - t0.key1, - t0.key2, - t0.value1 -FROM foo_t AS t0 + "t0"."key1", + "t0"."key2", + "t0"."value1" +FROM "foo_t" AS "t0" WHERE EXISTS( SELECT CAST(1 AS TINYINT) AS "1" - FROM bar_t AS t1 + FROM "bar_t" AS "t1" WHERE - t0.key1 = t1.key1 + "t0"."key1" = "t1"."key1" ) \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_sql/test_exists/e2.sql b/ibis/backends/tests/sql/snapshots/test_sql/test_exists/e2.sql index f397c2b7251e..0493676fd923 100644 --- a/ibis/backends/tests/sql/snapshots/test_sql/test_exists/e2.sql +++ b/ibis/backends/tests/sql/snapshots/test_sql/test_exists/e2.sql @@ -1,17 +1,17 @@ SELECT - t0.key1, - t0.key2, - t0.value1 -FROM foo_t AS t0 + "t0"."key1", + "t0"."key2", + "t0"."value1" +FROM "foo_t" AS "t0" WHERE EXISTS( SELECT CAST(1 AS TINYINT) AS "1" - FROM bar_t AS t1 + FROM "bar_t" AS "t1" WHERE ( - t0.key1 = t1.key1 + "t0"."key1" = "t1"."key1" ) AND ( - t1.key2 = 'foo' + "t1"."key2" = 'foo' ) ) \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_sql/test_filter_group_by_agg_with_same_name/out.sql b/ibis/backends/tests/sql/snapshots/test_sql/test_filter_group_by_agg_with_same_name/out.sql index c0ba260a78bb..da36f3727637 100644 --- a/ibis/backends/tests/sql/snapshots/test_sql/test_filter_group_by_agg_with_same_name/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_sql/test_filter_group_by_agg_with_same_name/out.sql @@ -1,13 +1,13 @@ SELECT - t1.int_col, - t1.bigint_col + "t1"."int_col", + "t1"."bigint_col" FROM ( SELECT - t0.int_col, - SUM(t0.bigint_col) AS bigint_col - FROM t AS t0 + "t0"."int_col", + SUM("t0"."bigint_col") AS "bigint_col" + FROM "t" AS "t0" GROUP BY 1 -) AS t1 +) AS "t1" WHERE - t1.bigint_col = CAST(60 AS TINYINT) \ No newline at end of file + "t1"."bigint_col" = CAST(60 AS TINYINT) \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_sql/test_gh_1045/out.sql b/ibis/backends/tests/sql/snapshots/test_sql/test_gh_1045/out.sql index ebf908ac0397..c192b87e763e 100644 --- a/ibis/backends/tests/sql/snapshots/test_sql/test_gh_1045/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_sql/test_gh_1045/out.sql @@ -1,37 +1,37 @@ SELECT - t5.t1_id1, - t5.t1_val1, - t9.id3, - t9.val2, - t9.dt, - t9.t3_val2, - t9.id2a, - t9.id2b, - t9.val2_right + "t5"."t1_id1", + "t5"."t1_val1", + "t9"."id3", + "t9"."val2", + "t9"."dt", + "t9"."t3_val2", + "t9"."id2a", + "t9"."id2b", + "t9"."val2_right" FROM ( SELECT - t0.id1 AS t1_id1, - t0.val1 AS t1_val1 - FROM test1 AS t0 -) AS t5 + "t0"."id1" AS "t1_id1", + "t0"."val1" AS "t1_val1" + FROM "test1" AS "t0" +) AS "t5" LEFT OUTER JOIN ( SELECT - t7.id3, - t7.val2, - t7.dt, - t7.t3_val2, - t3.id2a, - t3.id2b, - t3.val2 AS val2_right + "t7"."id3", + "t7"."val2", + "t7"."dt", + "t7"."t3_val2", + "t3"."id2a", + "t3"."id2b", + "t3"."val2" AS "val2_right" FROM ( SELECT - CAST(t1.id3 AS BIGINT) AS id3, - t1.val2, - t1.dt, - CAST(t1.id3 AS BIGINT) AS t3_val2 - FROM test3 AS t1 - ) AS t7 - INNER JOIN test2 AS t3 - ON t3.id2b = t7.id3 -) AS t9 - ON t5.t1_id1 = t9.id2a \ No newline at end of file + CAST("t1"."id3" AS BIGINT) AS "id3", + "t1"."val2", + "t1"."dt", + CAST("t1"."id3" AS BIGINT) AS "t3_val2" + FROM "test3" AS "t1" + ) AS "t7" + INNER JOIN "test2" AS "t3" + ON "t3"."id2b" = "t7"."id3" +) AS "t9" + ON "t5"."t1_id1" = "t9"."id2a" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_sql/test_isnull_notnull/isnull/out.sql b/ibis/backends/tests/sql/snapshots/test_sql/test_isnull_notnull/isnull/out.sql index d06c0383bb09..415c2932e0be 100644 --- a/ibis/backends/tests/sql/snapshots/test_sql/test_isnull_notnull/isnull/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_sql/test_isnull_notnull/isnull/out.sql @@ -1,3 +1,3 @@ SELECT - t0.double_col IS NULL AS tmp -FROM functional_alltypes AS t0 \ No newline at end of file + "t0"."double_col" IS NULL AS "tmp" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_sql/test_isnull_notnull/notnull/out.sql b/ibis/backends/tests/sql/snapshots/test_sql/test_isnull_notnull/notnull/out.sql index f33c3466083a..567d20198fcb 100644 --- a/ibis/backends/tests/sql/snapshots/test_sql/test_isnull_notnull/notnull/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_sql/test_isnull_notnull/notnull/out.sql @@ -1,3 +1,3 @@ SELECT - NOT t0.double_col IS NULL AS tmp -FROM functional_alltypes AS t0 \ No newline at end of file + NOT "t0"."double_col" IS NULL AS "tmp" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_sql/test_join_just_materialized/out.sql b/ibis/backends/tests/sql/snapshots/test_sql/test_join_just_materialized/out.sql index 28ef4cadbb22..03ed7e8d464c 100644 --- a/ibis/backends/tests/sql/snapshots/test_sql/test_join_just_materialized/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_sql/test_join_just_materialized/out.sql @@ -1,21 +1,21 @@ SELECT - t3.n_nationkey, - t3.n_name, - t3.n_regionkey, - t3.n_comment, - t4.r_regionkey, - t4.r_name, - t4.r_comment, - t5.c_custkey, - t5.c_name, - t5.c_address, - t5.c_nationkey, - t5.c_phone, - t5.c_acctbal, - t5.c_mktsegment, - t5.c_comment -FROM tpch_nation AS t3 -INNER JOIN tpch_region AS t4 - ON t3.n_regionkey = t4.r_regionkey -INNER JOIN tpch_customer AS t5 - ON t3.n_nationkey = t5.c_nationkey \ No newline at end of file + "t3"."n_nationkey", + "t3"."n_name", + "t3"."n_regionkey", + "t3"."n_comment", + "t4"."r_regionkey", + "t4"."r_name", + "t4"."r_comment", + "t5"."c_custkey", + "t5"."c_name", + "t5"."c_address", + "t5"."c_nationkey", + "t5"."c_phone", + "t5"."c_acctbal", + "t5"."c_mktsegment", + "t5"."c_comment" +FROM "tpch_nation" AS "t3" +INNER JOIN "tpch_region" AS "t4" + ON "t3"."n_regionkey" = "t4"."r_regionkey" +INNER JOIN "tpch_customer" AS "t5" + ON "t3"."n_nationkey" = "t5"."c_nationkey" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_sql/test_joins/inner/out.sql b/ibis/backends/tests/sql/snapshots/test_sql/test_joins/inner/out.sql index 9289a835e37a..38f8b0cac8d1 100644 --- a/ibis/backends/tests/sql/snapshots/test_sql/test_joins/inner/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_sql/test_joins/inner/out.sql @@ -1,11 +1,11 @@ SELECT - t2.r_regionkey, - t2.r_name, - t2.r_comment, - t3.n_nationkey, - t3.n_name, - t3.n_regionkey, - t3.n_comment -FROM tpch_region AS t2 -INNER JOIN tpch_nation AS t3 - ON t2.r_regionkey = t3.n_regionkey \ No newline at end of file + "t2"."r_regionkey", + "t2"."r_name", + "t2"."r_comment", + "t3"."n_nationkey", + "t3"."n_name", + "t3"."n_regionkey", + "t3"."n_comment" +FROM "tpch_region" AS "t2" +INNER JOIN "tpch_nation" AS "t3" + ON "t2"."r_regionkey" = "t3"."n_regionkey" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_sql/test_joins/inner_select/out.sql b/ibis/backends/tests/sql/snapshots/test_sql/test_joins/inner_select/out.sql index 38534295064f..62b8b3a02a94 100644 --- a/ibis/backends/tests/sql/snapshots/test_sql/test_joins/inner_select/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_sql/test_joins/inner_select/out.sql @@ -1,8 +1,8 @@ SELECT - t3.n_nationkey, - t3.n_name, - t3.n_regionkey, - t3.n_comment -FROM tpch_region AS t2 -INNER JOIN tpch_nation AS t3 - ON t2.r_regionkey = t3.n_regionkey \ No newline at end of file + "t3"."n_nationkey", + "t3"."n_name", + "t3"."n_regionkey", + "t3"."n_comment" +FROM "tpch_region" AS "t2" +INNER JOIN "tpch_nation" AS "t3" + ON "t2"."r_regionkey" = "t3"."n_regionkey" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_sql/test_joins/left/out.sql b/ibis/backends/tests/sql/snapshots/test_sql/test_joins/left/out.sql index 7048d19d0ba4..83cb5797fa83 100644 --- a/ibis/backends/tests/sql/snapshots/test_sql/test_joins/left/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_sql/test_joins/left/out.sql @@ -1,11 +1,11 @@ SELECT - t2.r_regionkey, - t2.r_name, - t2.r_comment, - t3.n_nationkey, - t3.n_name, - t3.n_regionkey, - t3.n_comment -FROM tpch_region AS t2 -LEFT OUTER JOIN tpch_nation AS t3 - ON t2.r_regionkey = t3.n_regionkey \ No newline at end of file + "t2"."r_regionkey", + "t2"."r_name", + "t2"."r_comment", + "t3"."n_nationkey", + "t3"."n_name", + "t3"."n_regionkey", + "t3"."n_comment" +FROM "tpch_region" AS "t2" +LEFT OUTER JOIN "tpch_nation" AS "t3" + ON "t2"."r_regionkey" = "t3"."n_regionkey" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_sql/test_joins/left_select/out.sql b/ibis/backends/tests/sql/snapshots/test_sql/test_joins/left_select/out.sql index 26c408b5be1a..ae780af31792 100644 --- a/ibis/backends/tests/sql/snapshots/test_sql/test_joins/left_select/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_sql/test_joins/left_select/out.sql @@ -1,8 +1,8 @@ SELECT - t3.n_nationkey, - t3.n_name, - t3.n_regionkey, - t3.n_comment -FROM tpch_region AS t2 -LEFT OUTER JOIN tpch_nation AS t3 - ON t2.r_regionkey = t3.n_regionkey \ No newline at end of file + "t3"."n_nationkey", + "t3"."n_name", + "t3"."n_regionkey", + "t3"."n_comment" +FROM "tpch_region" AS "t2" +LEFT OUTER JOIN "tpch_nation" AS "t3" + ON "t2"."r_regionkey" = "t3"."n_regionkey" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_sql/test_joins/outer/out.sql b/ibis/backends/tests/sql/snapshots/test_sql/test_joins/outer/out.sql index f14ac5c0d92e..77ab8eedab04 100644 --- a/ibis/backends/tests/sql/snapshots/test_sql/test_joins/outer/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_sql/test_joins/outer/out.sql @@ -1,11 +1,11 @@ SELECT - t2.r_regionkey, - t2.r_name, - t2.r_comment, - t3.n_nationkey, - t3.n_name, - t3.n_regionkey, - t3.n_comment -FROM tpch_region AS t2 -FULL OUTER JOIN tpch_nation AS t3 - ON t2.r_regionkey = t3.n_regionkey \ No newline at end of file + "t2"."r_regionkey", + "t2"."r_name", + "t2"."r_comment", + "t3"."n_nationkey", + "t3"."n_name", + "t3"."n_regionkey", + "t3"."n_comment" +FROM "tpch_region" AS "t2" +FULL OUTER JOIN "tpch_nation" AS "t3" + ON "t2"."r_regionkey" = "t3"."n_regionkey" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_sql/test_joins/outer_select/out.sql b/ibis/backends/tests/sql/snapshots/test_sql/test_joins/outer_select/out.sql index 1b339a3f247b..e1538231f19f 100644 --- a/ibis/backends/tests/sql/snapshots/test_sql/test_joins/outer_select/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_sql/test_joins/outer_select/out.sql @@ -1,8 +1,8 @@ SELECT - t3.n_nationkey, - t3.n_name, - t3.n_regionkey, - t3.n_comment -FROM tpch_region AS t2 -FULL OUTER JOIN tpch_nation AS t3 - ON t2.r_regionkey = t3.n_regionkey \ No newline at end of file + "t3"."n_nationkey", + "t3"."n_name", + "t3"."n_regionkey", + "t3"."n_comment" +FROM "tpch_region" AS "t2" +FULL OUTER JOIN "tpch_nation" AS "t3" + ON "t2"."r_regionkey" = "t3"."n_regionkey" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_sql/test_limit/expr_fn0/out.sql b/ibis/backends/tests/sql/snapshots/test_sql/test_limit/expr_fn0/out.sql index 2b6d0fe52716..651d57bbc4c8 100644 --- a/ibis/backends/tests/sql/snapshots/test_sql/test_limit/expr_fn0/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_sql/test_limit/expr_fn0/out.sql @@ -1,4 +1,4 @@ SELECT * -FROM star1 AS t0 +FROM "star1" AS "t0" LIMIT 10 \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_sql/test_limit/expr_fn1/out.sql b/ibis/backends/tests/sql/snapshots/test_sql/test_limit/expr_fn1/out.sql index 3c71bda9b962..0f11f2394924 100644 --- a/ibis/backends/tests/sql/snapshots/test_sql/test_limit/expr_fn1/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_sql/test_limit/expr_fn1/out.sql @@ -1,5 +1,5 @@ SELECT * -FROM star1 AS t0 +FROM "star1" AS "t0" LIMIT 10 OFFSET 5 \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_sql/test_limit_filter/out.sql b/ibis/backends/tests/sql/snapshots/test_sql/test_limit_filter/out.sql index 31e87b57f3ea..7ce2d03a7aec 100644 --- a/ibis/backends/tests/sql/snapshots/test_sql/test_limit_filter/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_sql/test_limit_filter/out.sql @@ -1,9 +1,9 @@ SELECT - t0.c, - t0.f, - t0.foo_id, - t0.bar_id -FROM star1 AS t0 + "t0"."c", + "t0"."f", + "t0"."foo_id", + "t0"."bar_id" +FROM "star1" AS "t0" WHERE - t0.f > CAST(0 AS TINYINT) + "t0"."f" > CAST(0 AS TINYINT) LIMIT 10 \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_sql/test_limit_subquery/out.sql b/ibis/backends/tests/sql/snapshots/test_sql/test_limit_subquery/out.sql index ab4dd6df7158..6a53e9d7fec3 100644 --- a/ibis/backends/tests/sql/snapshots/test_sql/test_limit_subquery/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_sql/test_limit_subquery/out.sql @@ -1,13 +1,13 @@ SELECT - t1.c, - t1.f, - t1.foo_id, - t1.bar_id + "t1"."c", + "t1"."f", + "t1"."foo_id", + "t1"."bar_id" FROM ( SELECT * - FROM star1 AS t0 + FROM "star1" AS "t0" LIMIT 10 -) AS t1 +) AS "t1" WHERE - t1.f > CAST(0 AS TINYINT) \ No newline at end of file + "t1"."f" > CAST(0 AS TINYINT) \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_sql/test_lower_projection_sort_key/out.sql b/ibis/backends/tests/sql/snapshots/test_sql/test_lower_projection_sort_key/out.sql index c297a58cd8f8..b28c9eb2ed58 100644 --- a/ibis/backends/tests/sql/snapshots/test_sql/test_lower_projection_sort_key/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_sql/test_lower_projection_sort_key/out.sql @@ -1,24 +1,24 @@ SELECT - t5.foo_id, - t5.total, - t5.value1 + "t5"."foo_id", + "t5"."total", + "t5"."value1" FROM ( SELECT - t4.foo_id, - t4.total, - t2.value1 + "t4"."foo_id", + "t4"."total", + "t2"."value1" FROM ( SELECT - t0.foo_id, - SUM(t0.f) AS total - FROM star1 AS t0 + "t0"."foo_id", + SUM("t0"."f") AS "total" + FROM "star1" AS "t0" GROUP BY 1 - ) AS t4 - INNER JOIN star2 AS t2 - ON t4.foo_id = t2.foo_id -) AS t5 + ) AS "t4" + INNER JOIN "star2" AS "t2" + ON "t4"."foo_id" = "t2"."foo_id" +) AS "t5" WHERE - t5.total > CAST(100 AS TINYINT) + "t5"."total" > CAST(100 AS TINYINT) ORDER BY - t5.total DESC \ No newline at end of file + "t5"."total" DESC \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_sql/test_multi_join/out.sql b/ibis/backends/tests/sql/snapshots/test_sql/test_multi_join/out.sql index ad0a5d35f89d..94f254f3a207 100644 --- a/ibis/backends/tests/sql/snapshots/test_sql/test_multi_join/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_sql/test_multi_join/out.sql @@ -1,20 +1,20 @@ SELECT - t4.x1, - t4.y1, - t5.x2, - t9.x3, - t9.y2, - t9.x4 -FROM t1 AS t4 -INNER JOIN t2 AS t5 - ON t4.x1 = t5.x2 + "t4"."x1", + "t4"."y1", + "t5"."x2", + "t9"."x3", + "t9"."y2", + "t9"."x4" +FROM "t1" AS "t4" +INNER JOIN "t2" AS "t5" + ON "t4"."x1" = "t5"."x2" INNER JOIN ( SELECT - t6.x3, - t6.y2, - t7.x4 - FROM t3 AS t6 - INNER JOIN t4 AS t7 - ON t6.x3 = t7.x4 -) AS t9 - ON t4.y1 = t9.y2 \ No newline at end of file + "t6"."x3", + "t6"."y2", + "t7"."x4" + FROM "t3" AS "t6" + INNER JOIN "t4" AS "t7" + ON "t6"."x3" = "t7"."x4" +) AS "t9" + ON "t4"."y1" = "t9"."y2" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_sql/test_mutate_filter_join_no_cross_join/out.sql b/ibis/backends/tests/sql/snapshots/test_sql/test_mutate_filter_join_no_cross_join/out.sql index 82946b9a13bc..293c1b4efd77 100644 --- a/ibis/backends/tests/sql/snapshots/test_sql/test_mutate_filter_join_no_cross_join/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_sql/test_mutate_filter_join_no_cross_join/out.sql @@ -1,5 +1,5 @@ SELECT - t0.person_id -FROM person AS t0 + "t0"."person_id" +FROM "person" AS "t0" WHERE CAST(400 AS SMALLINT) <= CAST(40 AS TINYINT) \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_sql/test_named_expr/out.sql b/ibis/backends/tests/sql/snapshots/test_sql/test_named_expr/out.sql index 66e751eda132..90abf9858067 100644 --- a/ibis/backends/tests/sql/snapshots/test_sql/test_named_expr/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_sql/test_named_expr/out.sql @@ -1,3 +1,3 @@ SELECT - t0.double_col * CAST(2 AS TINYINT) AS foo -FROM functional_alltypes AS t0 \ No newline at end of file + "t0"."double_col" * CAST(2 AS TINYINT) AS "foo" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_sql/test_negate/out.sql b/ibis/backends/tests/sql/snapshots/test_sql/test_negate/out.sql index 3ea20ad88c56..e248e7ce636e 100644 --- a/ibis/backends/tests/sql/snapshots/test_sql/test_negate/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_sql/test_negate/out.sql @@ -1,5 +1,5 @@ SELECT NOT ( - t0.double_col > CAST(0 AS TINYINT) - ) AS tmp -FROM functional_alltypes AS t0 \ No newline at end of file + "t0"."double_col" > CAST(0 AS TINYINT) + ) AS "tmp" +FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_sql/test_no_cart_join/out.sql b/ibis/backends/tests/sql/snapshots/test_sql/test_no_cart_join/out.sql index 8cb242edd156..699792bed260 100644 --- a/ibis/backends/tests/sql/snapshots/test_sql/test_no_cart_join/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_sql/test_no_cart_join/out.sql @@ -1,37 +1,41 @@ SELECT - t6.ancestor_node_sort_order, - t6.n + "t6"."ancestor_node_sort_order", + "t6"."n" FROM ( SELECT - t5.ancestor_node_sort_order, - CAST(1 AS TINYINT) AS n + "t5"."ancestor_node_sort_order", + CAST(1 AS TINYINT) AS "n" FROM ( SELECT - t2.product_id, - t4.ancestor_level_name, - t4.ancestor_level_number, - t4.ancestor_node_sort_order, - t4.descendant_node_natural_key, - t4.product_level_name - FROM facts AS t2 + "t2"."product_id", + "t4"."ancestor_level_name", + "t4"."ancestor_level_number", + "t4"."ancestor_node_sort_order", + "t4"."descendant_node_natural_key", + "t4"."product_level_name" + FROM "facts" AS "t2" INNER JOIN ( SELECT - t1.ancestor_level_name, - t1.ancestor_level_number, - t1.ancestor_node_sort_order, - t1.descendant_node_natural_key, + "t1"."ancestor_level_name", + "t1"."ancestor_level_number", + "t1"."ancestor_node_sort_order", + "t1"."descendant_node_natural_key", CONCAT( - LPAD('-', ( - t1.ancestor_level_number - CAST(1 AS TINYINT) - ) * CAST(7 AS TINYINT), '-'), - t1.ancestor_level_name - ) AS product_level_name - FROM products AS t1 - ) AS t4 - ON t2.product_id = t4.descendant_node_natural_key - ) AS t5 + LPAD( + '-', + ( + "t1"."ancestor_level_number" - CAST(1 AS TINYINT) + ) * CAST(7 AS TINYINT), + '-' + ), + "t1"."ancestor_level_name" + ) AS "product_level_name" + FROM "products" AS "t1" + ) AS "t4" + ON "t2"."product_id" = "t4"."descendant_node_natural_key" + ) AS "t5" GROUP BY 1 -) AS t6 +) AS "t6" ORDER BY - t6.ancestor_node_sort_order ASC \ No newline at end of file + "t6"."ancestor_node_sort_order" ASC \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_sql/test_no_cartesian_join/out.sql b/ibis/backends/tests/sql/snapshots/test_sql/test_no_cartesian_join/out.sql index a94638f06f0b..a53781106951 100644 --- a/ibis/backends/tests/sql/snapshots/test_sql/test_no_cartesian_join/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_sql/test_no_cartesian_join/out.sql @@ -1,61 +1,61 @@ SELECT - t13.customer_id, - t13.first_name, - t13.last_name, - t13.first_order, - t13.most_recent_order, - t13.number_of_orders, - t11.total_amount AS customer_lifetime_value + "t13"."customer_id", + "t13"."first_name", + "t13"."last_name", + "t13"."first_order", + "t13"."most_recent_order", + "t13"."number_of_orders", + "t11"."total_amount" AS "customer_lifetime_value" FROM ( SELECT - t10.customer_id, - t10.first_name, - t10.last_name, - t10.first_order, - t10.most_recent_order, - t10.number_of_orders + "t10"."customer_id", + "t10"."first_name", + "t10"."last_name", + "t10"."first_order", + "t10"."most_recent_order", + "t10"."number_of_orders" FROM ( SELECT - t3.customer_id, - t3.first_name, - t3.last_name, - t7.customer_id AS customer_id_right, - t7.first_order, - t7.most_recent_order, - t7.number_of_orders - FROM customers AS t3 + "t3"."customer_id", + "t3"."first_name", + "t3"."last_name", + "t7"."customer_id" AS "customer_id_right", + "t7"."first_order", + "t7"."most_recent_order", + "t7"."number_of_orders" + FROM "customers" AS "t3" LEFT OUTER JOIN ( SELECT - t2.customer_id, - MIN(t2.order_date) AS first_order, - MAX(t2.order_date) AS most_recent_order, - COUNT(t2.order_id) AS number_of_orders - FROM orders AS t2 + "t2"."customer_id", + MIN("t2"."order_date") AS "first_order", + MAX("t2"."order_date") AS "most_recent_order", + COUNT("t2"."order_id") AS "number_of_orders" + FROM "orders" AS "t2" GROUP BY 1 - ) AS t7 - ON t3.customer_id = t7.customer_id - ) AS t10 -) AS t13 + ) AS "t7" + ON "t3"."customer_id" = "t7"."customer_id" + ) AS "t10" +) AS "t13" LEFT OUTER JOIN ( SELECT - t8.customer_id, - SUM(t8.amount) AS total_amount + "t8"."customer_id", + SUM("t8"."amount") AS "total_amount" FROM ( SELECT - t4.payment_id, - t4.order_id, - t4.payment_method, - t4.amount, - t5.order_id AS order_id_right, - t5.customer_id, - t5.order_date, - t5.status - FROM payments AS t4 - LEFT OUTER JOIN orders AS t5 - ON t4.order_id = t5.order_id - ) AS t8 + "t4"."payment_id", + "t4"."order_id", + "t4"."payment_method", + "t4"."amount", + "t5"."order_id" AS "order_id_right", + "t5"."customer_id", + "t5"."order_date", + "t5"."status" + FROM "payments" AS "t4" + LEFT OUTER JOIN "orders" AS "t5" + ON "t4"."order_id" = "t5"."order_id" + ) AS "t8" GROUP BY 1 -) AS t11 - ON t13.customer_id = t11.customer_id \ No newline at end of file +) AS "t11" + ON "t13"."customer_id" = "t11"."customer_id" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_sql/test_no_cross_join/out.sql b/ibis/backends/tests/sql/snapshots/test_sql/test_no_cross_join/out.sql index fc3f08afa72b..bf95ad4de09b 100644 --- a/ibis/backends/tests/sql/snapshots/test_sql/test_no_cross_join/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_sql/test_no_cross_join/out.sql @@ -1,16 +1,16 @@ SELECT - t3.id, - t3.personal, - t3.family, - t4.taken, - t4.person, - t4.quant, - t4.reading, - t5.id AS id_right, - t5.site, - t5.dated -FROM person AS t3 -INNER JOIN survey AS t4 - ON t3.id = t4.person -INNER JOIN visited AS t5 - ON t5.id = t4.taken \ No newline at end of file + "t3"."id", + "t3"."personal", + "t3"."family", + "t4"."taken", + "t4"."person", + "t4"."quant", + "t4"."reading", + "t5"."id" AS "id_right", + "t5"."site", + "t5"."dated" +FROM "person" AS "t3" +INNER JOIN "survey" AS "t4" + ON "t3"."id" = "t4"."person" +INNER JOIN "visited" AS "t5" + ON "t5"."id" = "t4"."taken" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_sql/test_not_exists/out.sql b/ibis/backends/tests/sql/snapshots/test_sql/test_not_exists/out.sql index 548a1efef2ec..49e1de6dee7f 100644 --- a/ibis/backends/tests/sql/snapshots/test_sql/test_not_exists/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_sql/test_not_exists/out.sql @@ -1,15 +1,15 @@ SELECT - t0.key1, - t0.key2, - t0.value1 -FROM foo_t AS t0 + "t0"."key1", + "t0"."key2", + "t0"."value1" +FROM "foo_t" AS "t0" WHERE NOT ( EXISTS( SELECT CAST(1 AS TINYINT) AS "1" - FROM bar_t AS t1 + FROM "bar_t" AS "t1" WHERE - t0.key1 = t1.key1 + "t0"."key1" = "t1"."key1" ) ) \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_sql/test_order_by/column/out.sql b/ibis/backends/tests/sql/snapshots/test_sql/test_order_by/column/out.sql index bb666f269b2a..b5450abae2a7 100644 --- a/ibis/backends/tests/sql/snapshots/test_sql/test_order_by/column/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_sql/test_order_by/column/out.sql @@ -1,8 +1,8 @@ SELECT - t0.c, - t0.f, - t0.foo_id, - t0.bar_id -FROM star1 AS t0 + "t0"."c", + "t0"."f", + "t0"."foo_id", + "t0"."bar_id" +FROM "star1" AS "t0" ORDER BY - t0.f ASC \ No newline at end of file + "t0"."f" ASC \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_sql/test_order_by/random/out.sql b/ibis/backends/tests/sql/snapshots/test_sql/test_order_by/random/out.sql index 356b091282c5..57217205415c 100644 --- a/ibis/backends/tests/sql/snapshots/test_sql/test_order_by/random/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_sql/test_order_by/random/out.sql @@ -1,8 +1,8 @@ SELECT - t0.c, - t0.f, - t0.foo_id, - t0.bar_id -FROM star1 AS t0 + "t0"."c", + "t0"."f", + "t0"."foo_id", + "t0"."bar_id" +FROM "star1" AS "t0" ORDER BY RANDOM() ASC \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_sql/test_order_by_expr/out.sql b/ibis/backends/tests/sql/snapshots/test_sql/test_order_by_expr/out.sql index 99a46813f652..1cd433cac8ee 100644 --- a/ibis/backends/tests/sql/snapshots/test_sql/test_order_by_expr/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_sql/test_order_by_expr/out.sql @@ -1,8 +1,8 @@ SELECT - t0.a, - t0.b -FROM t AS t0 + "t0"."a", + "t0"."b" +FROM "t" AS "t0" WHERE - t0.a = CAST(1 AS TINYINT) + "t0"."a" = CAST(1 AS TINYINT) ORDER BY - CONCAT(t0.b, 'a') ASC \ No newline at end of file + CONCAT("t0"."b", 'a') ASC \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_sql/test_searched_case/out.sql b/ibis/backends/tests/sql/snapshots/test_sql/test_searched_case/out.sql index 31c40c343501..1bbe6d29ebd7 100644 --- a/ibis/backends/tests/sql/snapshots/test_sql/test_searched_case/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_sql/test_searched_case/out.sql @@ -1,9 +1,9 @@ SELECT CASE - WHEN t0.f > CAST(0 AS TINYINT) - THEN t0.d * CAST(2 AS TINYINT) - WHEN t0.c < CAST(0 AS TINYINT) - THEN t0.a * CAST(2 AS TINYINT) + WHEN "t0"."f" > CAST(0 AS TINYINT) + THEN "t0"."d" * CAST(2 AS TINYINT) + WHEN "t0"."c" < CAST(0 AS TINYINT) + THEN "t0"."a" * CAST(2 AS TINYINT) ELSE CAST(NULL AS BIGINT) - END AS tmp -FROM alltypes AS t0 \ No newline at end of file + END AS "tmp" +FROM "alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_sql/test_self_reference_in_not_exists/anti.sql b/ibis/backends/tests/sql/snapshots/test_sql/test_self_reference_in_not_exists/anti.sql index c598c1264a74..45e3247059df 100644 --- a/ibis/backends/tests/sql/snapshots/test_sql/test_self_reference_in_not_exists/anti.sql +++ b/ibis/backends/tests/sql/snapshots/test_sql/test_self_reference_in_not_exists/anti.sql @@ -1,25 +1,25 @@ SELECT - t0.id, - t0.bool_col, - t0.tinyint_col, - t0.smallint_col, - t0.int_col, - t0.bigint_col, - t0.float_col, - t0.double_col, - t0.date_string_col, - t0.string_col, - t0.timestamp_col, - t0.year, - t0.month -FROM functional_alltypes AS t0 + "t0"."id", + "t0"."bool_col", + "t0"."tinyint_col", + "t0"."smallint_col", + "t0"."int_col", + "t0"."bigint_col", + "t0"."float_col", + "t0"."double_col", + "t0"."date_string_col", + "t0"."string_col", + "t0"."timestamp_col", + "t0"."year", + "t0"."month" +FROM "functional_alltypes" AS "t0" WHERE NOT ( EXISTS( SELECT CAST(1 AS TINYINT) AS "1" - FROM functional_alltypes AS t1 + FROM "functional_alltypes" AS "t1" WHERE - t0.string_col = t1.string_col + "t0"."string_col" = "t1"."string_col" ) ) \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_sql/test_self_reference_in_not_exists/semi.sql b/ibis/backends/tests/sql/snapshots/test_sql/test_self_reference_in_not_exists/semi.sql index 16089afced58..2be1572284b0 100644 --- a/ibis/backends/tests/sql/snapshots/test_sql/test_self_reference_in_not_exists/semi.sql +++ b/ibis/backends/tests/sql/snapshots/test_sql/test_self_reference_in_not_exists/semi.sql @@ -1,23 +1,23 @@ SELECT - t0.id, - t0.bool_col, - t0.tinyint_col, - t0.smallint_col, - t0.int_col, - t0.bigint_col, - t0.float_col, - t0.double_col, - t0.date_string_col, - t0.string_col, - t0.timestamp_col, - t0.year, - t0.month -FROM functional_alltypes AS t0 + "t0"."id", + "t0"."bool_col", + "t0"."tinyint_col", + "t0"."smallint_col", + "t0"."int_col", + "t0"."bigint_col", + "t0"."float_col", + "t0"."double_col", + "t0"."date_string_col", + "t0"."string_col", + "t0"."timestamp_col", + "t0"."year", + "t0"."month" +FROM "functional_alltypes" AS "t0" WHERE EXISTS( SELECT CAST(1 AS TINYINT) AS "1" - FROM functional_alltypes AS t1 + FROM "functional_alltypes" AS "t1" WHERE - t0.string_col = t1.string_col + "t0"."string_col" = "t1"."string_col" ) \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_sql/test_self_reference_join/out.sql b/ibis/backends/tests/sql/snapshots/test_sql/test_self_reference_join/out.sql index e9c93029c637..ac92348404fd 100644 --- a/ibis/backends/tests/sql/snapshots/test_sql/test_self_reference_join/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_sql/test_self_reference_join/out.sql @@ -1,8 +1,8 @@ SELECT - t1.c, - t1.f, - t1.foo_id, - t1.bar_id -FROM star1 AS t1 -INNER JOIN star1 AS t3 - ON t1.foo_id = t3.bar_id \ No newline at end of file + "t1"."c", + "t1"."f", + "t1"."foo_id", + "t1"."bar_id" +FROM "star1" AS "t1" +INNER JOIN "star1" AS "t3" + ON "t1"."foo_id" = "t3"."bar_id" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_sql/test_simple_case/out.sql b/ibis/backends/tests/sql/snapshots/test_sql/test_simple_case/out.sql index 3575c8d6e653..a3261990855f 100644 --- a/ibis/backends/tests/sql/snapshots/test_sql/test_simple_case/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_sql/test_simple_case/out.sql @@ -1,3 +1,3 @@ SELECT - CASE t0.g WHEN 'foo' THEN 'bar' WHEN 'baz' THEN 'qux' ELSE 'default' END AS tmp -FROM alltypes AS t0 \ No newline at end of file + CASE "t0"."g" WHEN 'foo' THEN 'bar' WHEN 'baz' THEN 'qux' ELSE 'default' END AS "tmp" +FROM "alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_sql/test_sort_aggregation_translation_failure/out.sql b/ibis/backends/tests/sql/snapshots/test_sql/test_sort_aggregation_translation_failure/out.sql index e8f9420b4263..9a054603df9c 100644 --- a/ibis/backends/tests/sql/snapshots/test_sql/test_sort_aggregation_translation_failure/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_sql/test_sort_aggregation_translation_failure/out.sql @@ -1,13 +1,13 @@ SELECT - t1.string_col, - t1.foo + "t1"."string_col", + "t1"."foo" FROM ( SELECT - t0.string_col, - MAX(t0.double_col) AS foo - FROM functional_alltypes AS t0 + "t0"."string_col", + MAX("t0"."double_col") AS "foo" + FROM "functional_alltypes" AS "t0" GROUP BY 1 -) AS t1 +) AS "t1" ORDER BY - t1.foo DESC \ No newline at end of file + "t1"."foo" DESC \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_sql/test_subquery_aliased/out.sql b/ibis/backends/tests/sql/snapshots/test_sql/test_subquery_aliased/out.sql index e0f8941f3527..e59c73676247 100644 --- a/ibis/backends/tests/sql/snapshots/test_sql/test_subquery_aliased/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_sql/test_subquery_aliased/out.sql @@ -1,14 +1,14 @@ SELECT - t4.foo_id, - t4.total, - t2.value1 + "t4"."foo_id", + "t4"."total", + "t2"."value1" FROM ( SELECT - t0.foo_id, - SUM(t0.f) AS total - FROM star1 AS t0 + "t0"."foo_id", + SUM("t0"."f") AS "total" + FROM "star1" AS "t0" GROUP BY 1 -) AS t4 -INNER JOIN star2 AS t2 - ON t4.foo_id = t2.foo_id \ No newline at end of file +) AS "t4" +INNER JOIN "star2" AS "t2" + ON "t4"."foo_id" = "t2"."foo_id" \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_sql/test_where_correlated_subquery/out.sql b/ibis/backends/tests/sql/snapshots/test_sql/test_where_correlated_subquery/out.sql index ee5a1da42bd3..dd64692ebe63 100644 --- a/ibis/backends/tests/sql/snapshots/test_sql/test_where_correlated_subquery/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_sql/test_where_correlated_subquery/out.sql @@ -1,21 +1,21 @@ SELECT - t0.job, - t0.dept_id, - t0.year, - t0.y -FROM foo AS t0 + "t0"."job", + "t0"."dept_id", + "t0"."year", + "t0"."y" +FROM "foo" AS "t0" WHERE - t0.y > ( + "t0"."y" > ( SELECT - AVG(t2.y) AS "Mean(y)" + AVG("t2"."y") AS "Mean(y)" FROM ( SELECT - t1.job, - t1.dept_id, - t1.year, - t1.y - FROM foo AS t1 + "t1"."job", + "t1"."dept_id", + "t1"."year", + "t1"."y" + FROM "foo" AS "t1" WHERE - t0.dept_id = t1.dept_id - ) AS t2 + "t0"."dept_id" = "t1"."dept_id" + ) AS "t2" ) \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_sql/test_where_correlated_subquery_with_join/out.sql b/ibis/backends/tests/sql/snapshots/test_sql/test_where_correlated_subquery_with_join/out.sql index f2e028c28d23..893b51610688 100644 --- a/ibis/backends/tests/sql/snapshots/test_sql/test_where_correlated_subquery_with_join/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_sql/test_where_correlated_subquery_with_join/out.sql @@ -1,31 +1,31 @@ SELECT - t7.p_partkey, - t7.ps_supplycost + "t7"."p_partkey", + "t7"."ps_supplycost" FROM ( SELECT - t3.p_partkey, - t4.ps_supplycost - FROM part AS t3 - INNER JOIN partsupp AS t4 - ON t3.p_partkey = t4.ps_partkey -) AS t7 + "t3"."p_partkey", + "t4"."ps_supplycost" + FROM "part" AS "t3" + INNER JOIN "partsupp" AS "t4" + ON "t3"."p_partkey" = "t4"."ps_partkey" +) AS "t7" WHERE - t7.ps_supplycost = ( + "t7"."ps_supplycost" = ( SELECT - MIN(t9.ps_supplycost) AS "Min(ps_supplycost)" + MIN("t9"."ps_supplycost") AS "Min(ps_supplycost)" FROM ( SELECT - t8.ps_partkey, - t8.ps_supplycost + "t8"."ps_partkey", + "t8"."ps_supplycost" FROM ( SELECT - t5.ps_partkey, - t5.ps_supplycost - FROM partsupp AS t5 - INNER JOIN supplier AS t6 - ON t6.s_suppkey = t5.ps_suppkey - ) AS t8 + "t5"."ps_partkey", + "t5"."ps_supplycost" + FROM "partsupp" AS "t5" + INNER JOIN "supplier" AS "t6" + ON "t6"."s_suppkey" = "t5"."ps_suppkey" + ) AS "t8" WHERE - t8.ps_partkey = t7.p_partkey - ) AS t9 + "t8"."ps_partkey" = "t7"."p_partkey" + ) AS "t9" ) \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_sql/test_where_simple_comparisons/out.sql b/ibis/backends/tests/sql/snapshots/test_sql/test_where_simple_comparisons/out.sql index e1914ac959bd..fa090401f5ad 100644 --- a/ibis/backends/tests/sql/snapshots/test_sql/test_where_simple_comparisons/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_sql/test_where_simple_comparisons/out.sql @@ -1,10 +1,10 @@ SELECT - t0.c, - t0.f, - t0.foo_id, - t0.bar_id -FROM star1 AS t0 + "t0"."c", + "t0"."f", + "t0"."foo_id", + "t0"."bar_id" +FROM "star1" AS "t0" WHERE - t0.f > CAST(0 AS TINYINT) AND t0.c < ( - t0.f * CAST(2 AS TINYINT) + "t0"."f" > CAST(0 AS TINYINT) AND "t0"."c" < ( + "t0"."f" * CAST(2 AS TINYINT) ) \ No newline at end of file diff --git a/ibis/backends/tests/sql/snapshots/test_sql/test_where_uncorrelated_subquery/out.sql b/ibis/backends/tests/sql/snapshots/test_sql/test_where_uncorrelated_subquery/out.sql index d64e69ba3894..719644e39bda 100644 --- a/ibis/backends/tests/sql/snapshots/test_sql/test_where_uncorrelated_subquery/out.sql +++ b/ibis/backends/tests/sql/snapshots/test_sql/test_where_uncorrelated_subquery/out.sql @@ -1,12 +1,12 @@ SELECT - t0.job, - t0.dept_id, - t0.year, - t0.y -FROM foo AS t0 + "t0"."job", + "t0"."dept_id", + "t0"."year", + "t0"."y" +FROM "foo" AS "t0" WHERE - t0.job IN ( + "t0"."job" IN ( SELECT - t1.job - FROM bar AS t1 + "t1"."job" + FROM "bar" AS "t1" ) \ No newline at end of file diff --git a/ibis/backends/tests/test_temporal.py b/ibis/backends/tests/test_temporal.py index fad799de5e3b..8d0b06e85cb0 100644 --- a/ibis/backends/tests/test_temporal.py +++ b/ibis/backends/tests/test_temporal.py @@ -2639,11 +2639,6 @@ def test_temporal_literal_sql(value, dialect, snapshot): - {"pyspark", "impala", "clickhouse", "oracle", *_NO_SQLGLOT_DIALECT} ), *no_sqlglot_dialect, - *[ - param("impala", marks=no_time_type), - param("clickhouse", marks=no_time_type), - param("oracle", marks=no_time_type), - ], ], ) @pytest.mark.parametrize("micros", [0, 234567]) diff --git a/ibis/backends/tests/tpch/snapshots/test_h01/test_tpc_h01/duckdb/h01.sql b/ibis/backends/tests/tpch/snapshots/test_h01/test_tpc_h01/duckdb/h01.sql index 953b4dfeefc4..bb68526ff92e 100644 --- a/ibis/backends/tests/tpch/snapshots/test_h01/test_tpc_h01/duckdb/h01.sql +++ b/ibis/backends/tests/tpch/snapshots/test_h01/test_tpc_h01/duckdb/h01.sql @@ -1,62 +1,62 @@ SELECT - t2.l_returnflag, - t2.l_linestatus, - t2.sum_qty, - t2.sum_base_price, - t2.sum_disc_price, - t2.sum_charge, - t2.avg_qty, - t2.avg_price, - t2.avg_disc, - t2.count_order + "t2"."l_returnflag", + "t2"."l_linestatus", + "t2"."sum_qty", + "t2"."sum_base_price", + "t2"."sum_disc_price", + "t2"."sum_charge", + "t2"."avg_qty", + "t2"."avg_price", + "t2"."avg_disc", + "t2"."count_order" FROM ( SELECT - t1.l_returnflag, - t1.l_linestatus, - SUM(t1.l_quantity) AS sum_qty, - SUM(t1.l_extendedprice) AS sum_base_price, - SUM(t1.l_extendedprice * ( - CAST(1 AS TINYINT) - t1.l_discount - )) AS sum_disc_price, + "t1"."l_returnflag", + "t1"."l_linestatus", + SUM("t1"."l_quantity") AS "sum_qty", + SUM("t1"."l_extendedprice") AS "sum_base_price", + SUM("t1"."l_extendedprice" * ( + CAST(1 AS TINYINT) - "t1"."l_discount" + )) AS "sum_disc_price", SUM( ( - t1.l_extendedprice * ( - CAST(1 AS TINYINT) - t1.l_discount + "t1"."l_extendedprice" * ( + CAST(1 AS TINYINT) - "t1"."l_discount" ) ) * ( - t1.l_tax + CAST(1 AS TINYINT) + "t1"."l_tax" + CAST(1 AS TINYINT) ) - ) AS sum_charge, - AVG(t1.l_quantity) AS avg_qty, - AVG(t1.l_extendedprice) AS avg_price, - AVG(t1.l_discount) AS avg_disc, - COUNT(*) AS count_order + ) AS "sum_charge", + AVG("t1"."l_quantity") AS "avg_qty", + AVG("t1"."l_extendedprice") AS "avg_price", + AVG("t1"."l_discount") AS "avg_disc", + COUNT(*) AS "count_order" FROM ( SELECT - t0.l_orderkey, - t0.l_partkey, - t0.l_suppkey, - t0.l_linenumber, - t0.l_quantity, - t0.l_extendedprice, - t0.l_discount, - t0.l_tax, - t0.l_returnflag, - t0.l_linestatus, - t0.l_shipdate, - t0.l_commitdate, - t0.l_receiptdate, - t0.l_shipinstruct, - t0.l_shipmode, - t0.l_comment - FROM lineitem AS t0 + "t0"."l_orderkey", + "t0"."l_partkey", + "t0"."l_suppkey", + "t0"."l_linenumber", + "t0"."l_quantity", + "t0"."l_extendedprice", + "t0"."l_discount", + "t0"."l_tax", + "t0"."l_returnflag", + "t0"."l_linestatus", + "t0"."l_shipdate", + "t0"."l_commitdate", + "t0"."l_receiptdate", + "t0"."l_shipinstruct", + "t0"."l_shipmode", + "t0"."l_comment" + FROM "lineitem" AS "t0" WHERE - t0.l_shipdate <= MAKE_DATE(1998, 9, 2) - ) AS t1 + "t0"."l_shipdate" <= MAKE_DATE(1998, 9, 2) + ) AS "t1" GROUP BY 1, 2 -) AS t2 +) AS "t2" ORDER BY - t2.l_returnflag ASC, - t2.l_linestatus ASC \ No newline at end of file + "t2"."l_returnflag" ASC, + "t2"."l_linestatus" ASC \ No newline at end of file diff --git a/ibis/backends/tests/tpch/snapshots/test_h02/test_tpc_h02/duckdb/h02.sql b/ibis/backends/tests/tpch/snapshots/test_h02/test_tpc_h02/duckdb/h02.sql index eb30c07672f4..b27b44cd0c05 100644 --- a/ibis/backends/tests/tpch/snapshots/test_h02/test_tpc_h02/duckdb/h02.sql +++ b/ibis/backends/tests/tpch/snapshots/test_h02/test_tpc_h02/duckdb/h02.sql @@ -1,116 +1,116 @@ SELECT - t14.s_acctbal, - t14.s_name, - t14.n_name, - t14.p_partkey, - t14.p_mfgr, - t14.s_address, - t14.s_phone, - t14.s_comment + "t14"."s_acctbal", + "t14"."s_name", + "t14"."n_name", + "t14"."p_partkey", + "t14"."p_mfgr", + "t14"."s_address", + "t14"."s_phone", + "t14"."s_comment" FROM ( SELECT - t5.p_partkey, - t5.p_name, - t5.p_mfgr, - t5.p_brand, - t5.p_type, - t5.p_size, - t5.p_container, - t5.p_retailprice, - t5.p_comment, - t6.ps_partkey, - t6.ps_suppkey, - t6.ps_availqty, - t6.ps_supplycost, - t6.ps_comment, - t8.s_suppkey, - t8.s_name, - t8.s_address, - t8.s_nationkey, - t8.s_phone, - t8.s_acctbal, - t8.s_comment, - t10.n_nationkey, - t10.n_name, - t10.n_regionkey, - t10.n_comment, - t12.r_regionkey, - t12.r_name, - t12.r_comment - FROM part AS t5 - INNER JOIN partsupp AS t6 - ON t5.p_partkey = t6.ps_partkey - INNER JOIN supplier AS t8 - ON t8.s_suppkey = t6.ps_suppkey - INNER JOIN nation AS t10 - ON t8.s_nationkey = t10.n_nationkey - INNER JOIN region AS t12 - ON t10.n_regionkey = t12.r_regionkey -) AS t14 + "t5"."p_partkey", + "t5"."p_name", + "t5"."p_mfgr", + "t5"."p_brand", + "t5"."p_type", + "t5"."p_size", + "t5"."p_container", + "t5"."p_retailprice", + "t5"."p_comment", + "t6"."ps_partkey", + "t6"."ps_suppkey", + "t6"."ps_availqty", + "t6"."ps_supplycost", + "t6"."ps_comment", + "t8"."s_suppkey", + "t8"."s_name", + "t8"."s_address", + "t8"."s_nationkey", + "t8"."s_phone", + "t8"."s_acctbal", + "t8"."s_comment", + "t10"."n_nationkey", + "t10"."n_name", + "t10"."n_regionkey", + "t10"."n_comment", + "t12"."r_regionkey", + "t12"."r_name", + "t12"."r_comment" + FROM "part" AS "t5" + INNER JOIN "partsupp" AS "t6" + ON "t5"."p_partkey" = "t6"."ps_partkey" + INNER JOIN "supplier" AS "t8" + ON "t8"."s_suppkey" = "t6"."ps_suppkey" + INNER JOIN "nation" AS "t10" + ON "t8"."s_nationkey" = "t10"."n_nationkey" + INNER JOIN "region" AS "t12" + ON "t10"."n_regionkey" = "t12"."r_regionkey" +) AS "t14" WHERE - t14.p_size = CAST(15 AS TINYINT) - AND t14.p_type LIKE '%BRASS' - AND t14.r_name = 'EUROPE' - AND t14.ps_supplycost = ( + "t14"."p_size" = CAST(15 AS TINYINT) + AND "t14"."p_type" LIKE '%BRASS' + AND "t14"."r_name" = 'EUROPE' + AND "t14"."ps_supplycost" = ( SELECT - MIN(t16.ps_supplycost) AS "Min(ps_supplycost)" + MIN("t16"."ps_supplycost") AS "Min(ps_supplycost)" FROM ( SELECT - t15.ps_partkey, - t15.ps_suppkey, - t15.ps_availqty, - t15.ps_supplycost, - t15.ps_comment, - t15.s_suppkey, - t15.s_name, - t15.s_address, - t15.s_nationkey, - t15.s_phone, - t15.s_acctbal, - t15.s_comment, - t15.n_nationkey, - t15.n_name, - t15.n_regionkey, - t15.n_comment, - t15.r_regionkey, - t15.r_name, - t15.r_comment + "t15"."ps_partkey", + "t15"."ps_suppkey", + "t15"."ps_availqty", + "t15"."ps_supplycost", + "t15"."ps_comment", + "t15"."s_suppkey", + "t15"."s_name", + "t15"."s_address", + "t15"."s_nationkey", + "t15"."s_phone", + "t15"."s_acctbal", + "t15"."s_comment", + "t15"."n_nationkey", + "t15"."n_name", + "t15"."n_regionkey", + "t15"."n_comment", + "t15"."r_regionkey", + "t15"."r_name", + "t15"."r_comment" FROM ( SELECT - t7.ps_partkey, - t7.ps_suppkey, - t7.ps_availqty, - t7.ps_supplycost, - t7.ps_comment, - t9.s_suppkey, - t9.s_name, - t9.s_address, - t9.s_nationkey, - t9.s_phone, - t9.s_acctbal, - t9.s_comment, - t11.n_nationkey, - t11.n_name, - t11.n_regionkey, - t11.n_comment, - t13.r_regionkey, - t13.r_name, - t13.r_comment - FROM partsupp AS t7 - INNER JOIN supplier AS t9 - ON t9.s_suppkey = t7.ps_suppkey - INNER JOIN nation AS t11 - ON t9.s_nationkey = t11.n_nationkey - INNER JOIN region AS t13 - ON t11.n_regionkey = t13.r_regionkey - ) AS t15 + "t7"."ps_partkey", + "t7"."ps_suppkey", + "t7"."ps_availqty", + "t7"."ps_supplycost", + "t7"."ps_comment", + "t9"."s_suppkey", + "t9"."s_name", + "t9"."s_address", + "t9"."s_nationkey", + "t9"."s_phone", + "t9"."s_acctbal", + "t9"."s_comment", + "t11"."n_nationkey", + "t11"."n_name", + "t11"."n_regionkey", + "t11"."n_comment", + "t13"."r_regionkey", + "t13"."r_name", + "t13"."r_comment" + FROM "partsupp" AS "t7" + INNER JOIN "supplier" AS "t9" + ON "t9"."s_suppkey" = "t7"."ps_suppkey" + INNER JOIN "nation" AS "t11" + ON "t9"."s_nationkey" = "t11"."n_nationkey" + INNER JOIN "region" AS "t13" + ON "t11"."n_regionkey" = "t13"."r_regionkey" + ) AS "t15" WHERE - t15.r_name = 'EUROPE' AND t14.p_partkey = t15.ps_partkey - ) AS t16 + "t15"."r_name" = 'EUROPE' AND "t14"."p_partkey" = "t15"."ps_partkey" + ) AS "t16" ) ORDER BY - t14.s_acctbal DESC, - t14.n_name ASC, - t14.s_name ASC, - t14.p_partkey ASC + "t14"."s_acctbal" DESC, + "t14"."n_name" ASC, + "t14"."s_name" ASC, + "t14"."p_partkey" ASC LIMIT 100 \ No newline at end of file diff --git a/ibis/backends/tests/tpch/snapshots/test_h03/test_tpc_h03/duckdb/h03.sql b/ibis/backends/tests/tpch/snapshots/test_h03/test_tpc_h03/duckdb/h03.sql index f1cd6fd9a332..c25bca3164a5 100644 --- a/ibis/backends/tests/tpch/snapshots/test_h03/test_tpc_h03/duckdb/h03.sql +++ b/ibis/backends/tests/tpch/snapshots/test_h03/test_tpc_h03/duckdb/h03.sql @@ -1,103 +1,103 @@ SELECT - t8.l_orderkey, - t8.revenue, - t8.o_orderdate, - t8.o_shippriority + "t8"."l_orderkey", + "t8"."revenue", + "t8"."o_orderdate", + "t8"."o_shippriority" FROM ( SELECT - t7.l_orderkey, - t7.o_orderdate, - t7.o_shippriority, - SUM(t7.l_extendedprice * ( - CAST(1 AS TINYINT) - t7.l_discount - )) AS revenue + "t7"."l_orderkey", + "t7"."o_orderdate", + "t7"."o_shippriority", + SUM("t7"."l_extendedprice" * ( + CAST(1 AS TINYINT) - "t7"."l_discount" + )) AS "revenue" FROM ( SELECT - t6.c_custkey, - t6.c_name, - t6.c_address, - t6.c_nationkey, - t6.c_phone, - t6.c_acctbal, - t6.c_mktsegment, - t6.c_comment, - t6.o_orderkey, - t6.o_custkey, - t6.o_orderstatus, - t6.o_totalprice, - t6.o_orderdate, - t6.o_orderpriority, - t6.o_clerk, - t6.o_shippriority, - t6.o_comment, - t6.l_orderkey, - t6.l_partkey, - t6.l_suppkey, - t6.l_linenumber, - t6.l_quantity, - t6.l_extendedprice, - t6.l_discount, - t6.l_tax, - t6.l_returnflag, - t6.l_linestatus, - t6.l_shipdate, - t6.l_commitdate, - t6.l_receiptdate, - t6.l_shipinstruct, - t6.l_shipmode, - t6.l_comment + "t6"."c_custkey", + "t6"."c_name", + "t6"."c_address", + "t6"."c_nationkey", + "t6"."c_phone", + "t6"."c_acctbal", + "t6"."c_mktsegment", + "t6"."c_comment", + "t6"."o_orderkey", + "t6"."o_custkey", + "t6"."o_orderstatus", + "t6"."o_totalprice", + "t6"."o_orderdate", + "t6"."o_orderpriority", + "t6"."o_clerk", + "t6"."o_shippriority", + "t6"."o_comment", + "t6"."l_orderkey", + "t6"."l_partkey", + "t6"."l_suppkey", + "t6"."l_linenumber", + "t6"."l_quantity", + "t6"."l_extendedprice", + "t6"."l_discount", + "t6"."l_tax", + "t6"."l_returnflag", + "t6"."l_linestatus", + "t6"."l_shipdate", + "t6"."l_commitdate", + "t6"."l_receiptdate", + "t6"."l_shipinstruct", + "t6"."l_shipmode", + "t6"."l_comment" FROM ( SELECT - t3.c_custkey, - t3.c_name, - t3.c_address, - t3.c_nationkey, - t3.c_phone, - t3.c_acctbal, - t3.c_mktsegment, - t3.c_comment, - t4.o_orderkey, - t4.o_custkey, - t4.o_orderstatus, - t4.o_totalprice, - t4.o_orderdate, - t4.o_orderpriority, - t4.o_clerk, - t4.o_shippriority, - t4.o_comment, - t5.l_orderkey, - t5.l_partkey, - t5.l_suppkey, - t5.l_linenumber, - t5.l_quantity, - t5.l_extendedprice, - t5.l_discount, - t5.l_tax, - t5.l_returnflag, - t5.l_linestatus, - t5.l_shipdate, - t5.l_commitdate, - t5.l_receiptdate, - t5.l_shipinstruct, - t5.l_shipmode, - t5.l_comment - FROM customer AS t3 - INNER JOIN orders AS t4 - ON t3.c_custkey = t4.o_custkey - INNER JOIN lineitem AS t5 - ON t5.l_orderkey = t4.o_orderkey - ) AS t6 + "t3"."c_custkey", + "t3"."c_name", + "t3"."c_address", + "t3"."c_nationkey", + "t3"."c_phone", + "t3"."c_acctbal", + "t3"."c_mktsegment", + "t3"."c_comment", + "t4"."o_orderkey", + "t4"."o_custkey", + "t4"."o_orderstatus", + "t4"."o_totalprice", + "t4"."o_orderdate", + "t4"."o_orderpriority", + "t4"."o_clerk", + "t4"."o_shippriority", + "t4"."o_comment", + "t5"."l_orderkey", + "t5"."l_partkey", + "t5"."l_suppkey", + "t5"."l_linenumber", + "t5"."l_quantity", + "t5"."l_extendedprice", + "t5"."l_discount", + "t5"."l_tax", + "t5"."l_returnflag", + "t5"."l_linestatus", + "t5"."l_shipdate", + "t5"."l_commitdate", + "t5"."l_receiptdate", + "t5"."l_shipinstruct", + "t5"."l_shipmode", + "t5"."l_comment" + FROM "customer" AS "t3" + INNER JOIN "orders" AS "t4" + ON "t3"."c_custkey" = "t4"."o_custkey" + INNER JOIN "lineitem" AS "t5" + ON "t5"."l_orderkey" = "t4"."o_orderkey" + ) AS "t6" WHERE - t6.c_mktsegment = 'BUILDING' - AND t6.o_orderdate < MAKE_DATE(1995, 3, 15) - AND t6.l_shipdate > MAKE_DATE(1995, 3, 15) - ) AS t7 + "t6"."c_mktsegment" = 'BUILDING' + AND "t6"."o_orderdate" < MAKE_DATE(1995, 3, 15) + AND "t6"."l_shipdate" > MAKE_DATE(1995, 3, 15) + ) AS "t7" GROUP BY 1, 2, 3 -) AS t8 +) AS "t8" ORDER BY - t8.revenue DESC, - t8.o_orderdate ASC + "t8"."revenue" DESC, + "t8"."o_orderdate" ASC LIMIT 10 \ No newline at end of file diff --git a/ibis/backends/tests/tpch/snapshots/test_h04/test_tpc_h04/duckdb/h04.sql b/ibis/backends/tests/tpch/snapshots/test_h04/test_tpc_h04/duckdb/h04.sql index 77ba19f9cc07..8131f812a2a8 100644 --- a/ibis/backends/tests/tpch/snapshots/test_h04/test_tpc_h04/duckdb/h04.sql +++ b/ibis/backends/tests/tpch/snapshots/test_h04/test_tpc_h04/duckdb/h04.sql @@ -1,39 +1,40 @@ SELECT - t4.o_orderpriority, - t4.order_count + "t4"."o_orderpriority", + "t4"."order_count" FROM ( SELECT - t3.o_orderpriority, - COUNT(*) AS order_count + "t3"."o_orderpriority", + COUNT(*) AS "order_count" FROM ( SELECT - t0.o_orderkey, - t0.o_custkey, - t0.o_orderstatus, - t0.o_totalprice, - t0.o_orderdate, - t0.o_orderpriority, - t0.o_clerk, - t0.o_shippriority, - t0.o_comment - FROM orders AS t0 + "t0"."o_orderkey", + "t0"."o_custkey", + "t0"."o_orderstatus", + "t0"."o_totalprice", + "t0"."o_orderdate", + "t0"."o_orderpriority", + "t0"."o_clerk", + "t0"."o_shippriority", + "t0"."o_comment" + FROM "orders" AS "t0" WHERE EXISTS( SELECT CAST(1 AS TINYINT) AS "1" - FROM lineitem AS t1 + FROM "lineitem" AS "t1" WHERE ( - t1.l_orderkey = t0.o_orderkey - ) AND ( - t1.l_commitdate < t1.l_receiptdate + "t1"."l_orderkey" = "t0"."o_orderkey" + ) + AND ( + "t1"."l_commitdate" < "t1"."l_receiptdate" ) ) - AND t0.o_orderdate >= MAKE_DATE(1993, 7, 1) - AND t0.o_orderdate < MAKE_DATE(1993, 10, 1) - ) AS t3 + AND "t0"."o_orderdate" >= MAKE_DATE(1993, 7, 1) + AND "t0"."o_orderdate" < MAKE_DATE(1993, 10, 1) + ) AS "t3" GROUP BY 1 -) AS t4 +) AS "t4" ORDER BY - t4.o_orderpriority ASC \ No newline at end of file + "t4"."o_orderpriority" ASC \ No newline at end of file diff --git a/ibis/backends/tests/tpch/snapshots/test_h05/test_tpc_h05/duckdb/h05.sql b/ibis/backends/tests/tpch/snapshots/test_h05/test_tpc_h05/duckdb/h05.sql index 2ee7ce67f6ed..4cbff7141c68 100644 --- a/ibis/backends/tests/tpch/snapshots/test_h05/test_tpc_h05/duckdb/h05.sql +++ b/ibis/backends/tests/tpch/snapshots/test_h05/test_tpc_h05/duckdb/h05.sql @@ -1,129 +1,129 @@ SELECT - t14.n_name, - t14.revenue + "t14"."n_name", + "t14"."revenue" FROM ( SELECT - t13.n_name, - SUM(t13.l_extendedprice * ( - CAST(1 AS TINYINT) - t13.l_discount - )) AS revenue + "t13"."n_name", + SUM("t13"."l_extendedprice" * ( + CAST(1 AS TINYINT) - "t13"."l_discount" + )) AS "revenue" FROM ( SELECT - t12.c_custkey, - t12.c_name, - t12.c_address, - t12.c_nationkey, - t12.c_phone, - t12.c_acctbal, - t12.c_mktsegment, - t12.c_comment, - t12.o_orderkey, - t12.o_custkey, - t12.o_orderstatus, - t12.o_totalprice, - t12.o_orderdate, - t12.o_orderpriority, - t12.o_clerk, - t12.o_shippriority, - t12.o_comment, - t12.l_orderkey, - t12.l_partkey, - t12.l_suppkey, - t12.l_linenumber, - t12.l_quantity, - t12.l_extendedprice, - t12.l_discount, - t12.l_tax, - t12.l_returnflag, - t12.l_linestatus, - t12.l_shipdate, - t12.l_commitdate, - t12.l_receiptdate, - t12.l_shipinstruct, - t12.l_shipmode, - t12.l_comment, - t12.s_suppkey, - t12.s_name, - t12.s_address, - t12.s_nationkey, - t12.s_phone, - t12.s_acctbal, - t12.s_comment, - t12.n_nationkey, - t12.n_name, - t12.n_regionkey, - t12.n_comment, - t12.r_regionkey, - t12.r_name, - t12.r_comment + "t12"."c_custkey", + "t12"."c_name", + "t12"."c_address", + "t12"."c_nationkey", + "t12"."c_phone", + "t12"."c_acctbal", + "t12"."c_mktsegment", + "t12"."c_comment", + "t12"."o_orderkey", + "t12"."o_custkey", + "t12"."o_orderstatus", + "t12"."o_totalprice", + "t12"."o_orderdate", + "t12"."o_orderpriority", + "t12"."o_clerk", + "t12"."o_shippriority", + "t12"."o_comment", + "t12"."l_orderkey", + "t12"."l_partkey", + "t12"."l_suppkey", + "t12"."l_linenumber", + "t12"."l_quantity", + "t12"."l_extendedprice", + "t12"."l_discount", + "t12"."l_tax", + "t12"."l_returnflag", + "t12"."l_linestatus", + "t12"."l_shipdate", + "t12"."l_commitdate", + "t12"."l_receiptdate", + "t12"."l_shipinstruct", + "t12"."l_shipmode", + "t12"."l_comment", + "t12"."s_suppkey", + "t12"."s_name", + "t12"."s_address", + "t12"."s_nationkey", + "t12"."s_phone", + "t12"."s_acctbal", + "t12"."s_comment", + "t12"."n_nationkey", + "t12"."n_name", + "t12"."n_regionkey", + "t12"."n_comment", + "t12"."r_regionkey", + "t12"."r_name", + "t12"."r_comment" FROM ( SELECT - t6.c_custkey, - t6.c_name, - t6.c_address, - t6.c_nationkey, - t6.c_phone, - t6.c_acctbal, - t6.c_mktsegment, - t6.c_comment, - t7.o_orderkey, - t7.o_custkey, - t7.o_orderstatus, - t7.o_totalprice, - t7.o_orderdate, - t7.o_orderpriority, - t7.o_clerk, - t7.o_shippriority, - t7.o_comment, - t8.l_orderkey, - t8.l_partkey, - t8.l_suppkey, - t8.l_linenumber, - t8.l_quantity, - t8.l_extendedprice, - t8.l_discount, - t8.l_tax, - t8.l_returnflag, - t8.l_linestatus, - t8.l_shipdate, - t8.l_commitdate, - t8.l_receiptdate, - t8.l_shipinstruct, - t8.l_shipmode, - t8.l_comment, - t9.s_suppkey, - t9.s_name, - t9.s_address, - t9.s_nationkey, - t9.s_phone, - t9.s_acctbal, - t9.s_comment, - t10.n_nationkey, - t10.n_name, - t10.n_regionkey, - t10.n_comment, - t11.r_regionkey, - t11.r_name, - t11.r_comment - FROM customer AS t6 - INNER JOIN orders AS t7 - ON t6.c_custkey = t7.o_custkey - INNER JOIN lineitem AS t8 - ON t8.l_orderkey = t7.o_orderkey - INNER JOIN supplier AS t9 - ON t8.l_suppkey = t9.s_suppkey - INNER JOIN nation AS t10 - ON t6.c_nationkey = t9.s_nationkey AND t9.s_nationkey = t10.n_nationkey - INNER JOIN region AS t11 - ON t10.n_regionkey = t11.r_regionkey - ) AS t12 + "t6"."c_custkey", + "t6"."c_name", + "t6"."c_address", + "t6"."c_nationkey", + "t6"."c_phone", + "t6"."c_acctbal", + "t6"."c_mktsegment", + "t6"."c_comment", + "t7"."o_orderkey", + "t7"."o_custkey", + "t7"."o_orderstatus", + "t7"."o_totalprice", + "t7"."o_orderdate", + "t7"."o_orderpriority", + "t7"."o_clerk", + "t7"."o_shippriority", + "t7"."o_comment", + "t8"."l_orderkey", + "t8"."l_partkey", + "t8"."l_suppkey", + "t8"."l_linenumber", + "t8"."l_quantity", + "t8"."l_extendedprice", + "t8"."l_discount", + "t8"."l_tax", + "t8"."l_returnflag", + "t8"."l_linestatus", + "t8"."l_shipdate", + "t8"."l_commitdate", + "t8"."l_receiptdate", + "t8"."l_shipinstruct", + "t8"."l_shipmode", + "t8"."l_comment", + "t9"."s_suppkey", + "t9"."s_name", + "t9"."s_address", + "t9"."s_nationkey", + "t9"."s_phone", + "t9"."s_acctbal", + "t9"."s_comment", + "t10"."n_nationkey", + "t10"."n_name", + "t10"."n_regionkey", + "t10"."n_comment", + "t11"."r_regionkey", + "t11"."r_name", + "t11"."r_comment" + FROM "customer" AS "t6" + INNER JOIN "orders" AS "t7" + ON "t6"."c_custkey" = "t7"."o_custkey" + INNER JOIN "lineitem" AS "t8" + ON "t8"."l_orderkey" = "t7"."o_orderkey" + INNER JOIN "supplier" AS "t9" + ON "t8"."l_suppkey" = "t9"."s_suppkey" + INNER JOIN "nation" AS "t10" + ON "t6"."c_nationkey" = "t9"."s_nationkey" AND "t9"."s_nationkey" = "t10"."n_nationkey" + INNER JOIN "region" AS "t11" + ON "t10"."n_regionkey" = "t11"."r_regionkey" + ) AS "t12" WHERE - t12.r_name = 'ASIA' - AND t12.o_orderdate >= MAKE_DATE(1994, 1, 1) - AND t12.o_orderdate < MAKE_DATE(1995, 1, 1) - ) AS t13 + "t12"."r_name" = 'ASIA' + AND "t12"."o_orderdate" >= MAKE_DATE(1994, 1, 1) + AND "t12"."o_orderdate" < MAKE_DATE(1995, 1, 1) + ) AS "t13" GROUP BY 1 -) AS t14 +) AS "t14" ORDER BY - t14.revenue DESC \ No newline at end of file + "t14"."revenue" DESC \ No newline at end of file diff --git a/ibis/backends/tests/tpch/snapshots/test_h06/test_tpc_h06/duckdb/h06.sql b/ibis/backends/tests/tpch/snapshots/test_h06/test_tpc_h06/duckdb/h06.sql index eea01a0277a6..6b845f769470 100644 --- a/ibis/backends/tests/tpch/snapshots/test_h06/test_tpc_h06/duckdb/h06.sql +++ b/ibis/backends/tests/tpch/snapshots/test_h06/test_tpc_h06/duckdb/h06.sql @@ -1,27 +1,27 @@ SELECT - SUM(t1.l_extendedprice * t1.l_discount) AS revenue + SUM("t1"."l_extendedprice" * "t1"."l_discount") AS "revenue" FROM ( SELECT - t0.l_orderkey, - t0.l_partkey, - t0.l_suppkey, - t0.l_linenumber, - t0.l_quantity, - t0.l_extendedprice, - t0.l_discount, - t0.l_tax, - t0.l_returnflag, - t0.l_linestatus, - t0.l_shipdate, - t0.l_commitdate, - t0.l_receiptdate, - t0.l_shipinstruct, - t0.l_shipmode, - t0.l_comment - FROM lineitem AS t0 + "t0"."l_orderkey", + "t0"."l_partkey", + "t0"."l_suppkey", + "t0"."l_linenumber", + "t0"."l_quantity", + "t0"."l_extendedprice", + "t0"."l_discount", + "t0"."l_tax", + "t0"."l_returnflag", + "t0"."l_linestatus", + "t0"."l_shipdate", + "t0"."l_commitdate", + "t0"."l_receiptdate", + "t0"."l_shipinstruct", + "t0"."l_shipmode", + "t0"."l_comment" + FROM "lineitem" AS "t0" WHERE - t0.l_shipdate >= MAKE_DATE(1994, 1, 1) - AND t0.l_shipdate < MAKE_DATE(1995, 1, 1) - AND t0.l_discount BETWEEN CAST(0.05 AS DOUBLE) AND CAST(0.07 AS DOUBLE) - AND t0.l_quantity < CAST(24 AS TINYINT) -) AS t1 \ No newline at end of file + "t0"."l_shipdate" >= MAKE_DATE(1994, 1, 1) + AND "t0"."l_shipdate" < MAKE_DATE(1995, 1, 1) + AND "t0"."l_discount" BETWEEN CAST(0.05 AS DOUBLE) AND CAST(0.07 AS DOUBLE) + AND "t0"."l_quantity" < CAST(24 AS TINYINT) +) AS "t1" \ No newline at end of file diff --git a/ibis/backends/tests/tpch/snapshots/test_h07/test_tpc_h07/duckdb/h07.sql b/ibis/backends/tests/tpch/snapshots/test_h07/test_tpc_h07/duckdb/h07.sql index 1f0d06b91d10..fca7ba9abc97 100644 --- a/ibis/backends/tests/tpch/snapshots/test_h07/test_tpc_h07/duckdb/h07.sql +++ b/ibis/backends/tests/tpch/snapshots/test_h07/test_tpc_h07/duckdb/h07.sql @@ -1,71 +1,71 @@ SELECT - t14.supp_nation, - t14.cust_nation, - t14.l_year, - t14.revenue + "t14"."supp_nation", + "t14"."cust_nation", + "t14"."l_year", + "t14"."revenue" FROM ( SELECT - t13.supp_nation, - t13.cust_nation, - t13.l_year, - SUM(t13.volume) AS revenue + "t13"."supp_nation", + "t13"."cust_nation", + "t13"."l_year", + SUM("t13"."volume") AS "revenue" FROM ( SELECT - t12.supp_nation, - t12.cust_nation, - t12.l_shipdate, - t12.l_extendedprice, - t12.l_discount, - t12.l_year, - t12.volume + "t12"."supp_nation", + "t12"."cust_nation", + "t12"."l_shipdate", + "t12"."l_extendedprice", + "t12"."l_discount", + "t12"."l_year", + "t12"."volume" FROM ( SELECT - t9.n_name AS supp_nation, - t11.n_name AS cust_nation, - t6.l_shipdate, - t6.l_extendedprice, - t6.l_discount, - EXTRACT(year FROM t6.l_shipdate) AS l_year, - t6.l_extendedprice * ( - CAST(1 AS TINYINT) - t6.l_discount - ) AS volume - FROM supplier AS t5 - INNER JOIN lineitem AS t6 - ON t5.s_suppkey = t6.l_suppkey - INNER JOIN orders AS t7 - ON t7.o_orderkey = t6.l_orderkey - INNER JOIN customer AS t8 - ON t8.c_custkey = t7.o_custkey - INNER JOIN nation AS t9 - ON t5.s_nationkey = t9.n_nationkey - INNER JOIN nation AS t11 - ON t8.c_nationkey = t11.n_nationkey - ) AS t12 + "t9"."n_name" AS "supp_nation", + "t11"."n_name" AS "cust_nation", + "t6"."l_shipdate", + "t6"."l_extendedprice", + "t6"."l_discount", + EXTRACT(year FROM "t6"."l_shipdate") AS "l_year", + "t6"."l_extendedprice" * ( + CAST(1 AS TINYINT) - "t6"."l_discount" + ) AS "volume" + FROM "supplier" AS "t5" + INNER JOIN "lineitem" AS "t6" + ON "t5"."s_suppkey" = "t6"."l_suppkey" + INNER JOIN "orders" AS "t7" + ON "t7"."o_orderkey" = "t6"."l_orderkey" + INNER JOIN "customer" AS "t8" + ON "t8"."c_custkey" = "t7"."o_custkey" + INNER JOIN "nation" AS "t9" + ON "t5"."s_nationkey" = "t9"."n_nationkey" + INNER JOIN "nation" AS "t11" + ON "t8"."c_nationkey" = "t11"."n_nationkey" + ) AS "t12" WHERE ( ( ( - t12.cust_nation = 'FRANCE' + "t12"."cust_nation" = 'FRANCE' ) AND ( - t12.supp_nation = 'GERMANY' + "t12"."supp_nation" = 'GERMANY' ) ) OR ( ( - t12.cust_nation = 'GERMANY' + "t12"."cust_nation" = 'GERMANY' ) AND ( - t12.supp_nation = 'FRANCE' + "t12"."supp_nation" = 'FRANCE' ) ) ) - AND t12.l_shipdate BETWEEN MAKE_DATE(1995, 1, 1) AND MAKE_DATE(1996, 12, 31) - ) AS t13 + AND "t12"."l_shipdate" BETWEEN MAKE_DATE(1995, 1, 1) AND MAKE_DATE(1996, 12, 31) + ) AS "t13" GROUP BY 1, 2, 3 -) AS t14 +) AS "t14" ORDER BY - t14.supp_nation ASC, - t14.cust_nation ASC, - t14.l_year ASC \ No newline at end of file + "t14"."supp_nation" ASC, + "t14"."cust_nation" ASC, + "t14"."l_year" ASC \ No newline at end of file diff --git a/ibis/backends/tests/tpch/snapshots/test_h08/test_tpc_h08/duckdb/h08.sql b/ibis/backends/tests/tpch/snapshots/test_h08/test_tpc_h08/duckdb/h08.sql index a06154f0383f..e2a61a509543 100644 --- a/ibis/backends/tests/tpch/snapshots/test_h08/test_tpc_h08/duckdb/h08.sql +++ b/ibis/backends/tests/tpch/snapshots/test_h08/test_tpc_h08/duckdb/h08.sql @@ -1,52 +1,52 @@ SELECT - t18.o_year, - t18.mkt_share + "t18"."o_year", + "t18"."mkt_share" FROM ( SELECT - t17.o_year, - SUM(t17.nation_volume) / SUM(t17.volume) AS mkt_share + "t17"."o_year", + SUM("t17"."nation_volume") / SUM("t17"."volume") AS "mkt_share" FROM ( SELECT - t16.o_year, - t16.volume, - t16.nation, - t16.r_name, - t16.o_orderdate, - t16.p_type, - CASE WHEN t16.nation = 'BRAZIL' THEN t16.volume ELSE CAST(0 AS TINYINT) END AS nation_volume + "t16"."o_year", + "t16"."volume", + "t16"."nation", + "t16"."r_name", + "t16"."o_orderdate", + "t16"."p_type", + CASE WHEN "t16"."nation" = 'BRAZIL' THEN "t16"."volume" ELSE CAST(0 AS TINYINT) END AS "nation_volume" FROM ( SELECT - EXTRACT(year FROM t10.o_orderdate) AS o_year, - t8.l_extendedprice * ( - CAST(1 AS TINYINT) - t8.l_discount - ) AS volume, - t15.n_name AS nation, - t14.r_name, - t10.o_orderdate, - t7.p_type - FROM part AS t7 - INNER JOIN lineitem AS t8 - ON t7.p_partkey = t8.l_partkey - INNER JOIN supplier AS t9 - ON t9.s_suppkey = t8.l_suppkey - INNER JOIN orders AS t10 - ON t8.l_orderkey = t10.o_orderkey - INNER JOIN customer AS t11 - ON t10.o_custkey = t11.c_custkey - INNER JOIN nation AS t12 - ON t11.c_nationkey = t12.n_nationkey - INNER JOIN region AS t14 - ON t12.n_regionkey = t14.r_regionkey - INNER JOIN nation AS t15 - ON t9.s_nationkey = t15.n_nationkey - ) AS t16 + EXTRACT(year FROM "t10"."o_orderdate") AS "o_year", + "t8"."l_extendedprice" * ( + CAST(1 AS TINYINT) - "t8"."l_discount" + ) AS "volume", + "t15"."n_name" AS "nation", + "t14"."r_name", + "t10"."o_orderdate", + "t7"."p_type" + FROM "part" AS "t7" + INNER JOIN "lineitem" AS "t8" + ON "t7"."p_partkey" = "t8"."l_partkey" + INNER JOIN "supplier" AS "t9" + ON "t9"."s_suppkey" = "t8"."l_suppkey" + INNER JOIN "orders" AS "t10" + ON "t8"."l_orderkey" = "t10"."o_orderkey" + INNER JOIN "customer" AS "t11" + ON "t10"."o_custkey" = "t11"."c_custkey" + INNER JOIN "nation" AS "t12" + ON "t11"."c_nationkey" = "t12"."n_nationkey" + INNER JOIN "region" AS "t14" + ON "t12"."n_regionkey" = "t14"."r_regionkey" + INNER JOIN "nation" AS "t15" + ON "t9"."s_nationkey" = "t15"."n_nationkey" + ) AS "t16" WHERE - t16.r_name = 'AMERICA' - AND t16.o_orderdate BETWEEN MAKE_DATE(1995, 1, 1) AND MAKE_DATE(1996, 12, 31) - AND t16.p_type = 'ECONOMY ANODIZED STEEL' - ) AS t17 + "t16"."r_name" = 'AMERICA' + AND "t16"."o_orderdate" BETWEEN MAKE_DATE(1995, 1, 1) AND MAKE_DATE(1996, 12, 31) + AND "t16"."p_type" = 'ECONOMY ANODIZED STEEL' + ) AS "t17" GROUP BY 1 -) AS t18 +) AS "t18" ORDER BY - t18.o_year ASC \ No newline at end of file + "t18"."o_year" ASC \ No newline at end of file diff --git a/ibis/backends/tests/tpch/snapshots/test_h09/test_tpc_h09/duckdb/h09.sql b/ibis/backends/tests/tpch/snapshots/test_h09/test_tpc_h09/duckdb/h09.sql index b146d5c6cea8..7ea2a643d044 100644 --- a/ibis/backends/tests/tpch/snapshots/test_h09/test_tpc_h09/duckdb/h09.sql +++ b/ibis/backends/tests/tpch/snapshots/test_h09/test_tpc_h09/duckdb/h09.sql @@ -1,49 +1,49 @@ SELECT - t14.nation, - t14.o_year, - t14.sum_profit + "t14"."nation", + "t14"."o_year", + "t14"."sum_profit" FROM ( SELECT - t13.nation, - t13.o_year, - SUM(t13.amount) AS sum_profit + "t13"."nation", + "t13"."o_year", + SUM("t13"."amount") AS "sum_profit" FROM ( SELECT - t12.amount, - t12.o_year, - t12.nation, - t12.p_name + "t12"."amount", + "t12"."o_year", + "t12"."nation", + "t12"."p_name" FROM ( SELECT ( - t6.l_extendedprice * ( - CAST(1 AS TINYINT) - t6.l_discount + "t6"."l_extendedprice" * ( + CAST(1 AS TINYINT) - "t6"."l_discount" ) ) - ( - t8.ps_supplycost * t6.l_quantity - ) AS amount, - EXTRACT(year FROM t10.o_orderdate) AS o_year, - t11.n_name AS nation, - t9.p_name - FROM lineitem AS t6 - INNER JOIN supplier AS t7 - ON t7.s_suppkey = t6.l_suppkey - INNER JOIN partsupp AS t8 - ON t8.ps_suppkey = t6.l_suppkey AND t8.ps_partkey = t6.l_partkey - INNER JOIN part AS t9 - ON t9.p_partkey = t6.l_partkey - INNER JOIN orders AS t10 - ON t10.o_orderkey = t6.l_orderkey - INNER JOIN nation AS t11 - ON t7.s_nationkey = t11.n_nationkey - ) AS t12 + "t8"."ps_supplycost" * "t6"."l_quantity" + ) AS "amount", + EXTRACT(year FROM "t10"."o_orderdate") AS "o_year", + "t11"."n_name" AS "nation", + "t9"."p_name" + FROM "lineitem" AS "t6" + INNER JOIN "supplier" AS "t7" + ON "t7"."s_suppkey" = "t6"."l_suppkey" + INNER JOIN "partsupp" AS "t8" + ON "t8"."ps_suppkey" = "t6"."l_suppkey" AND "t8"."ps_partkey" = "t6"."l_partkey" + INNER JOIN "part" AS "t9" + ON "t9"."p_partkey" = "t6"."l_partkey" + INNER JOIN "orders" AS "t10" + ON "t10"."o_orderkey" = "t6"."l_orderkey" + INNER JOIN "nation" AS "t11" + ON "t7"."s_nationkey" = "t11"."n_nationkey" + ) AS "t12" WHERE - t12.p_name LIKE '%green%' - ) AS t13 + "t12"."p_name" LIKE '%green%' + ) AS "t13" GROUP BY 1, 2 -) AS t14 +) AS "t14" ORDER BY - t14.nation ASC, - t14.o_year DESC \ No newline at end of file + "t14"."nation" ASC, + "t14"."o_year" DESC \ No newline at end of file diff --git a/ibis/backends/tests/tpch/snapshots/test_h10/test_tpc_h10/duckdb/h10.sql b/ibis/backends/tests/tpch/snapshots/test_h10/test_tpc_h10/duckdb/h10.sql index 33986b7a70e9..94d73f54c8dc 100644 --- a/ibis/backends/tests/tpch/snapshots/test_h10/test_tpc_h10/duckdb/h10.sql +++ b/ibis/backends/tests/tpch/snapshots/test_h10/test_tpc_h10/duckdb/h10.sql @@ -1,115 +1,115 @@ SELECT - t10.c_custkey, - t10.c_name, - t10.revenue, - t10.c_acctbal, - t10.n_name, - t10.c_address, - t10.c_phone, - t10.c_comment + "t10"."c_custkey", + "t10"."c_name", + "t10"."revenue", + "t10"."c_acctbal", + "t10"."n_name", + "t10"."c_address", + "t10"."c_phone", + "t10"."c_comment" FROM ( SELECT - t9.c_custkey, - t9.c_name, - t9.c_acctbal, - t9.n_name, - t9.c_address, - t9.c_phone, - t9.c_comment, - SUM(t9.l_extendedprice * ( - CAST(1 AS TINYINT) - t9.l_discount - )) AS revenue + "t9"."c_custkey", + "t9"."c_name", + "t9"."c_acctbal", + "t9"."n_name", + "t9"."c_address", + "t9"."c_phone", + "t9"."c_comment", + SUM("t9"."l_extendedprice" * ( + CAST(1 AS TINYINT) - "t9"."l_discount" + )) AS "revenue" FROM ( SELECT - t8.c_custkey, - t8.c_name, - t8.c_address, - t8.c_nationkey, - t8.c_phone, - t8.c_acctbal, - t8.c_mktsegment, - t8.c_comment, - t8.o_orderkey, - t8.o_custkey, - t8.o_orderstatus, - t8.o_totalprice, - t8.o_orderdate, - t8.o_orderpriority, - t8.o_clerk, - t8.o_shippriority, - t8.o_comment, - t8.l_orderkey, - t8.l_partkey, - t8.l_suppkey, - t8.l_linenumber, - t8.l_quantity, - t8.l_extendedprice, - t8.l_discount, - t8.l_tax, - t8.l_returnflag, - t8.l_linestatus, - t8.l_shipdate, - t8.l_commitdate, - t8.l_receiptdate, - t8.l_shipinstruct, - t8.l_shipmode, - t8.l_comment, - t8.n_nationkey, - t8.n_name, - t8.n_regionkey, - t8.n_comment + "t8"."c_custkey", + "t8"."c_name", + "t8"."c_address", + "t8"."c_nationkey", + "t8"."c_phone", + "t8"."c_acctbal", + "t8"."c_mktsegment", + "t8"."c_comment", + "t8"."o_orderkey", + "t8"."o_custkey", + "t8"."o_orderstatus", + "t8"."o_totalprice", + "t8"."o_orderdate", + "t8"."o_orderpriority", + "t8"."o_clerk", + "t8"."o_shippriority", + "t8"."o_comment", + "t8"."l_orderkey", + "t8"."l_partkey", + "t8"."l_suppkey", + "t8"."l_linenumber", + "t8"."l_quantity", + "t8"."l_extendedprice", + "t8"."l_discount", + "t8"."l_tax", + "t8"."l_returnflag", + "t8"."l_linestatus", + "t8"."l_shipdate", + "t8"."l_commitdate", + "t8"."l_receiptdate", + "t8"."l_shipinstruct", + "t8"."l_shipmode", + "t8"."l_comment", + "t8"."n_nationkey", + "t8"."n_name", + "t8"."n_regionkey", + "t8"."n_comment" FROM ( SELECT - t4.c_custkey, - t4.c_name, - t4.c_address, - t4.c_nationkey, - t4.c_phone, - t4.c_acctbal, - t4.c_mktsegment, - t4.c_comment, - t5.o_orderkey, - t5.o_custkey, - t5.o_orderstatus, - t5.o_totalprice, - t5.o_orderdate, - t5.o_orderpriority, - t5.o_clerk, - t5.o_shippriority, - t5.o_comment, - t6.l_orderkey, - t6.l_partkey, - t6.l_suppkey, - t6.l_linenumber, - t6.l_quantity, - t6.l_extendedprice, - t6.l_discount, - t6.l_tax, - t6.l_returnflag, - t6.l_linestatus, - t6.l_shipdate, - t6.l_commitdate, - t6.l_receiptdate, - t6.l_shipinstruct, - t6.l_shipmode, - t6.l_comment, - t7.n_nationkey, - t7.n_name, - t7.n_regionkey, - t7.n_comment - FROM customer AS t4 - INNER JOIN orders AS t5 - ON t4.c_custkey = t5.o_custkey - INNER JOIN lineitem AS t6 - ON t6.l_orderkey = t5.o_orderkey - INNER JOIN nation AS t7 - ON t4.c_nationkey = t7.n_nationkey - ) AS t8 + "t4"."c_custkey", + "t4"."c_name", + "t4"."c_address", + "t4"."c_nationkey", + "t4"."c_phone", + "t4"."c_acctbal", + "t4"."c_mktsegment", + "t4"."c_comment", + "t5"."o_orderkey", + "t5"."o_custkey", + "t5"."o_orderstatus", + "t5"."o_totalprice", + "t5"."o_orderdate", + "t5"."o_orderpriority", + "t5"."o_clerk", + "t5"."o_shippriority", + "t5"."o_comment", + "t6"."l_orderkey", + "t6"."l_partkey", + "t6"."l_suppkey", + "t6"."l_linenumber", + "t6"."l_quantity", + "t6"."l_extendedprice", + "t6"."l_discount", + "t6"."l_tax", + "t6"."l_returnflag", + "t6"."l_linestatus", + "t6"."l_shipdate", + "t6"."l_commitdate", + "t6"."l_receiptdate", + "t6"."l_shipinstruct", + "t6"."l_shipmode", + "t6"."l_comment", + "t7"."n_nationkey", + "t7"."n_name", + "t7"."n_regionkey", + "t7"."n_comment" + FROM "customer" AS "t4" + INNER JOIN "orders" AS "t5" + ON "t4"."c_custkey" = "t5"."o_custkey" + INNER JOIN "lineitem" AS "t6" + ON "t6"."l_orderkey" = "t5"."o_orderkey" + INNER JOIN "nation" AS "t7" + ON "t4"."c_nationkey" = "t7"."n_nationkey" + ) AS "t8" WHERE - t8.o_orderdate >= MAKE_DATE(1993, 10, 1) - AND t8.o_orderdate < MAKE_DATE(1994, 1, 1) - AND t8.l_returnflag = 'R' - ) AS t9 + "t8"."o_orderdate" >= MAKE_DATE(1993, 10, 1) + AND "t8"."o_orderdate" < MAKE_DATE(1994, 1, 1) + AND "t8"."l_returnflag" = 'R' + ) AS "t9" GROUP BY 1, 2, @@ -118,7 +118,7 @@ FROM ( 5, 6, 7 -) AS t10 +) AS "t10" ORDER BY - t10.revenue DESC + "t10"."revenue" DESC LIMIT 20 \ No newline at end of file diff --git a/ibis/backends/tests/tpch/snapshots/test_h11/test_tpc_h11/duckdb/h11.sql b/ibis/backends/tests/tpch/snapshots/test_h11/test_tpc_h11/duckdb/h11.sql index 594e5a7db6bd..3f94c814bcf5 100644 --- a/ibis/backends/tests/tpch/snapshots/test_h11/test_tpc_h11/duckdb/h11.sql +++ b/ibis/backends/tests/tpch/snapshots/test_h11/test_tpc_h11/duckdb/h11.sql @@ -1,109 +1,109 @@ SELECT - t8.ps_partkey, - t8.value + "t8"."ps_partkey", + "t8"."value" FROM ( SELECT - t7.ps_partkey, - SUM(t7.ps_supplycost * t7.ps_availqty) AS value + "t7"."ps_partkey", + SUM("t7"."ps_supplycost" * "t7"."ps_availqty") AS "value" FROM ( SELECT - t6.ps_partkey, - t6.ps_suppkey, - t6.ps_availqty, - t6.ps_supplycost, - t6.ps_comment, - t6.s_suppkey, - t6.s_name, - t6.s_address, - t6.s_nationkey, - t6.s_phone, - t6.s_acctbal, - t6.s_comment, - t6.n_nationkey, - t6.n_name, - t6.n_regionkey, - t6.n_comment + "t6"."ps_partkey", + "t6"."ps_suppkey", + "t6"."ps_availqty", + "t6"."ps_supplycost", + "t6"."ps_comment", + "t6"."s_suppkey", + "t6"."s_name", + "t6"."s_address", + "t6"."s_nationkey", + "t6"."s_phone", + "t6"."s_acctbal", + "t6"."s_comment", + "t6"."n_nationkey", + "t6"."n_name", + "t6"."n_regionkey", + "t6"."n_comment" FROM ( SELECT - t3.ps_partkey, - t3.ps_suppkey, - t3.ps_availqty, - t3.ps_supplycost, - t3.ps_comment, - t4.s_suppkey, - t4.s_name, - t4.s_address, - t4.s_nationkey, - t4.s_phone, - t4.s_acctbal, - t4.s_comment, - t5.n_nationkey, - t5.n_name, - t5.n_regionkey, - t5.n_comment - FROM partsupp AS t3 - INNER JOIN supplier AS t4 - ON t3.ps_suppkey = t4.s_suppkey - INNER JOIN nation AS t5 - ON t5.n_nationkey = t4.s_nationkey - ) AS t6 + "t3"."ps_partkey", + "t3"."ps_suppkey", + "t3"."ps_availqty", + "t3"."ps_supplycost", + "t3"."ps_comment", + "t4"."s_suppkey", + "t4"."s_name", + "t4"."s_address", + "t4"."s_nationkey", + "t4"."s_phone", + "t4"."s_acctbal", + "t4"."s_comment", + "t5"."n_nationkey", + "t5"."n_name", + "t5"."n_regionkey", + "t5"."n_comment" + FROM "partsupp" AS "t3" + INNER JOIN "supplier" AS "t4" + ON "t3"."ps_suppkey" = "t4"."s_suppkey" + INNER JOIN "nation" AS "t5" + ON "t5"."n_nationkey" = "t4"."s_nationkey" + ) AS "t6" WHERE - t6.n_name = 'GERMANY' - ) AS t7 + "t6"."n_name" = 'GERMANY' + ) AS "t7" GROUP BY 1 -) AS t8 +) AS "t8" WHERE - t8.value > ( + "t8"."value" > ( ( SELECT - SUM(t7.ps_supplycost * t7.ps_availqty) AS "Sum(Multiply(ps_supplycost, ps_availqty))" + SUM("t7"."ps_supplycost" * "t7"."ps_availqty") AS "Sum(Multiply(ps_supplycost, ps_availqty))" FROM ( SELECT - t6.ps_partkey, - t6.ps_suppkey, - t6.ps_availqty, - t6.ps_supplycost, - t6.ps_comment, - t6.s_suppkey, - t6.s_name, - t6.s_address, - t6.s_nationkey, - t6.s_phone, - t6.s_acctbal, - t6.s_comment, - t6.n_nationkey, - t6.n_name, - t6.n_regionkey, - t6.n_comment + "t6"."ps_partkey", + "t6"."ps_suppkey", + "t6"."ps_availqty", + "t6"."ps_supplycost", + "t6"."ps_comment", + "t6"."s_suppkey", + "t6"."s_name", + "t6"."s_address", + "t6"."s_nationkey", + "t6"."s_phone", + "t6"."s_acctbal", + "t6"."s_comment", + "t6"."n_nationkey", + "t6"."n_name", + "t6"."n_regionkey", + "t6"."n_comment" FROM ( SELECT - t3.ps_partkey, - t3.ps_suppkey, - t3.ps_availqty, - t3.ps_supplycost, - t3.ps_comment, - t4.s_suppkey, - t4.s_name, - t4.s_address, - t4.s_nationkey, - t4.s_phone, - t4.s_acctbal, - t4.s_comment, - t5.n_nationkey, - t5.n_name, - t5.n_regionkey, - t5.n_comment - FROM partsupp AS t3 - INNER JOIN supplier AS t4 - ON t3.ps_suppkey = t4.s_suppkey - INNER JOIN nation AS t5 - ON t5.n_nationkey = t4.s_nationkey - ) AS t6 + "t3"."ps_partkey", + "t3"."ps_suppkey", + "t3"."ps_availqty", + "t3"."ps_supplycost", + "t3"."ps_comment", + "t4"."s_suppkey", + "t4"."s_name", + "t4"."s_address", + "t4"."s_nationkey", + "t4"."s_phone", + "t4"."s_acctbal", + "t4"."s_comment", + "t5"."n_nationkey", + "t5"."n_name", + "t5"."n_regionkey", + "t5"."n_comment" + FROM "partsupp" AS "t3" + INNER JOIN "supplier" AS "t4" + ON "t3"."ps_suppkey" = "t4"."s_suppkey" + INNER JOIN "nation" AS "t5" + ON "t5"."n_nationkey" = "t4"."s_nationkey" + ) AS "t6" WHERE - t6.n_name = 'GERMANY' - ) AS t7 + "t6"."n_name" = 'GERMANY' + ) AS "t7" ) * CAST(0.0001 AS DOUBLE) ) ORDER BY - t8.value DESC \ No newline at end of file + "t8"."value" DESC \ No newline at end of file diff --git a/ibis/backends/tests/tpch/snapshots/test_h12/test_tpc_h12/duckdb/h12.sql b/ibis/backends/tests/tpch/snapshots/test_h12/test_tpc_h12/duckdb/h12.sql index ab4f275c250c..ffef3be8f840 100644 --- a/ibis/backends/tests/tpch/snapshots/test_h12/test_tpc_h12/duckdb/h12.sql +++ b/ibis/backends/tests/tpch/snapshots/test_h12/test_tpc_h12/duckdb/h12.sql @@ -1,95 +1,95 @@ SELECT - t6.l_shipmode, - t6.high_line_count, - t6.low_line_count + "t6"."l_shipmode", + "t6"."high_line_count", + "t6"."low_line_count" FROM ( SELECT - t5.l_shipmode, + "t5"."l_shipmode", SUM( - CASE t5.o_orderpriority + CASE "t5"."o_orderpriority" WHEN '1-URGENT' THEN CAST(1 AS TINYINT) WHEN '2-HIGH' THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END - ) AS high_line_count, + ) AS "high_line_count", SUM( - CASE t5.o_orderpriority + CASE "t5"."o_orderpriority" WHEN '1-URGENT' THEN CAST(0 AS TINYINT) WHEN '2-HIGH' THEN CAST(0 AS TINYINT) ELSE CAST(1 AS TINYINT) END - ) AS low_line_count + ) AS "low_line_count" FROM ( SELECT - t4.o_orderkey, - t4.o_custkey, - t4.o_orderstatus, - t4.o_totalprice, - t4.o_orderdate, - t4.o_orderpriority, - t4.o_clerk, - t4.o_shippriority, - t4.o_comment, - t4.l_orderkey, - t4.l_partkey, - t4.l_suppkey, - t4.l_linenumber, - t4.l_quantity, - t4.l_extendedprice, - t4.l_discount, - t4.l_tax, - t4.l_returnflag, - t4.l_linestatus, - t4.l_shipdate, - t4.l_commitdate, - t4.l_receiptdate, - t4.l_shipinstruct, - t4.l_shipmode, - t4.l_comment + "t4"."o_orderkey", + "t4"."o_custkey", + "t4"."o_orderstatus", + "t4"."o_totalprice", + "t4"."o_orderdate", + "t4"."o_orderpriority", + "t4"."o_clerk", + "t4"."o_shippriority", + "t4"."o_comment", + "t4"."l_orderkey", + "t4"."l_partkey", + "t4"."l_suppkey", + "t4"."l_linenumber", + "t4"."l_quantity", + "t4"."l_extendedprice", + "t4"."l_discount", + "t4"."l_tax", + "t4"."l_returnflag", + "t4"."l_linestatus", + "t4"."l_shipdate", + "t4"."l_commitdate", + "t4"."l_receiptdate", + "t4"."l_shipinstruct", + "t4"."l_shipmode", + "t4"."l_comment" FROM ( SELECT - t2.o_orderkey, - t2.o_custkey, - t2.o_orderstatus, - t2.o_totalprice, - t2.o_orderdate, - t2.o_orderpriority, - t2.o_clerk, - t2.o_shippriority, - t2.o_comment, - t3.l_orderkey, - t3.l_partkey, - t3.l_suppkey, - t3.l_linenumber, - t3.l_quantity, - t3.l_extendedprice, - t3.l_discount, - t3.l_tax, - t3.l_returnflag, - t3.l_linestatus, - t3.l_shipdate, - t3.l_commitdate, - t3.l_receiptdate, - t3.l_shipinstruct, - t3.l_shipmode, - t3.l_comment - FROM orders AS t2 - INNER JOIN lineitem AS t3 - ON t2.o_orderkey = t3.l_orderkey - ) AS t4 + "t2"."o_orderkey", + "t2"."o_custkey", + "t2"."o_orderstatus", + "t2"."o_totalprice", + "t2"."o_orderdate", + "t2"."o_orderpriority", + "t2"."o_clerk", + "t2"."o_shippriority", + "t2"."o_comment", + "t3"."l_orderkey", + "t3"."l_partkey", + "t3"."l_suppkey", + "t3"."l_linenumber", + "t3"."l_quantity", + "t3"."l_extendedprice", + "t3"."l_discount", + "t3"."l_tax", + "t3"."l_returnflag", + "t3"."l_linestatus", + "t3"."l_shipdate", + "t3"."l_commitdate", + "t3"."l_receiptdate", + "t3"."l_shipinstruct", + "t3"."l_shipmode", + "t3"."l_comment" + FROM "orders" AS "t2" + INNER JOIN "lineitem" AS "t3" + ON "t2"."o_orderkey" = "t3"."l_orderkey" + ) AS "t4" WHERE - t4.l_shipmode IN ('MAIL', 'SHIP') - AND t4.l_commitdate < t4.l_receiptdate - AND t4.l_shipdate < t4.l_commitdate - AND t4.l_receiptdate >= MAKE_DATE(1994, 1, 1) - AND t4.l_receiptdate < MAKE_DATE(1995, 1, 1) - ) AS t5 + "t4"."l_shipmode" IN ('MAIL', 'SHIP') + AND "t4"."l_commitdate" < "t4"."l_receiptdate" + AND "t4"."l_shipdate" < "t4"."l_commitdate" + AND "t4"."l_receiptdate" >= MAKE_DATE(1994, 1, 1) + AND "t4"."l_receiptdate" < MAKE_DATE(1995, 1, 1) + ) AS "t5" GROUP BY 1 -) AS t6 +) AS "t6" ORDER BY - t6.l_shipmode ASC \ No newline at end of file + "t6"."l_shipmode" ASC \ No newline at end of file diff --git a/ibis/backends/tests/tpch/snapshots/test_h13/test_tpc_h13/duckdb/h13.sql b/ibis/backends/tests/tpch/snapshots/test_h13/test_tpc_h13/duckdb/h13.sql index c020de0fbaec..be357166968e 100644 --- a/ibis/backends/tests/tpch/snapshots/test_h13/test_tpc_h13/duckdb/h13.sql +++ b/ibis/backends/tests/tpch/snapshots/test_h13/test_tpc_h13/duckdb/h13.sql @@ -1,45 +1,46 @@ SELECT - t6.c_count, - t6.custdist + "t6"."c_count", + "t6"."custdist" FROM ( SELECT - t5.c_count, - COUNT(*) AS custdist + "t5"."c_count", + COUNT(*) AS "custdist" FROM ( SELECT - t4.c_custkey, - COUNT(t4.o_orderkey) AS c_count + "t4"."c_custkey", + COUNT("t4"."o_orderkey") AS "c_count" FROM ( SELECT - t2.c_custkey, - t2.c_name, - t2.c_address, - t2.c_nationkey, - t2.c_phone, - t2.c_acctbal, - t2.c_mktsegment, - t2.c_comment, - t3.o_orderkey, - t3.o_custkey, - t3.o_orderstatus, - t3.o_totalprice, - t3.o_orderdate, - t3.o_orderpriority, - t3.o_clerk, - t3.o_shippriority, - t3.o_comment - FROM customer AS t2 - LEFT OUTER JOIN orders AS t3 - ON t2.c_custkey = t3.o_custkey AND NOT ( - t3.o_comment LIKE '%special%requests%' + "t2"."c_custkey", + "t2"."c_name", + "t2"."c_address", + "t2"."c_nationkey", + "t2"."c_phone", + "t2"."c_acctbal", + "t2"."c_mktsegment", + "t2"."c_comment", + "t3"."o_orderkey", + "t3"."o_custkey", + "t3"."o_orderstatus", + "t3"."o_totalprice", + "t3"."o_orderdate", + "t3"."o_orderpriority", + "t3"."o_clerk", + "t3"."o_shippriority", + "t3"."o_comment" + FROM "customer" AS "t2" + LEFT OUTER JOIN "orders" AS "t3" + ON "t2"."c_custkey" = "t3"."o_custkey" + AND NOT ( + "t3"."o_comment" LIKE '%special%requests%' ) - ) AS t4 + ) AS "t4" GROUP BY 1 - ) AS t5 + ) AS "t5" GROUP BY 1 -) AS t6 +) AS "t6" ORDER BY - t6.custdist DESC, - t6.c_count DESC \ No newline at end of file + "t6"."custdist" DESC, + "t6"."c_count" DESC \ No newline at end of file diff --git a/ibis/backends/tests/tpch/snapshots/test_h14/test_tpc_h14/duckdb/h14.sql b/ibis/backends/tests/tpch/snapshots/test_h14/test_tpc_h14/duckdb/h14.sql index 2e411aa24794..513eb4a5a6de 100644 --- a/ibis/backends/tests/tpch/snapshots/test_h14/test_tpc_h14/duckdb/h14.sql +++ b/ibis/backends/tests/tpch/snapshots/test_h14/test_tpc_h14/duckdb/h14.sql @@ -2,74 +2,75 @@ SELECT ( SUM( CASE - WHEN t5.p_type LIKE 'PROMO%' - THEN t5.l_extendedprice * ( - CAST(1 AS TINYINT) - t5.l_discount + WHEN "t5"."p_type" LIKE 'PROMO%' + THEN "t5"."l_extendedprice" * ( + CAST(1 AS TINYINT) - "t5"."l_discount" ) ELSE CAST(0 AS TINYINT) END ) * CAST(100 AS TINYINT) - ) / SUM(t5.l_extendedprice * ( - CAST(1 AS TINYINT) - t5.l_discount - )) AS promo_revenue + ) / SUM("t5"."l_extendedprice" * ( + CAST(1 AS TINYINT) - "t5"."l_discount" + )) AS "promo_revenue" FROM ( SELECT - t4.l_orderkey, - t4.l_partkey, - t4.l_suppkey, - t4.l_linenumber, - t4.l_quantity, - t4.l_extendedprice, - t4.l_discount, - t4.l_tax, - t4.l_returnflag, - t4.l_linestatus, - t4.l_shipdate, - t4.l_commitdate, - t4.l_receiptdate, - t4.l_shipinstruct, - t4.l_shipmode, - t4.l_comment, - t4.p_partkey, - t4.p_name, - t4.p_mfgr, - t4.p_brand, - t4.p_type, - t4.p_size, - t4.p_container, - t4.p_retailprice, - t4.p_comment + "t4"."l_orderkey", + "t4"."l_partkey", + "t4"."l_suppkey", + "t4"."l_linenumber", + "t4"."l_quantity", + "t4"."l_extendedprice", + "t4"."l_discount", + "t4"."l_tax", + "t4"."l_returnflag", + "t4"."l_linestatus", + "t4"."l_shipdate", + "t4"."l_commitdate", + "t4"."l_receiptdate", + "t4"."l_shipinstruct", + "t4"."l_shipmode", + "t4"."l_comment", + "t4"."p_partkey", + "t4"."p_name", + "t4"."p_mfgr", + "t4"."p_brand", + "t4"."p_type", + "t4"."p_size", + "t4"."p_container", + "t4"."p_retailprice", + "t4"."p_comment" FROM ( SELECT - t2.l_orderkey, - t2.l_partkey, - t2.l_suppkey, - t2.l_linenumber, - t2.l_quantity, - t2.l_extendedprice, - t2.l_discount, - t2.l_tax, - t2.l_returnflag, - t2.l_linestatus, - t2.l_shipdate, - t2.l_commitdate, - t2.l_receiptdate, - t2.l_shipinstruct, - t2.l_shipmode, - t2.l_comment, - t3.p_partkey, - t3.p_name, - t3.p_mfgr, - t3.p_brand, - t3.p_type, - t3.p_size, - t3.p_container, - t3.p_retailprice, - t3.p_comment - FROM lineitem AS t2 - INNER JOIN part AS t3 - ON t2.l_partkey = t3.p_partkey - ) AS t4 + "t2"."l_orderkey", + "t2"."l_partkey", + "t2"."l_suppkey", + "t2"."l_linenumber", + "t2"."l_quantity", + "t2"."l_extendedprice", + "t2"."l_discount", + "t2"."l_tax", + "t2"."l_returnflag", + "t2"."l_linestatus", + "t2"."l_shipdate", + "t2"."l_commitdate", + "t2"."l_receiptdate", + "t2"."l_shipinstruct", + "t2"."l_shipmode", + "t2"."l_comment", + "t3"."p_partkey", + "t3"."p_name", + "t3"."p_mfgr", + "t3"."p_brand", + "t3"."p_type", + "t3"."p_size", + "t3"."p_container", + "t3"."p_retailprice", + "t3"."p_comment" + FROM "lineitem" AS "t2" + INNER JOIN "part" AS "t3" + ON "t2"."l_partkey" = "t3"."p_partkey" + ) AS "t4" WHERE - t4.l_shipdate >= MAKE_DATE(1995, 9, 1) AND t4.l_shipdate < MAKE_DATE(1995, 10, 1) -) AS t5 \ No newline at end of file + "t4"."l_shipdate" >= MAKE_DATE(1995, 9, 1) + AND "t4"."l_shipdate" < MAKE_DATE(1995, 10, 1) +) AS "t5" \ No newline at end of file diff --git a/ibis/backends/tests/tpch/snapshots/test_h15/test_tpc_h15/duckdb/h15.sql b/ibis/backends/tests/tpch/snapshots/test_h15/test_tpc_h15/duckdb/h15.sql index 3a5449a2361c..78c88fcb0e00 100644 --- a/ibis/backends/tests/tpch/snapshots/test_h15/test_tpc_h15/duckdb/h15.sql +++ b/ibis/backends/tests/tpch/snapshots/test_h15/test_tpc_h15/duckdb/h15.sql @@ -1,103 +1,105 @@ SELECT - t6.s_suppkey, - t6.s_name, - t6.s_address, - t6.s_phone, - t6.total_revenue + "t6"."s_suppkey", + "t6"."s_name", + "t6"."s_address", + "t6"."s_phone", + "t6"."total_revenue" FROM ( SELECT - t2.s_suppkey, - t2.s_name, - t2.s_address, - t2.s_nationkey, - t2.s_phone, - t2.s_acctbal, - t2.s_comment, - t5.l_suppkey, - t5.total_revenue - FROM supplier AS t2 + "t2"."s_suppkey", + "t2"."s_name", + "t2"."s_address", + "t2"."s_nationkey", + "t2"."s_phone", + "t2"."s_acctbal", + "t2"."s_comment", + "t5"."l_suppkey", + "t5"."total_revenue" + FROM "supplier" AS "t2" INNER JOIN ( SELECT - t3.l_suppkey, - SUM(t3.l_extendedprice * ( - CAST(1 AS TINYINT) - t3.l_discount - )) AS total_revenue + "t3"."l_suppkey", + SUM("t3"."l_extendedprice" * ( + CAST(1 AS TINYINT) - "t3"."l_discount" + )) AS "total_revenue" FROM ( SELECT - t1.l_orderkey, - t1.l_partkey, - t1.l_suppkey, - t1.l_linenumber, - t1.l_quantity, - t1.l_extendedprice, - t1.l_discount, - t1.l_tax, - t1.l_returnflag, - t1.l_linestatus, - t1.l_shipdate, - t1.l_commitdate, - t1.l_receiptdate, - t1.l_shipinstruct, - t1.l_shipmode, - t1.l_comment - FROM lineitem AS t1 + "t1"."l_orderkey", + "t1"."l_partkey", + "t1"."l_suppkey", + "t1"."l_linenumber", + "t1"."l_quantity", + "t1"."l_extendedprice", + "t1"."l_discount", + "t1"."l_tax", + "t1"."l_returnflag", + "t1"."l_linestatus", + "t1"."l_shipdate", + "t1"."l_commitdate", + "t1"."l_receiptdate", + "t1"."l_shipinstruct", + "t1"."l_shipmode", + "t1"."l_comment" + FROM "lineitem" AS "t1" WHERE - t1.l_shipdate >= MAKE_DATE(1996, 1, 1) AND t1.l_shipdate < MAKE_DATE(1996, 4, 1) - ) AS t3 + "t1"."l_shipdate" >= MAKE_DATE(1996, 1, 1) + AND "t1"."l_shipdate" < MAKE_DATE(1996, 4, 1) + ) AS "t3" GROUP BY 1 - ) AS t5 - ON t2.s_suppkey = t5.l_suppkey -) AS t6 + ) AS "t5" + ON "t2"."s_suppkey" = "t5"."l_suppkey" +) AS "t6" WHERE - t6.total_revenue = ( + "t6"."total_revenue" = ( SELECT - MAX(t6.total_revenue) AS "Max(total_revenue)" + MAX("t6"."total_revenue") AS "Max(total_revenue)" FROM ( SELECT - t2.s_suppkey, - t2.s_name, - t2.s_address, - t2.s_nationkey, - t2.s_phone, - t2.s_acctbal, - t2.s_comment, - t5.l_suppkey, - t5.total_revenue - FROM supplier AS t2 + "t2"."s_suppkey", + "t2"."s_name", + "t2"."s_address", + "t2"."s_nationkey", + "t2"."s_phone", + "t2"."s_acctbal", + "t2"."s_comment", + "t5"."l_suppkey", + "t5"."total_revenue" + FROM "supplier" AS "t2" INNER JOIN ( SELECT - t3.l_suppkey, - SUM(t3.l_extendedprice * ( - CAST(1 AS TINYINT) - t3.l_discount - )) AS total_revenue + "t3"."l_suppkey", + SUM("t3"."l_extendedprice" * ( + CAST(1 AS TINYINT) - "t3"."l_discount" + )) AS "total_revenue" FROM ( SELECT - t1.l_orderkey, - t1.l_partkey, - t1.l_suppkey, - t1.l_linenumber, - t1.l_quantity, - t1.l_extendedprice, - t1.l_discount, - t1.l_tax, - t1.l_returnflag, - t1.l_linestatus, - t1.l_shipdate, - t1.l_commitdate, - t1.l_receiptdate, - t1.l_shipinstruct, - t1.l_shipmode, - t1.l_comment - FROM lineitem AS t1 + "t1"."l_orderkey", + "t1"."l_partkey", + "t1"."l_suppkey", + "t1"."l_linenumber", + "t1"."l_quantity", + "t1"."l_extendedprice", + "t1"."l_discount", + "t1"."l_tax", + "t1"."l_returnflag", + "t1"."l_linestatus", + "t1"."l_shipdate", + "t1"."l_commitdate", + "t1"."l_receiptdate", + "t1"."l_shipinstruct", + "t1"."l_shipmode", + "t1"."l_comment" + FROM "lineitem" AS "t1" WHERE - t1.l_shipdate >= MAKE_DATE(1996, 1, 1) AND t1.l_shipdate < MAKE_DATE(1996, 4, 1) - ) AS t3 + "t1"."l_shipdate" >= MAKE_DATE(1996, 1, 1) + AND "t1"."l_shipdate" < MAKE_DATE(1996, 4, 1) + ) AS "t3" GROUP BY 1 - ) AS t5 - ON t2.s_suppkey = t5.l_suppkey - ) AS t6 + ) AS "t5" + ON "t2"."s_suppkey" = "t5"."l_suppkey" + ) AS "t6" ) ORDER BY - t6.s_suppkey ASC \ No newline at end of file + "t6"."s_suppkey" ASC \ No newline at end of file diff --git a/ibis/backends/tests/tpch/snapshots/test_h16/test_tpc_h16/duckdb/h16.sql b/ibis/backends/tests/tpch/snapshots/test_h16/test_tpc_h16/duckdb/h16.sql index b6491dc0efa5..af66a4764073 100644 --- a/ibis/backends/tests/tpch/snapshots/test_h16/test_tpc_h16/duckdb/h16.sql +++ b/ibis/backends/tests/tpch/snapshots/test_h16/test_tpc_h16/duckdb/h16.sql @@ -1,73 +1,73 @@ SELECT - t8.p_brand, - t8.p_type, - t8.p_size, - t8.supplier_cnt + "t8"."p_brand", + "t8"."p_type", + "t8"."p_size", + "t8"."supplier_cnt" FROM ( SELECT - t7.p_brand, - t7.p_type, - t7.p_size, - COUNT(DISTINCT t7.ps_suppkey) AS supplier_cnt + "t7"."p_brand", + "t7"."p_type", + "t7"."p_size", + COUNT(DISTINCT "t7"."ps_suppkey") AS "supplier_cnt" FROM ( SELECT - t6.ps_partkey, - t6.ps_suppkey, - t6.ps_availqty, - t6.ps_supplycost, - t6.ps_comment, - t6.p_partkey, - t6.p_name, - t6.p_mfgr, - t6.p_brand, - t6.p_type, - t6.p_size, - t6.p_container, - t6.p_retailprice, - t6.p_comment + "t6"."ps_partkey", + "t6"."ps_suppkey", + "t6"."ps_availqty", + "t6"."ps_supplycost", + "t6"."ps_comment", + "t6"."p_partkey", + "t6"."p_name", + "t6"."p_mfgr", + "t6"."p_brand", + "t6"."p_type", + "t6"."p_size", + "t6"."p_container", + "t6"."p_retailprice", + "t6"."p_comment" FROM ( SELECT - t3.ps_partkey, - t3.ps_suppkey, - t3.ps_availqty, - t3.ps_supplycost, - t3.ps_comment, - t4.p_partkey, - t4.p_name, - t4.p_mfgr, - t4.p_brand, - t4.p_type, - t4.p_size, - t4.p_container, - t4.p_retailprice, - t4.p_comment - FROM partsupp AS t3 - INNER JOIN part AS t4 - ON t4.p_partkey = t3.ps_partkey - ) AS t6 + "t3"."ps_partkey", + "t3"."ps_suppkey", + "t3"."ps_availqty", + "t3"."ps_supplycost", + "t3"."ps_comment", + "t4"."p_partkey", + "t4"."p_name", + "t4"."p_mfgr", + "t4"."p_brand", + "t4"."p_type", + "t4"."p_size", + "t4"."p_container", + "t4"."p_retailprice", + "t4"."p_comment" + FROM "partsupp" AS "t3" + INNER JOIN "part" AS "t4" + ON "t4"."p_partkey" = "t3"."ps_partkey" + ) AS "t6" WHERE - t6.p_brand <> 'Brand#45' + "t6"."p_brand" <> 'Brand#45' AND NOT ( - t6.p_type LIKE 'MEDIUM POLISHED%' + "t6"."p_type" LIKE 'MEDIUM POLISHED%' ) - AND t6.p_size IN (CAST(49 AS TINYINT), CAST(14 AS TINYINT), CAST(23 AS TINYINT), CAST(45 AS TINYINT), CAST(19 AS TINYINT), CAST(3 AS TINYINT), CAST(36 AS TINYINT), CAST(9 AS TINYINT)) + AND "t6"."p_size" IN (CAST(49 AS TINYINT), CAST(14 AS TINYINT), CAST(23 AS TINYINT), CAST(45 AS TINYINT), CAST(19 AS TINYINT), CAST(3 AS TINYINT), CAST(36 AS TINYINT), CAST(9 AS TINYINT)) AND NOT ( - t6.ps_suppkey IN ( + "t6"."ps_suppkey" IN ( SELECT - t2.s_suppkey - FROM supplier AS t2 + "t2"."s_suppkey" + FROM "supplier" AS "t2" WHERE - t2.s_comment LIKE '%Customer%Complaints%' + "t2"."s_comment" LIKE '%Customer%Complaints%' ) ) - ) AS t7 + ) AS "t7" GROUP BY 1, 2, 3 -) AS t8 +) AS "t8" ORDER BY - t8.supplier_cnt DESC, - t8.p_brand ASC, - t8.p_type ASC, - t8.p_size ASC \ No newline at end of file + "t8"."supplier_cnt" DESC, + "t8"."p_brand" ASC, + "t8"."p_type" ASC, + "t8"."p_size" ASC \ No newline at end of file diff --git a/ibis/backends/tests/tpch/snapshots/test_h17/test_tpc_h17/duckdb/h17.sql b/ibis/backends/tests/tpch/snapshots/test_h17/test_tpc_h17/duckdb/h17.sql index 378aac0f97ee..8ded6c1fcdb8 100644 --- a/ibis/backends/tests/tpch/snapshots/test_h17/test_tpc_h17/duckdb/h17.sql +++ b/ibis/backends/tests/tpch/snapshots/test_h17/test_tpc_h17/duckdb/h17.sql @@ -1,92 +1,92 @@ SELECT - SUM(t7.l_extendedprice) / CAST(7.0 AS DOUBLE) AS avg_yearly + SUM("t7"."l_extendedprice") / CAST(7.0 AS DOUBLE) AS "avg_yearly" FROM ( SELECT - t4.l_orderkey, - t4.l_partkey, - t4.l_suppkey, - t4.l_linenumber, - t4.l_quantity, - t4.l_extendedprice, - t4.l_discount, - t4.l_tax, - t4.l_returnflag, - t4.l_linestatus, - t4.l_shipdate, - t4.l_commitdate, - t4.l_receiptdate, - t4.l_shipinstruct, - t4.l_shipmode, - t4.l_comment, - t4.p_partkey, - t4.p_name, - t4.p_mfgr, - t4.p_brand, - t4.p_type, - t4.p_size, - t4.p_container, - t4.p_retailprice, - t4.p_comment + "t4"."l_orderkey", + "t4"."l_partkey", + "t4"."l_suppkey", + "t4"."l_linenumber", + "t4"."l_quantity", + "t4"."l_extendedprice", + "t4"."l_discount", + "t4"."l_tax", + "t4"."l_returnflag", + "t4"."l_linestatus", + "t4"."l_shipdate", + "t4"."l_commitdate", + "t4"."l_receiptdate", + "t4"."l_shipinstruct", + "t4"."l_shipmode", + "t4"."l_comment", + "t4"."p_partkey", + "t4"."p_name", + "t4"."p_mfgr", + "t4"."p_brand", + "t4"."p_type", + "t4"."p_size", + "t4"."p_container", + "t4"."p_retailprice", + "t4"."p_comment" FROM ( SELECT - t2.l_orderkey, - t2.l_partkey, - t2.l_suppkey, - t2.l_linenumber, - t2.l_quantity, - t2.l_extendedprice, - t2.l_discount, - t2.l_tax, - t2.l_returnflag, - t2.l_linestatus, - t2.l_shipdate, - t2.l_commitdate, - t2.l_receiptdate, - t2.l_shipinstruct, - t2.l_shipmode, - t2.l_comment, - t3.p_partkey, - t3.p_name, - t3.p_mfgr, - t3.p_brand, - t3.p_type, - t3.p_size, - t3.p_container, - t3.p_retailprice, - t3.p_comment - FROM lineitem AS t2 - INNER JOIN part AS t3 - ON t3.p_partkey = t2.l_partkey - ) AS t4 + "t2"."l_orderkey", + "t2"."l_partkey", + "t2"."l_suppkey", + "t2"."l_linenumber", + "t2"."l_quantity", + "t2"."l_extendedprice", + "t2"."l_discount", + "t2"."l_tax", + "t2"."l_returnflag", + "t2"."l_linestatus", + "t2"."l_shipdate", + "t2"."l_commitdate", + "t2"."l_receiptdate", + "t2"."l_shipinstruct", + "t2"."l_shipmode", + "t2"."l_comment", + "t3"."p_partkey", + "t3"."p_name", + "t3"."p_mfgr", + "t3"."p_brand", + "t3"."p_type", + "t3"."p_size", + "t3"."p_container", + "t3"."p_retailprice", + "t3"."p_comment" + FROM "lineitem" AS "t2" + INNER JOIN "part" AS "t3" + ON "t3"."p_partkey" = "t2"."l_partkey" + ) AS "t4" WHERE - t4.p_brand = 'Brand#23' - AND t4.p_container = 'MED BOX' - AND t4.l_quantity < ( + "t4"."p_brand" = 'Brand#23' + AND "t4"."p_container" = 'MED BOX' + AND "t4"."l_quantity" < ( ( SELECT - AVG(t5.l_quantity) AS "Mean(l_quantity)" + AVG("t5"."l_quantity") AS "Mean(l_quantity)" FROM ( SELECT - t0.l_orderkey, - t0.l_partkey, - t0.l_suppkey, - t0.l_linenumber, - t0.l_quantity, - t0.l_extendedprice, - t0.l_discount, - t0.l_tax, - t0.l_returnflag, - t0.l_linestatus, - t0.l_shipdate, - t0.l_commitdate, - t0.l_receiptdate, - t0.l_shipinstruct, - t0.l_shipmode, - t0.l_comment - FROM lineitem AS t0 + "t0"."l_orderkey", + "t0"."l_partkey", + "t0"."l_suppkey", + "t0"."l_linenumber", + "t0"."l_quantity", + "t0"."l_extendedprice", + "t0"."l_discount", + "t0"."l_tax", + "t0"."l_returnflag", + "t0"."l_linestatus", + "t0"."l_shipdate", + "t0"."l_commitdate", + "t0"."l_receiptdate", + "t0"."l_shipinstruct", + "t0"."l_shipmode", + "t0"."l_comment" + FROM "lineitem" AS "t0" WHERE - t0.l_partkey = t4.p_partkey - ) AS t5 + "t0"."l_partkey" = "t4"."p_partkey" + ) AS "t5" ) * CAST(0.2 AS DOUBLE) ) -) AS t7 \ No newline at end of file +) AS "t7" \ No newline at end of file diff --git a/ibis/backends/tests/tpch/snapshots/test_h18/test_tpc_h18/duckdb/h18.sql b/ibis/backends/tests/tpch/snapshots/test_h18/test_tpc_h18/duckdb/h18.sql index 27ca9fa730fd..f15310f578b4 100644 --- a/ibis/backends/tests/tpch/snapshots/test_h18/test_tpc_h18/duckdb/h18.sql +++ b/ibis/backends/tests/tpch/snapshots/test_h18/test_tpc_h18/duckdb/h18.sql @@ -1,118 +1,118 @@ SELECT - t10.c_name, - t10.c_custkey, - t10.o_orderkey, - t10.o_orderdate, - t10.o_totalprice, - t10.sum_qty + "t10"."c_name", + "t10"."c_custkey", + "t10"."o_orderkey", + "t10"."o_orderdate", + "t10"."o_totalprice", + "t10"."sum_qty" FROM ( SELECT - t9.c_name, - t9.c_custkey, - t9.o_orderkey, - t9.o_orderdate, - t9.o_totalprice, - SUM(t9.l_quantity) AS sum_qty + "t9"."c_name", + "t9"."c_custkey", + "t9"."o_orderkey", + "t9"."o_orderdate", + "t9"."o_totalprice", + SUM("t9"."l_quantity") AS "sum_qty" FROM ( SELECT - t7.c_custkey, - t7.c_name, - t7.c_address, - t7.c_nationkey, - t7.c_phone, - t7.c_acctbal, - t7.c_mktsegment, - t7.c_comment, - t7.o_orderkey, - t7.o_custkey, - t7.o_orderstatus, - t7.o_totalprice, - t7.o_orderdate, - t7.o_orderpriority, - t7.o_clerk, - t7.o_shippriority, - t7.o_comment, - t7.l_orderkey, - t7.l_partkey, - t7.l_suppkey, - t7.l_linenumber, - t7.l_quantity, - t7.l_extendedprice, - t7.l_discount, - t7.l_tax, - t7.l_returnflag, - t7.l_linestatus, - t7.l_shipdate, - t7.l_commitdate, - t7.l_receiptdate, - t7.l_shipinstruct, - t7.l_shipmode, - t7.l_comment + "t7"."c_custkey", + "t7"."c_name", + "t7"."c_address", + "t7"."c_nationkey", + "t7"."c_phone", + "t7"."c_acctbal", + "t7"."c_mktsegment", + "t7"."c_comment", + "t7"."o_orderkey", + "t7"."o_custkey", + "t7"."o_orderstatus", + "t7"."o_totalprice", + "t7"."o_orderdate", + "t7"."o_orderpriority", + "t7"."o_clerk", + "t7"."o_shippriority", + "t7"."o_comment", + "t7"."l_orderkey", + "t7"."l_partkey", + "t7"."l_suppkey", + "t7"."l_linenumber", + "t7"."l_quantity", + "t7"."l_extendedprice", + "t7"."l_discount", + "t7"."l_tax", + "t7"."l_returnflag", + "t7"."l_linestatus", + "t7"."l_shipdate", + "t7"."l_commitdate", + "t7"."l_receiptdate", + "t7"."l_shipinstruct", + "t7"."l_shipmode", + "t7"."l_comment" FROM ( SELECT - t3.c_custkey, - t3.c_name, - t3.c_address, - t3.c_nationkey, - t3.c_phone, - t3.c_acctbal, - t3.c_mktsegment, - t3.c_comment, - t4.o_orderkey, - t4.o_custkey, - t4.o_orderstatus, - t4.o_totalprice, - t4.o_orderdate, - t4.o_orderpriority, - t4.o_clerk, - t4.o_shippriority, - t4.o_comment, - t5.l_orderkey, - t5.l_partkey, - t5.l_suppkey, - t5.l_linenumber, - t5.l_quantity, - t5.l_extendedprice, - t5.l_discount, - t5.l_tax, - t5.l_returnflag, - t5.l_linestatus, - t5.l_shipdate, - t5.l_commitdate, - t5.l_receiptdate, - t5.l_shipinstruct, - t5.l_shipmode, - t5.l_comment - FROM customer AS t3 - INNER JOIN orders AS t4 - ON t3.c_custkey = t4.o_custkey - INNER JOIN lineitem AS t5 - ON t4.o_orderkey = t5.l_orderkey - ) AS t7 + "t3"."c_custkey", + "t3"."c_name", + "t3"."c_address", + "t3"."c_nationkey", + "t3"."c_phone", + "t3"."c_acctbal", + "t3"."c_mktsegment", + "t3"."c_comment", + "t4"."o_orderkey", + "t4"."o_custkey", + "t4"."o_orderstatus", + "t4"."o_totalprice", + "t4"."o_orderdate", + "t4"."o_orderpriority", + "t4"."o_clerk", + "t4"."o_shippriority", + "t4"."o_comment", + "t5"."l_orderkey", + "t5"."l_partkey", + "t5"."l_suppkey", + "t5"."l_linenumber", + "t5"."l_quantity", + "t5"."l_extendedprice", + "t5"."l_discount", + "t5"."l_tax", + "t5"."l_returnflag", + "t5"."l_linestatus", + "t5"."l_shipdate", + "t5"."l_commitdate", + "t5"."l_receiptdate", + "t5"."l_shipinstruct", + "t5"."l_shipmode", + "t5"."l_comment" + FROM "customer" AS "t3" + INNER JOIN "orders" AS "t4" + ON "t3"."c_custkey" = "t4"."o_custkey" + INNER JOIN "lineitem" AS "t5" + ON "t4"."o_orderkey" = "t5"."l_orderkey" + ) AS "t7" WHERE - t7.o_orderkey IN ( + "t7"."o_orderkey" IN ( SELECT - t6.l_orderkey + "t6"."l_orderkey" FROM ( SELECT - t2.l_orderkey, - SUM(t2.l_quantity) AS qty_sum - FROM lineitem AS t2 + "t2"."l_orderkey", + SUM("t2"."l_quantity") AS "qty_sum" + FROM "lineitem" AS "t2" GROUP BY 1 - ) AS t6 + ) AS "t6" WHERE - t6.qty_sum > CAST(300 AS SMALLINT) + "t6"."qty_sum" > CAST(300 AS SMALLINT) ) - ) AS t9 + ) AS "t9" GROUP BY 1, 2, 3, 4, 5 -) AS t10 +) AS "t10" ORDER BY - t10.o_totalprice DESC, - t10.o_orderdate ASC + "t10"."o_totalprice" DESC, + "t10"."o_orderdate" ASC LIMIT 100 \ No newline at end of file diff --git a/ibis/backends/tests/tpch/snapshots/test_h19/test_tpc_h19/duckdb/h19.sql b/ibis/backends/tests/tpch/snapshots/test_h19/test_tpc_h19/duckdb/h19.sql index b33da3fd86a6..4243b5454981 100644 --- a/ibis/backends/tests/tpch/snapshots/test_h19/test_tpc_h19/duckdb/h19.sql +++ b/ibis/backends/tests/tpch/snapshots/test_h19/test_tpc_h19/duckdb/h19.sql @@ -1,65 +1,65 @@ SELECT - SUM(t5.l_extendedprice * ( - CAST(1 AS TINYINT) - t5.l_discount - )) AS revenue + SUM("t5"."l_extendedprice" * ( + CAST(1 AS TINYINT) - "t5"."l_discount" + )) AS "revenue" FROM ( SELECT - t4.l_orderkey, - t4.l_partkey, - t4.l_suppkey, - t4.l_linenumber, - t4.l_quantity, - t4.l_extendedprice, - t4.l_discount, - t4.l_tax, - t4.l_returnflag, - t4.l_linestatus, - t4.l_shipdate, - t4.l_commitdate, - t4.l_receiptdate, - t4.l_shipinstruct, - t4.l_shipmode, - t4.l_comment, - t4.p_partkey, - t4.p_name, - t4.p_mfgr, - t4.p_brand, - t4.p_type, - t4.p_size, - t4.p_container, - t4.p_retailprice, - t4.p_comment + "t4"."l_orderkey", + "t4"."l_partkey", + "t4"."l_suppkey", + "t4"."l_linenumber", + "t4"."l_quantity", + "t4"."l_extendedprice", + "t4"."l_discount", + "t4"."l_tax", + "t4"."l_returnflag", + "t4"."l_linestatus", + "t4"."l_shipdate", + "t4"."l_commitdate", + "t4"."l_receiptdate", + "t4"."l_shipinstruct", + "t4"."l_shipmode", + "t4"."l_comment", + "t4"."p_partkey", + "t4"."p_name", + "t4"."p_mfgr", + "t4"."p_brand", + "t4"."p_type", + "t4"."p_size", + "t4"."p_container", + "t4"."p_retailprice", + "t4"."p_comment" FROM ( SELECT - t2.l_orderkey, - t2.l_partkey, - t2.l_suppkey, - t2.l_linenumber, - t2.l_quantity, - t2.l_extendedprice, - t2.l_discount, - t2.l_tax, - t2.l_returnflag, - t2.l_linestatus, - t2.l_shipdate, - t2.l_commitdate, - t2.l_receiptdate, - t2.l_shipinstruct, - t2.l_shipmode, - t2.l_comment, - t3.p_partkey, - t3.p_name, - t3.p_mfgr, - t3.p_brand, - t3.p_type, - t3.p_size, - t3.p_container, - t3.p_retailprice, - t3.p_comment - FROM lineitem AS t2 - INNER JOIN part AS t3 - ON t3.p_partkey = t2.l_partkey - ) AS t4 + "t2"."l_orderkey", + "t2"."l_partkey", + "t2"."l_suppkey", + "t2"."l_linenumber", + "t2"."l_quantity", + "t2"."l_extendedprice", + "t2"."l_discount", + "t2"."l_tax", + "t2"."l_returnflag", + "t2"."l_linestatus", + "t2"."l_shipdate", + "t2"."l_commitdate", + "t2"."l_receiptdate", + "t2"."l_shipinstruct", + "t2"."l_shipmode", + "t2"."l_comment", + "t3"."p_partkey", + "t3"."p_name", + "t3"."p_mfgr", + "t3"."p_brand", + "t3"."p_type", + "t3"."p_size", + "t3"."p_container", + "t3"."p_retailprice", + "t3"."p_comment" + FROM "lineitem" AS "t2" + INNER JOIN "part" AS "t3" + ON "t3"."p_partkey" = "t2"."l_partkey" + ) AS "t4" WHERE ( ( @@ -69,24 +69,24 @@ FROM ( ( ( ( - t4.p_brand = 'Brand#12' + "t4"."p_brand" = 'Brand#12' ) - AND t4.p_container IN ('SM CASE', 'SM BOX', 'SM PACK', 'SM PKG') + AND "t4"."p_container" IN ('SM CASE', 'SM BOX', 'SM PACK', 'SM PKG') ) AND ( - t4.l_quantity >= CAST(1 AS TINYINT) + "t4"."l_quantity" >= CAST(1 AS TINYINT) ) ) AND ( - t4.l_quantity <= CAST(11 AS TINYINT) + "t4"."l_quantity" <= CAST(11 AS TINYINT) ) ) - AND t4.p_size BETWEEN CAST(1 AS TINYINT) AND CAST(5 AS TINYINT) + AND "t4"."p_size" BETWEEN CAST(1 AS TINYINT) AND CAST(5 AS TINYINT) ) - AND t4.l_shipmode IN ('AIR', 'AIR REG') + AND "t4"."l_shipmode" IN ('AIR', 'AIR REG') ) AND ( - t4.l_shipinstruct = 'DELIVER IN PERSON' + "t4"."l_shipinstruct" = 'DELIVER IN PERSON' ) ) OR ( @@ -96,24 +96,24 @@ FROM ( ( ( ( - t4.p_brand = 'Brand#23' + "t4"."p_brand" = 'Brand#23' ) - AND t4.p_container IN ('MED BAG', 'MED BOX', 'MED PKG', 'MED PACK') + AND "t4"."p_container" IN ('MED BAG', 'MED BOX', 'MED PKG', 'MED PACK') ) AND ( - t4.l_quantity >= CAST(10 AS TINYINT) + "t4"."l_quantity" >= CAST(10 AS TINYINT) ) ) AND ( - t4.l_quantity <= CAST(20 AS TINYINT) + "t4"."l_quantity" <= CAST(20 AS TINYINT) ) ) - AND t4.p_size BETWEEN CAST(1 AS TINYINT) AND CAST(10 AS TINYINT) + AND "t4"."p_size" BETWEEN CAST(1 AS TINYINT) AND CAST(10 AS TINYINT) ) - AND t4.l_shipmode IN ('AIR', 'AIR REG') + AND "t4"."l_shipmode" IN ('AIR', 'AIR REG') ) AND ( - t4.l_shipinstruct = 'DELIVER IN PERSON' + "t4"."l_shipinstruct" = 'DELIVER IN PERSON' ) ) ) @@ -124,24 +124,24 @@ FROM ( ( ( ( - t4.p_brand = 'Brand#34' + "t4"."p_brand" = 'Brand#34' ) - AND t4.p_container IN ('LG CASE', 'LG BOX', 'LG PACK', 'LG PKG') + AND "t4"."p_container" IN ('LG CASE', 'LG BOX', 'LG PACK', 'LG PKG') ) AND ( - t4.l_quantity >= CAST(20 AS TINYINT) + "t4"."l_quantity" >= CAST(20 AS TINYINT) ) ) AND ( - t4.l_quantity <= CAST(30 AS TINYINT) + "t4"."l_quantity" <= CAST(30 AS TINYINT) ) ) - AND t4.p_size BETWEEN CAST(1 AS TINYINT) AND CAST(15 AS TINYINT) + AND "t4"."p_size" BETWEEN CAST(1 AS TINYINT) AND CAST(15 AS TINYINT) ) - AND t4.l_shipmode IN ('AIR', 'AIR REG') + AND "t4"."l_shipmode" IN ('AIR', 'AIR REG') ) AND ( - t4.l_shipinstruct = 'DELIVER IN PERSON' + "t4"."l_shipinstruct" = 'DELIVER IN PERSON' ) ) -) AS t5 \ No newline at end of file +) AS "t5" \ No newline at end of file diff --git a/ibis/backends/tests/tpch/snapshots/test_h20/test_tpc_h20/duckdb/h20.sql b/ibis/backends/tests/tpch/snapshots/test_h20/test_tpc_h20/duckdb/h20.sql index 87dee39630d3..792ea4e34b2b 100644 --- a/ibis/backends/tests/tpch/snapshots/test_h20/test_tpc_h20/duckdb/h20.sql +++ b/ibis/backends/tests/tpch/snapshots/test_h20/test_tpc_h20/duckdb/h20.sql @@ -1,68 +1,68 @@ SELECT - t9.s_name, - t9.s_address + "t9"."s_name", + "t9"."s_address" FROM ( SELECT - t5.s_suppkey, - t5.s_name, - t5.s_address, - t5.s_nationkey, - t5.s_phone, - t5.s_acctbal, - t5.s_comment, - t6.n_nationkey, - t6.n_name, - t6.n_regionkey, - t6.n_comment - FROM supplier AS t5 - INNER JOIN nation AS t6 - ON t5.s_nationkey = t6.n_nationkey -) AS t9 + "t5"."s_suppkey", + "t5"."s_name", + "t5"."s_address", + "t5"."s_nationkey", + "t5"."s_phone", + "t5"."s_acctbal", + "t5"."s_comment", + "t6"."n_nationkey", + "t6"."n_name", + "t6"."n_regionkey", + "t6"."n_comment" + FROM "supplier" AS "t5" + INNER JOIN "nation" AS "t6" + ON "t5"."s_nationkey" = "t6"."n_nationkey" +) AS "t9" WHERE - t9.n_name = 'CANADA' - AND t9.s_suppkey IN ( + "t9"."n_name" = 'CANADA' + AND "t9"."s_suppkey" IN ( SELECT - t1.ps_suppkey - FROM partsupp AS t1 + "t1"."ps_suppkey" + FROM "partsupp" AS "t1" WHERE - t1.ps_partkey IN ( + "t1"."ps_partkey" IN ( SELECT - t3.p_partkey - FROM part AS t3 + "t3"."p_partkey" + FROM "part" AS "t3" WHERE - t3.p_name LIKE 'forest%' + "t3"."p_name" LIKE 'forest%' ) - AND t1.ps_availqty > ( + AND "t1"."ps_availqty" > ( ( SELECT - SUM(t8.l_quantity) AS "Sum(l_quantity)" + SUM("t8"."l_quantity") AS "Sum(l_quantity)" FROM ( SELECT - t4.l_orderkey, - t4.l_partkey, - t4.l_suppkey, - t4.l_linenumber, - t4.l_quantity, - t4.l_extendedprice, - t4.l_discount, - t4.l_tax, - t4.l_returnflag, - t4.l_linestatus, - t4.l_shipdate, - t4.l_commitdate, - t4.l_receiptdate, - t4.l_shipinstruct, - t4.l_shipmode, - t4.l_comment - FROM lineitem AS t4 + "t4"."l_orderkey", + "t4"."l_partkey", + "t4"."l_suppkey", + "t4"."l_linenumber", + "t4"."l_quantity", + "t4"."l_extendedprice", + "t4"."l_discount", + "t4"."l_tax", + "t4"."l_returnflag", + "t4"."l_linestatus", + "t4"."l_shipdate", + "t4"."l_commitdate", + "t4"."l_receiptdate", + "t4"."l_shipinstruct", + "t4"."l_shipmode", + "t4"."l_comment" + FROM "lineitem" AS "t4" WHERE - t4.l_partkey = t1.ps_partkey - AND t4.l_suppkey = t1.ps_suppkey - AND t4.l_shipdate >= MAKE_DATE(1994, 1, 1) - AND t4.l_shipdate < MAKE_DATE(1995, 1, 1) - ) AS t8 + "t4"."l_partkey" = "t1"."ps_partkey" + AND "t4"."l_suppkey" = "t1"."ps_suppkey" + AND "t4"."l_shipdate" >= MAKE_DATE(1994, 1, 1) + AND "t4"."l_shipdate" < MAKE_DATE(1995, 1, 1) + ) AS "t8" ) * CAST(0.5 AS DOUBLE) ) ) ORDER BY - t9.s_name ASC \ No newline at end of file + "t9"."s_name" ASC \ No newline at end of file diff --git a/ibis/backends/tests/tpch/snapshots/test_h21/test_tpc_h21/duckdb/h21.sql b/ibis/backends/tests/tpch/snapshots/test_h21/test_tpc_h21/duckdb/h21.sql index 3e5527999c44..45ba92b3a4a0 100644 --- a/ibis/backends/tests/tpch/snapshots/test_h21/test_tpc_h21/duckdb/h21.sql +++ b/ibis/backends/tests/tpch/snapshots/test_h21/test_tpc_h21/duckdb/h21.sql @@ -1,74 +1,76 @@ SELECT - t14.s_name, - t14.numwait + "t14"."s_name", + "t14"."numwait" FROM ( SELECT - t13.s_name, - COUNT(*) AS numwait + "t13"."s_name", + COUNT(*) AS "numwait" FROM ( SELECT - t10.l1_orderkey, - t10.o_orderstatus, - t10.l_receiptdate, - t10.l_commitdate, - t10.l1_suppkey, - t10.s_name, - t10.n_name + "t10"."l1_orderkey", + "t10"."o_orderstatus", + "t10"."l_receiptdate", + "t10"."l_commitdate", + "t10"."l1_suppkey", + "t10"."s_name", + "t10"."n_name" FROM ( SELECT - t5.l_orderkey AS l1_orderkey, - t8.o_orderstatus, - t5.l_receiptdate, - t5.l_commitdate, - t5.l_suppkey AS l1_suppkey, - t4.s_name, - t9.n_name - FROM supplier AS t4 - INNER JOIN lineitem AS t5 - ON t4.s_suppkey = t5.l_suppkey - INNER JOIN orders AS t8 - ON t8.o_orderkey = t5.l_orderkey - INNER JOIN nation AS t9 - ON t4.s_nationkey = t9.n_nationkey - ) AS t10 + "t5"."l_orderkey" AS "l1_orderkey", + "t8"."o_orderstatus", + "t5"."l_receiptdate", + "t5"."l_commitdate", + "t5"."l_suppkey" AS "l1_suppkey", + "t4"."s_name", + "t9"."n_name" + FROM "supplier" AS "t4" + INNER JOIN "lineitem" AS "t5" + ON "t4"."s_suppkey" = "t5"."l_suppkey" + INNER JOIN "orders" AS "t8" + ON "t8"."o_orderkey" = "t5"."l_orderkey" + INNER JOIN "nation" AS "t9" + ON "t4"."s_nationkey" = "t9"."n_nationkey" + ) AS "t10" WHERE - t10.o_orderstatus = 'F' - AND t10.l_receiptdate > t10.l_commitdate - AND t10.n_name = 'SAUDI ARABIA' + "t10"."o_orderstatus" = 'F' + AND "t10"."l_receiptdate" > "t10"."l_commitdate" + AND "t10"."n_name" = 'SAUDI ARABIA' AND EXISTS( SELECT CAST(1 AS TINYINT) AS "1" - FROM lineitem AS t6 + FROM "lineitem" AS "t6" WHERE ( - t6.l_orderkey = t10.l1_orderkey - ) AND ( - t6.l_suppkey <> t10.l1_suppkey + "t6"."l_orderkey" = "t10"."l1_orderkey" + ) + AND ( + "t6"."l_suppkey" <> "t10"."l1_suppkey" ) ) AND NOT ( EXISTS( SELECT CAST(1 AS TINYINT) AS "1" - FROM lineitem AS t7 + FROM "lineitem" AS "t7" WHERE ( ( - t7.l_orderkey = t10.l1_orderkey - ) AND ( - t7.l_suppkey <> t10.l1_suppkey + "t7"."l_orderkey" = "t10"."l1_orderkey" + ) + AND ( + "t7"."l_suppkey" <> "t10"."l1_suppkey" ) ) AND ( - t7.l_receiptdate > t7.l_commitdate + "t7"."l_receiptdate" > "t7"."l_commitdate" ) ) ) - ) AS t13 + ) AS "t13" GROUP BY 1 -) AS t14 +) AS "t14" ORDER BY - t14.numwait DESC, - t14.s_name ASC + "t14"."numwait" DESC, + "t14"."s_name" ASC LIMIT 100 \ No newline at end of file diff --git a/ibis/backends/tests/tpch/snapshots/test_h22/test_tpc_h22/duckdb/h22.sql b/ibis/backends/tests/tpch/snapshots/test_h22/test_tpc_h22/duckdb/h22.sql index 25009decccf0..9926fb04be9e 100644 --- a/ibis/backends/tests/tpch/snapshots/test_h22/test_tpc_h22/duckdb/h22.sql +++ b/ibis/backends/tests/tpch/snapshots/test_h22/test_tpc_h22/duckdb/h22.sql @@ -1,68 +1,68 @@ SELECT - t6.cntrycode, - t6.numcust, - t6.totacctbal + "t6"."cntrycode", + "t6"."numcust", + "t6"."totacctbal" FROM ( SELECT - t5.cntrycode, - COUNT(*) AS numcust, - SUM(t5.c_acctbal) AS totacctbal + "t5"."cntrycode", + COUNT(*) AS "numcust", + SUM("t5"."c_acctbal") AS "totacctbal" FROM ( SELECT CASE WHEN ( CAST(0 AS TINYINT) + 1 ) >= 1 - THEN SUBSTRING(t0.c_phone, CAST(0 AS TINYINT) + 1, CAST(2 AS TINYINT)) - ELSE SUBSTRING(t0.c_phone, CAST(0 AS TINYINT) + 1 + LENGTH(t0.c_phone), CAST(2 AS TINYINT)) - END AS cntrycode, - t0.c_acctbal - FROM customer AS t0 + THEN SUBSTRING("t0"."c_phone", CAST(0 AS TINYINT) + 1, CAST(2 AS TINYINT)) + ELSE SUBSTRING("t0"."c_phone", CAST(0 AS TINYINT) + 1 + LENGTH("t0"."c_phone"), CAST(2 AS TINYINT)) + END AS "cntrycode", + "t0"."c_acctbal" + FROM "customer" AS "t0" WHERE CASE WHEN ( CAST(0 AS TINYINT) + 1 ) >= 1 - THEN SUBSTRING(t0.c_phone, CAST(0 AS TINYINT) + 1, CAST(2 AS TINYINT)) - ELSE SUBSTRING(t0.c_phone, CAST(0 AS TINYINT) + 1 + LENGTH(t0.c_phone), CAST(2 AS TINYINT)) + THEN SUBSTRING("t0"."c_phone", CAST(0 AS TINYINT) + 1, CAST(2 AS TINYINT)) + ELSE SUBSTRING("t0"."c_phone", CAST(0 AS TINYINT) + 1 + LENGTH("t0"."c_phone"), CAST(2 AS TINYINT)) END IN ('13', '31', '23', '29', '30', '18', '17') - AND t0.c_acctbal > ( + AND "t0"."c_acctbal" > ( SELECT - AVG(t3.c_acctbal) AS "Mean(c_acctbal)" + AVG("t3"."c_acctbal") AS "Mean(c_acctbal)" FROM ( SELECT - t0.c_custkey, - t0.c_name, - t0.c_address, - t0.c_nationkey, - t0.c_phone, - t0.c_acctbal, - t0.c_mktsegment, - t0.c_comment - FROM customer AS t0 + "t0"."c_custkey", + "t0"."c_name", + "t0"."c_address", + "t0"."c_nationkey", + "t0"."c_phone", + "t0"."c_acctbal", + "t0"."c_mktsegment", + "t0"."c_comment" + FROM "customer" AS "t0" WHERE - t0.c_acctbal > CAST(0.0 AS DOUBLE) + "t0"."c_acctbal" > CAST(0.0 AS DOUBLE) AND CASE WHEN ( CAST(0 AS TINYINT) + 1 ) >= 1 - THEN SUBSTRING(t0.c_phone, CAST(0 AS TINYINT) + 1, CAST(2 AS TINYINT)) - ELSE SUBSTRING(t0.c_phone, CAST(0 AS TINYINT) + 1 + LENGTH(t0.c_phone), CAST(2 AS TINYINT)) + THEN SUBSTRING("t0"."c_phone", CAST(0 AS TINYINT) + 1, CAST(2 AS TINYINT)) + ELSE SUBSTRING("t0"."c_phone", CAST(0 AS TINYINT) + 1 + LENGTH("t0"."c_phone"), CAST(2 AS TINYINT)) END IN ('13', '31', '23', '29', '30', '18', '17') - ) AS t3 + ) AS "t3" ) AND NOT ( EXISTS( SELECT CAST(1 AS TINYINT) AS "1" - FROM orders AS t1 + FROM "orders" AS "t1" WHERE - t1.o_custkey = t0.c_custkey + "t1"."o_custkey" = "t0"."c_custkey" ) ) - ) AS t5 + ) AS "t5" GROUP BY 1 -) AS t6 +) AS "t6" ORDER BY - t6.cntrycode ASC \ No newline at end of file + "t6"."cntrycode" ASC \ No newline at end of file