-
Notifications
You must be signed in to change notification settings - Fork 591
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support BIGNUMERIC
of bigquery
#811
Conversation
Pull Request Test Coverage Report for Build 4311890584
💛 - Coveralls |
@@ -3658,6 +3658,69 @@ fn parse_json_keyword() { | |||
); | |||
} | |||
|
|||
#[test] | |||
fn parse_bignumeric_keyword() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@togami2864, can you please add tests for the resulting string?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, what do you mean by 'resulting string'?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After parsing a statement with this clause, what's the re-serialization of the query? (usually we use the verified_stmt
or one_parses_to
functions)
src/ast/data_type.rs
Outdated
|
||
/// BigNumeric type used in BigQuery | ||
/// | ||
/// [bigquery]: https://cloud.google.com/bigquery/docs/reference/standard-sql/lexical#bignumeric_literals | ||
BigNumeric, | ||
|
||
/// This is alias for BigNumeric type used in BigQuery | ||
/// | ||
/// [bigquery]: https://cloud.google.com/bigquery/docs/reference/standard-sql/lexical#bignumeric_literals | ||
BigDecimal, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Why the spaces between the data types? Seems unnecessary
- The link you put is related to nothing.
What about:
/// BigNumeric type used in BigQuery | |
/// | |
/// [bigquery]: https://cloud.google.com/bigquery/docs/reference/standard-sql/lexical#bignumeric_literals | |
BigNumeric, | |
/// This is alias for BigNumeric type used in BigQuery | |
/// | |
/// [bigquery]: https://cloud.google.com/bigquery/docs/reference/standard-sql/lexical#bignumeric_literals | |
BigDecimal, | |
/// [BigNumeric] type used in BigQuery | |
/// | |
/// [BigNumeric]: https://cloud.google.com/bigquery/docs/reference/standard-sql/lexical#bignumeric_literals | |
BigNumeric, | |
/// This is alias for [BigNumeric] type used in BigQuery | |
/// | |
/// [BigNumeric]: https://cloud.google.com/bigquery/docs/reference/standard-sql/lexical#bignumeric_literals | |
BigDecimal, |
src/ast/data_type.rs
Outdated
DataType::BigNumeric => write!(f, "BIGNUMERIC"), | ||
DataType::BigDecimal => write!(f, "BIGDECIMAL"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're not adding the precision/scale for those types. Any reason why?
Are you only focused on literals?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just considered for literals at first, but found that BigNumeric
& Numeric
with precision/scale are used in bq scripting. https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#parameterized_data_types
I'll implement because this is needed in the future.
src/ast/data_type.rs
Outdated
/// | ||
/// [BigNumeric]: https://cloud.google.com/bigquery/docs/reference/standard-sql/lexical#bignumeric_literals | ||
BigNumeric(ExactNumberInfo), | ||
/// This is alias for [BigNumeric] type used in BigQuery |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// This is alias for [BigNumeric] type used in BigQuery | |
/// This is alias for [BigDecimal] type used in BigQuery |
src/ast/data_type.rs
Outdated
BigNumeric(ExactNumberInfo), | ||
/// This is alias for [BigNumeric] type used in BigQuery | ||
/// | ||
/// [BigNumeric]: https://cloud.google.com/bigquery/docs/reference/standard-sql/lexical#bignumeric_literals |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// [BigNumeric]: https://cloud.google.com/bigquery/docs/reference/standard-sql/lexical#bignumeric_literals | |
/// [BigDecimal]: https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#decimal_types |
2e6bbdc
to
ffd79da
Compare
ffd79da
to
698cb41
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM -- thank you @AugustoFKL and @togami2864
support
BIGNUMERIC
&BIGDECIMAL
used in BIgQuery.https://cloud.google.com/bigquery/docs/reference/standard-sql/lexical#bignumeric_literals
https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#decimal_types