[
https://issues.apache.org/jira/browse/CALCITE-2395?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16547178#comment-16547178
]
Julian Hyde commented on CALCITE-2395:
--------------------------------------
It looks good. There a few mostly cosmetic things I would have done slightly
differently:
* Don't create a SqlUpdatabilityClause class. Just use SqlNodeList (or null if
the clause is absent).
* Rather than "updatabality clause", call it "lock clause" or just "lock". It's
a declaration of what and how to lock when executing the query, and
"updatability" is quite a mouthful.
* It should a list of identifiers, not simple identifiers: {{select * from t
for update of s.t2}} is valid.
* Please also update the SQL syntax in reference.md.
Step 1b is to add some positive and negative tests in SqlValidatorTest and make
sure they pass. Then, yes, SqlToRelConverter (2). Probably very few planner
rules (3) at this point.
> Support SELECT xxx FROM TABLE FOR UPDATE syntax
> -----------------------------------------------
>
> Key: CALCITE-2395
> URL: https://issues.apache.org/jira/browse/CALCITE-2395
> Project: Calcite
> Issue Type: New Feature
> Components: core
> Affects Versions: 1.16.0
> Reporter: Enrico Olivelli
> Assignee: Julian Hyde
> Priority: Major
>
> I am using Calcite SQL Parser and Volcano Planner.
> I need to support SQL syntax
> SELECT ... FROM table FOR UPDATE
>
> see for instance PostGre docs
> [https://www.postgresql.org/docs/9.5/static/sql-select.html.]
>
> I would like at least to support this syntax at SQL Parser level, the 'for
> update' spec should be reported by the RelNode so that the system can take it
> into account and perform explicit locking.
>
> Linked downstream project issue:
> https://github.com/diennea/herddb/issues/228
>
>
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)