GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — refactor: switch RowNumber to 0-based indexing in sqlglot compiler (#… · googleapis/google-cloud-python@25fd63b

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages/bigframes
    • bigframes/core/compile/sqlglot/aggregations
      • nullary_compiler.py
    • tests/unit/core/compile/sqlglot
      • aggregations/snapshots/test_nullary_compiler
        • test_row_number_with_window
          • out.sql
        • test_row_number
          • out.sql
      • snapshots/test_compile_concat
        • test_compile_concat_filter_sorted
          • out.sql
        • test_compile_concat
          • out.sql
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/bigframes/bigframes/core/compile/sqlglot/aggregations/nullary_compiler.py‎

Copy file name to clipboardExpand all lines: packages/bigframes/bigframes/core/compile/sqlglot/aggregations/nullary_compiler.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,5 @@ def _(
4949
result: sge.Expression = sge.func("ROW_NUMBER")
5050
if window is None:
5151
# ROW_NUMBER always needs an OVER clause.
52-
return sge.Window(this=result)
53-
return apply_window_if_present(result, window, include_framing_clauses=False)
52+
return sge.Window(this=result) - 1
53+
return apply_window_if_present(result, window, include_framing_clauses=False) - 1
Collapse file

‎packages/bigframes/tests/unit/core/compile/sqlglot/aggregations/snapshots/test_nullary_compiler/test_row_number/out.sql‎

Copy file name to clipboardExpand all lines: packages/bigframes/tests/unit/core/compile/sqlglot/aggregations/snapshots/test_nullary_compiler/test_row_number/out.sql
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ WITH `bfcte_0` AS (
1919
), `bfcte_1` AS (
2020
SELECT
2121
*,
22-
ROW_NUMBER() OVER () AS `bfcol_32`
22+
ROW_NUMBER() OVER () - 1 AS `bfcol_32`
2323
FROM `bfcte_0`
2424
)
2525
SELECT
Collapse file

‎packages/bigframes/tests/unit/core/compile/sqlglot/aggregations/snapshots/test_nullary_compiler/test_row_number_with_window/out.sql‎

Copy file name to clipboardExpand all lines: packages/bigframes/tests/unit/core/compile/sqlglot/aggregations/snapshots/test_nullary_compiler/test_row_number_with_window/out.sql
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ WITH `bfcte_0` AS (
55
), `bfcte_1` AS (
66
SELECT
77
*,
8-
ROW_NUMBER() OVER (ORDER BY `int64_col` ASC NULLS LAST) AS `bfcol_1`
8+
ROW_NUMBER() OVER (ORDER BY `int64_col` ASC NULLS LAST) - 1 AS `bfcol_1`
99
FROM `bfcte_0`
1010
)
1111
SELECT
Collapse file

‎packages/bigframes/tests/unit/core/compile/sqlglot/snapshots/test_compile_concat/test_compile_concat/out.sql‎

Copy file name to clipboardExpand all lines: packages/bigframes/tests/unit/core/compile/sqlglot/snapshots/test_compile_concat/test_compile_concat/out.sql
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ WITH `bfcte_1` AS (
77
), `bfcte_3` AS (
88
SELECT
99
*,
10-
ROW_NUMBER() OVER () AS `bfcol_7`
10+
ROW_NUMBER() OVER () - 1 AS `bfcol_7`
1111
FROM `bfcte_1`
1212
), `bfcte_5` AS (
1313
SELECT
@@ -32,7 +32,7 @@ WITH `bfcte_1` AS (
3232
), `bfcte_2` AS (
3333
SELECT
3434
*,
35-
ROW_NUMBER() OVER () AS `bfcol_22`
35+
ROW_NUMBER() OVER () - 1 AS `bfcol_22`
3636
FROM `bfcte_0`
3737
), `bfcte_4` AS (
3838
SELECT
Collapse file

‎packages/bigframes/tests/unit/core/compile/sqlglot/snapshots/test_compile_concat/test_compile_concat_filter_sorted/out.sql‎

Copy file name to clipboardExpand all lines: packages/bigframes/tests/unit/core/compile/sqlglot/snapshots/test_compile_concat/test_compile_concat_filter_sorted/out.sql
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ WITH `bfcte_2` AS (
66
), `bfcte_6` AS (
77
SELECT
88
*,
9-
ROW_NUMBER() OVER (ORDER BY `int64_col` ASC NULLS LAST) AS `bfcol_4`
9+
ROW_NUMBER() OVER (ORDER BY `int64_col` ASC NULLS LAST) - 1 AS `bfcol_4`
1010
FROM `bfcte_2`
1111
), `bfcte_10` AS (
1212
SELECT
@@ -35,7 +35,7 @@ WITH `bfcte_2` AS (
3535
), `bfcte_8` AS (
3636
SELECT
3737
*,
38-
ROW_NUMBER() OVER () AS `bfcol_15`
38+
ROW_NUMBER() OVER () - 1 AS `bfcol_15`
3939
FROM `bfcte_4`
4040
), `bfcte_12` AS (
4141
SELECT
@@ -57,7 +57,7 @@ WITH `bfcte_2` AS (
5757
), `bfcte_5` AS (
5858
SELECT
5959
*,
60-
ROW_NUMBER() OVER (ORDER BY `int64_col` ASC NULLS LAST) AS `bfcol_25`
60+
ROW_NUMBER() OVER (ORDER BY `int64_col` ASC NULLS LAST) - 1 AS `bfcol_25`
6161
FROM `bfcte_1`
6262
), `bfcte_9` AS (
6363
SELECT
@@ -86,7 +86,7 @@ WITH `bfcte_2` AS (
8686
), `bfcte_7` AS (
8787
SELECT
8888
*,
89-
ROW_NUMBER() OVER () AS `bfcol_36`
89+
ROW_NUMBER() OVER () - 1 AS `bfcol_36`
9090
FROM `bfcte_3`
9191
), `bfcte_11` AS (
9292
SELECT

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.