iffyio commented on code in PR #1739: URL: https://github.com/apache/datafusion-sqlparser-rs/pull/1739#discussion_r1966684838
########## src/ast/mod.rs: ########## @@ -798,9 +798,15 @@ pub enum Expr { kind: CastKind, expr: Box<Expr>, data_type: DataType, - // Optional CAST(string_expression AS type FORMAT format_string_expression) as used by BigQuery - // https://cloud.google.com/bigquery/docs/reference/standard-sql/format-elements#formatting_syntax + /// Optional CAST(string_expression AS type FORMAT format_string_expression) as used by [BigQuery] + /// + /// [BigQuery]: https://cloud.google.com/bigquery/docs/reference/standard-sql/format-elements#formatting_syntax format: Option<CastFormat>, + /// Whether this was parsed as a [MySQL]-style cast, which has a different syntax for Review Comment: would it be possible to instead add the `DataType` variants that mysql uses? It seems like one issue is that the existing signed/unsigned datatypes aren't matching their expected string output. for example [Datatype::UnsignedInteger](https://github.com/apache/datafusion-sqlparser-rs/blob/339239d0c54fd0fe12e05d8de868340d07030ffa/src/ast/data_type.rs#L203-L204) outputs itself as `INTEGER UNSIGNED`. Thinking expectation behaviour could be that we introduce `DataType::IntegerUnsigned` => `INTEGER UNSIGNED` and update `DataType::UnsignedInteger` => `UNSIGNED INTEGER` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org