Skip to content

Commit a5231d2

Browse files
update snapshots
1 parent 830eaf3 commit a5231d2

File tree

9 files changed

+55
-18
lines changed
  • tests/unit/core/compile/sqlglot
    • aggregations/snapshots
    • expressions/snapshots/test_string_ops/test_str_find
    • snapshots
      • test_compile_isin/test_compile_isin_not_nullable
      • test_compile_window
        • test_compile_window_w_groupby_rolling
        • test_compile_window_w_range_rolling

9 files changed

+55
-18
lines changed

tests/unit/core/compile/sqlglot/aggregations/snapshots/test_ordered_unary_compiler/test_string_agg/out.sql

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ WITH `bfcte_0` AS (
55
), `bfcte_1` AS (
66
SELECT
77
COALESCE(
8-
STRING_AGG(`string_col` ORDER BY `string_col` IS NULL ASC, `string_col` ASC, ','),
8+
STRING_AGG(`string_col`, ','
9+
ORDER BY
10+
`string_col` IS NULL ASC,
11+
`string_col` ASC),
912
''
1013
) AS `bfcol_1`
1114
FROM `bfcte_0`

tests/unit/core/compile/sqlglot/aggregations/snapshots/test_unary_compiler/test_first/out.sql

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ WITH `bfcte_0` AS (
55
), `bfcte_1` AS (
66
SELECT
77
*,
8-
FIRST_VALUE(`int64_col`) OVER (ORDER BY `int64_col` DESC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS `bfcol_1`
8+
FIRST_VALUE(`int64_col`) OVER (
9+
ORDER BY `int64_col` DESC
10+
ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING
11+
) AS `bfcol_1`
912
FROM `bfcte_0`
1013
)
1114
SELECT

tests/unit/core/compile/sqlglot/aggregations/snapshots/test_unary_compiler/test_first_non_null/out.sql

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ WITH `bfcte_0` AS (
55
), `bfcte_1` AS (
66
SELECT
77
*,
8-
FIRST_VALUE(`int64_col` IGNORE NULLS) OVER (ORDER BY `int64_col` ASC NULLS LAST ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS `bfcol_1`
8+
FIRST_VALUE(`int64_col` IGNORE NULLS) OVER (
9+
ORDER BY `int64_col` ASC NULLS LAST
10+
ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING
11+
) AS `bfcol_1`
912
FROM `bfcte_0`
1013
)
1114
SELECT

tests/unit/core/compile/sqlglot/aggregations/snapshots/test_unary_compiler/test_last/out.sql

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ WITH `bfcte_0` AS (
55
), `bfcte_1` AS (
66
SELECT
77
*,
8-
LAST_VALUE(`int64_col`) OVER (ORDER BY `int64_col` DESC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS `bfcol_1`
8+
LAST_VALUE(`int64_col`) OVER (
9+
ORDER BY `int64_col` DESC
10+
ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING
11+
) AS `bfcol_1`
912
FROM `bfcte_0`
1013
)
1114
SELECT

tests/unit/core/compile/sqlglot/aggregations/snapshots/test_unary_compiler/test_last_non_null/out.sql

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ WITH `bfcte_0` AS (
55
), `bfcte_1` AS (
66
SELECT
77
*,
8-
LAST_VALUE(`int64_col` IGNORE NULLS) OVER (ORDER BY `int64_col` ASC NULLS LAST ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS `bfcol_1`
8+
LAST_VALUE(`int64_col` IGNORE NULLS) OVER (
9+
ORDER BY `int64_col` ASC NULLS LAST
10+
ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING
11+
) AS `bfcol_1`
912
FROM `bfcte_0`
1013
)
1114
SELECT

tests/unit/core/compile/sqlglot/expressions/snapshots/test_string_ops/test_str_find/out.sql

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ WITH `bfcte_0` AS (
55
), `bfcte_1` AS (
66
SELECT
77
*,
8-
STRPOS(`string_col`, 'e') - 1 AS `bfcol_1`,
9-
STRPOS(`string_col`, 'e') - 1 AS `bfcol_2`,
10-
STRPOS(SUBSTRING(`string_col`, 1, 5), 'e') - 1 AS `bfcol_3`,
11-
STRPOS(SUBSTRING(`string_col`, 3, 3), 'e') - 1 AS `bfcol_4`
8+
INSTR(`string_col`, 'e', 1) - 1 AS `bfcol_1`,
9+
INSTR(`string_col`, 'e', 3) - 1 AS `bfcol_2`,
10+
INSTR(SUBSTRING(`string_col`, 1, 5), 'e') - 1 AS `bfcol_3`,
11+
INSTR(SUBSTRING(`string_col`, 3, 3), 'e') - 1 AS `bfcol_4`
1212
FROM `bfcte_0`
1313
)
1414
SELECT

tests/unit/core/compile/sqlglot/snapshots/test_compile_isin/test_compile_isin_not_nullable/out.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ WITH `bfcte_1` AS (
2222
SELECT
2323
`bfcte_3`.*,
2424
`bfcte_3`.`bfcol_3` IN ((
25-
SELECT
26-
`rowindex_2` AS `bfcol_4`
27-
FROM `bfcte_2`
25+
SELECT
26+
`rowindex_2` AS `bfcol_4`
27+
FROM `bfcte_2`
2828
)) AS `bfcol_5`
2929
FROM `bfcte_3`
3030
)

tests/unit/core/compile/sqlglot/snapshots/test_compile_window/test_compile_window_w_groupby_rolling/out.sql

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,18 @@ WITH `bfcte_0` AS (
2222
SELECT
2323
*,
2424
CASE
25-
WHEN SUM(CAST(NOT `bfcol_7` IS NULL AS INT64)) OVER (PARTITION BY `bfcol_9` ORDER BY `bfcol_9` ASC NULLS LAST, `rowindex` ASC NULLS LAST ROWS BETWEEN 3 PRECEDING AND CURRENT ROW) < 3
25+
WHEN SUM(CAST(NOT `bfcol_7` IS NULL AS INT64)) OVER (
26+
PARTITION BY `bfcol_9`
27+
ORDER BY `bfcol_9` ASC NULLS LAST, `rowindex` ASC NULLS LAST
28+
ROWS BETWEEN 3 PRECEDING AND CURRENT ROW
29+
) < 3
2630
THEN NULL
2731
ELSE COALESCE(
28-
SUM(CAST(`bfcol_7` AS INT64)) OVER (PARTITION BY `bfcol_9` ORDER BY `bfcol_9` ASC NULLS LAST, `rowindex` ASC NULLS LAST ROWS BETWEEN 3 PRECEDING AND CURRENT ROW),
32+
SUM(CAST(`bfcol_7` AS INT64)) OVER (
33+
PARTITION BY `bfcol_9`
34+
ORDER BY `bfcol_9` ASC NULLS LAST, `rowindex` ASC NULLS LAST
35+
ROWS BETWEEN 3 PRECEDING AND CURRENT ROW
36+
),
2937
0
3038
)
3139
END AS `bfcol_15`
@@ -40,10 +48,18 @@ WITH `bfcte_0` AS (
4048
SELECT
4149
*,
4250
CASE
43-
WHEN SUM(CAST(NOT `bfcol_8` IS NULL AS INT64)) OVER (PARTITION BY `bfcol_9` ORDER BY `bfcol_9` ASC NULLS LAST, `rowindex` ASC NULLS LAST ROWS BETWEEN 3 PRECEDING AND CURRENT ROW) < 3
51+
WHEN SUM(CAST(NOT `bfcol_8` IS NULL AS INT64)) OVER (
52+
PARTITION BY `bfcol_9`
53+
ORDER BY `bfcol_9` ASC NULLS LAST, `rowindex` ASC NULLS LAST
54+
ROWS BETWEEN 3 PRECEDING AND CURRENT ROW
55+
) < 3
4456
THEN NULL
4557
ELSE COALESCE(
46-
SUM(`bfcol_8`) OVER (PARTITION BY `bfcol_9` ORDER BY `bfcol_9` ASC NULLS LAST, `rowindex` ASC NULLS LAST ROWS BETWEEN 3 PRECEDING AND CURRENT ROW),
58+
SUM(`bfcol_8`) OVER (
59+
PARTITION BY `bfcol_9`
60+
ORDER BY `bfcol_9` ASC NULLS LAST, `rowindex` ASC NULLS LAST
61+
ROWS BETWEEN 3 PRECEDING AND CURRENT ROW
62+
),
4763
0
4864
)
4965
END AS `bfcol_21`

tests/unit/core/compile/sqlglot/snapshots/test_compile_window/test_compile_window_w_range_rolling/out.sql

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,16 @@ WITH `bfcte_0` AS (
66
SELECT
77
*,
88
CASE
9-
WHEN SUM(CAST(NOT `bfcol_1` IS NULL AS INT64)) OVER (ORDER BY UNIX_MICROS(`bfcol_0`) ASC NULLS LAST RANGE BETWEEN 2999999 PRECEDING AND CURRENT ROW) < 1
9+
WHEN SUM(CAST(NOT `bfcol_1` IS NULL AS INT64)) OVER (
10+
ORDER BY UNIX_MICROS(`bfcol_0`) ASC NULLS LAST
11+
RANGE BETWEEN 2999999 PRECEDING AND CURRENT ROW
12+
) < 1
1013
THEN NULL
1114
ELSE COALESCE(
12-
SUM(`bfcol_1`) OVER (ORDER BY UNIX_MICROS(`bfcol_0`) ASC NULLS LAST RANGE BETWEEN 2999999 PRECEDING AND CURRENT ROW),
15+
SUM(`bfcol_1`) OVER (
16+
ORDER BY UNIX_MICROS(`bfcol_0`) ASC NULLS LAST
17+
RANGE BETWEEN 2999999 PRECEDING AND CURRENT ROW
18+
),
1319
0
1420
)
1521
END AS `bfcol_6`

0 commit comments

Comments
 (0)