Repository navigation
fix(bigquery): keep a column's and a struct field's OPTIONS - #267
Merged
Merged
Conversation
A table column's OPTIONS (...) and a struct field's OPTIONS (...) were read and dropped, so CREATE TABLE d.t (a INT64 OPTIONS(description='ab')) and the same with 'cd', or with no OPTIONS, gave one tree. ALTER TABLE ... ADD COLUMN had the same loss. The column keeps its entries in ColumnDef.options and the struct field appends them to StructField.options after NOT NULL, the fields other dialects already fill. The other OPTIONS lists the parser reads without a field (constraint OPTIONS, UNDROP and SELECT WITH ... OPTIONS) are opaque gaps that keep their text.
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.
Why
BigQuery read a table column's and a struct field's
OPTIONS (...)and then dropped them, so these gave one tree and lost the options' contents:CREATE TABLE d.t (a INT64 OPTIONS(description='ab')), the same with'cd', and the same with noOPTIONS;ALTER TABLE d.t ADD COLUMN a INT64 OPTIONS(...);STRUCT<x INT64 OPTIONS(...)>.Changes
ColumnDef.options, and a struct field appends them toStructField.optionsafterNOT NULL: the fields other dialects already fill. No public type changes.OPTIONSlists the BigQuery parser reads without a field (constraintOPTIONS,UNDROP,SELECT WITH ... OPTIONS) are unchanged opaque gaps that keep their text.Verification
make check-cion the head.OPTIONSwith different values, and a column with and withoutOPTIONS, now give distinct trees (each pair collapsed to one tree on main).