Closed walterddr closed 1 year ago
Vote for using SET
for the following reasons:
- Presto follows this convention to set query options, so this might simplify the connector (cc @xiangfu0)
I can't find presto document for SET arbitrary setting. cc @xiangfu0 can you share more on this?
any additional comments or suggestions: @xiangfu0 @jackjlli @siddharthteotia @yupeng9
I would love to solicit more feedback before choosing the syntax. Or if there's any additional channel to share this for more feedback please do let me know
I'm also incline to SET
, as SET
is more commonly adopted by other data platforms, which requires less learning curves for users to leverage.
And I think what Jackie mentioned for SET
in Presto is that Presto uses SET
to set runtime parameters, which is similar to what Postgres does.
looks like <SET> key = value
is the way to go. implementing it soon
+1 on using SET based statement syntax.
ALTER SESSION SET key = value
). We are not introducing session or related semantics so the granularity of options is still at the per query level IIUC ?yes let me update the PR description
This issue is created follow up #8880.
Background
Currently, Pinot SQL
OPTION
keyword is a REGEX match that is allow ANYWHERE in the SQL string. This causes SQLi issues.Backward-Compatibility Issue
8880 proposed an alternative syntax of using OPTION similar to SQL setStatement (see: https://calcite.apache.org/docs/reference.html)
However, this creates a backward-incompatible change towards the Pinot SQL syntax.
Thus we propose to hold off the syntax change until we come to a consensus on which syntax to use.
SQLi Resolution
8905 proposed a temporary solution to only allow
OPTION
keyword at end of SQL string.Alternative Syntax Change
Note, for the syntax code segment:
<
,>
is used to quote reserved keywords or reserved operators.As
STATEMENT
Pinot query now only allows a single STATEMENT. So there's no difference setting OPTIONS as "clause" associated with the statement, or associates the OPTION with the entire SQL statement list context.
Potentially acceptable syntax listed below:
SET statement
identifier: simpleIdentifier | <">quoted.complex.identifier<">
literal: stringLiteral | integerLiteral | doubleLiteral | booleanLiteral
optionStatement: