xkrogen commented on PR #38712:
URL: https://github.com/apache/spark/pull/38712#issuecomment-1332434274
All 3 of the examples you provided use different syntax (`:id` vs `@id` vs
`{{ id }}`). Can we provide more motivation for why we are picking the syntax
used in this implementation? [SQL-92 defined ANSI Dynamic
SQL](https://docs.oracle.com/cd/A81042_01/DOC/appdev.816/a76942/pc_14ady.htm)
which uses colons (`:id`). One other example using `:` is
[SQLAlchemy](https://docs.sqlalchemy.org/en/14/core/tutorial.html#using-textual-sql).
Other examples (besides JDBC) only supporting positional arguments:
* [Trino](https://trino.io/docs/current/sql/execute.html) &
[PrestoDB](https://prestodb.io/docs/current/sql/execute.html)
* [PostgreSQL](https://www.postgresql.org/docs/current/ecpg-dynamic.html)
*
[Snowflake](https://docs.snowflake.com/en/sql-reference/sql/execute-immediate.html)
*
[MySQL][(https://dev.mysql.com/doc/refman/8.0/en/user-variables.html](https://dev.mysql.com/doc/refman/8.0/en/sql-prepared-statements.html)
So from what I am seeing, positional arguments (with `?` placeholders) are
the most common, and when named parameters are supported, colons are the most
common way to denote them (including ANSI support). I feel there is a good
argument to be made that named arguments are much easier to work with than
positional so I am supportive of using named args rather than positional, but I
feel we should at least follow the ANSI standard and use colons rather than
at-signs.
--
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]