sdf-jkl opened a new pull request, #3047: URL: https://github.com/apache/datafusion-sqlparser-rs/pull/3047
Dialects: all Add Databricks' [`?::` shorthand for `TRY_CAST`](https://docs.databricks.com/aws/en/sql/language-manual/functions/questiondoublecolonsign), so `v:price?::DOUBLE` parses and round-trips with a distinct cast kind. It shares `::` precedence and preserves positional-parameter casts such as `?::INT`. **Dialect question:** this follows the existing `::` implementation by accepting the operator without a dialect flag. Databricks documents `?::`; I did not find it in the other dialect references checked. Should it instead be restricted to Databricks and Generic, or should both cast shortcuts follow the existing permissive behavior? For comparison, [PostgreSQL](https://www.postgresql.org/docs/current/sql-expressions.html#SQL-SYNTAX-TYPE-CASTS), [Snowflake](https://docs.snowflake.com/en/sql-reference/functions/cast), and [DuckDB](https://duckdb.org/docs/stable/sql/expressions/cast.html) document `::`, while [SQLite](https://www.sqlite.org/lang_expr.html#cast_expressions) documents `CAST(expr AS type-name)` without that shortcut. Parser acceptance is therefore already broader than documented engine syntax. Tests cover casts across dialects, chained casts, Variant paths, parameter casts, malformed operators, and Snowflake staged-load expressions. Validation: `cargo test --all-features` (1,972 tests), formatting, and Clippy (existing unknown-lint warning) passed. Local engine checks: PostgreSQL 18.6 and DuckDB 1.5.5 accept `::` and reject `?::`; DuckDB accepts `TRY_CAST`, while PostgreSQL rejects that syntax. Other dialects were checked against documentation only. AI assistance: implementation and validation assisted by OpenAI Codex. -- 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]
