fix: support JSON and STRUCT for bbq.sql_scalar#1754
Merged
chelsea-lin merged 3 commits intomainfrom May 21, 2025
Merged
Conversation
cdd2edd to
7244c33
Compare
tswast
reviewed
May 21, 2025
| literals = [ | ||
| bigframes.dtypes.bigframes_dtype_to_literal(column.dtype) for column in columns | ||
| literals_sql = [ | ||
| sqlglot_ir._literal(column.values[0], column.dtype).sql(dialect="bigquery") |
Contributor
There was a problem hiding this comment.
column.values can be quite expensive. That's going to download everything as a numpy array. Also, it might return NaN if the first row contains null.
Can we keep using bigframes_dtype_to_literal to get representative values for the type?
Contributor
Author
There was a problem hiding this comment.
Good catch! Yes, I've implemented it so that None value generates literal SQL. This simplifies the logic, and it's confirmed by the test_sql_scalar_w_all_scalar_output test. Would you mind double-checking this?
7244c33 to
84fd8fa
Compare
8384f2d to
97b49e0
Compare
tswast
reviewed
May 21, 2025
tswast
approved these changes
May 21, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes internal issue 416015997🦕