kdn36 opened a new pull request, #2643: URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2643
Dialects: Generic, BigQuery, Databricks, Spark Fixes #2642. When a `>>` closes two angle-bracket types at once, a following array suffix was attached to the inner type: `STRUCT<a STRUCT<b INT>>[]` parsed as `STRUCT<a STRUCT<b INT>[]>`, `ARRAY<ARRAY<INT>>[]` as `ARRAY<ARRAY<INT>[]>`, and `STRUCT<a STRUCT<b INT>> ARRAY` as `STRUCT<a STRUCT<b INT> ARRAY>`. `parse_data_type_helper` now returns right after a type whose closing `>>` was matched (`trailing_bracket.0`), so no suffix (`[]`, `ARRAY`, `ZEROFILL`) attaches to it and the enclosing type takes it, as it does with a space (`> >[]`). The test covers `[]` (Generic), the `ARRAY` keyword (all dialects with angle-bracket `STRUCT`), `MAP<...> ARRAY` (Databricks, Spark) and two malformed suffixes. Struct field `OPTIONS` after `>>` have the same problem; I'll send a separate PR for that. Built and tested with AI. Human driven and reviewed. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
