Skip to content

Conversation

@TrevorBergeron
Copy link
Contributor

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #<issue_number_goes_here> 🦕

@product-auto-label product-auto-label bot added size: xl Pull request size is extra large. api: bigquery Issues related to the googleapis/python-bigquery-dataframes API. labels Feb 5, 2026
"""Compiles a BigFrameNode according to the request into SQL using SQLGlot."""

output_names = tuple((expression.DerefOp(id), id.sql) for id in request.node.ids)
result_node = nodes.ResultNode(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIUC, the ResultNode shares some functionality and properties with the new SelectNode. Can we refactor them together to reduce code complexity?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ehh, they are similar, but are used at different layers of compilation, so I am hesitant to merge them. Maybe later on when code becomes more stable when can refactor commonalities more confidently

SELECT
*,
`int64_col`,
`int64_col` AS `bfcol_6`,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it's not related to this PR. The alias renaming seems to unnecessary here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think we can do more with aggregations, but (non-windowed) aggregations aren't in scope for this PR

`time_col`,
`timestamp_col`
FROM `bigframes-dev`.`sqlglot_test`.`scalar_types` FOR SYSTEM_TIME AS OF '2025-11-09T03:04:05.678901+00:00'
)
SELECT
`bool_col`,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can still apply is_star_selection optimization here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, I think we probably can, will leave further optimizations for later PRs

@TrevorBergeron TrevorBergeron marked this pull request as ready for review February 10, 2026 01:41
@TrevorBergeron TrevorBergeron requested review from a team as code owners February 10, 2026 01:41
@TrevorBergeron TrevorBergeron merged commit 61c17e3 into main Feb 10, 2026
22 of 24 checks passed
@TrevorBergeron TrevorBergeron deleted the compaction_rewriter branch February 10, 2026 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: bigquery Issues related to the googleapis/python-bigquery-dataframes API. size: xl Pull request size is extra large.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants