[ 
https://issues.apache.org/jira/browse/CALCITE-494?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14233610#comment-14233610
 ] 

Julian Hyde commented on CALCITE-494:
-------------------------------------

The syntax is quite straightforward.

Calcite already has a NEXT_VALUE operator in SqlStdOperatorTable (not used). We 
would add a CURRENT_VALUE operator.

Generating code to implementing sequences is a matter of providing implementors 
for those functions, in whichever language we are targeting. [~jamestaylor], 
would we need an extra (hidden) parameter to the function so that the function 
knows whether it is being called for the 2nd time on the same row or whether it 
has advanced to a new row?

Need to add definitions of sequences to the Schema SPI. 

Expose them a JDBC metadata (they are apparently a table-type), per 
http://stackoverflow.com/questions/5637423/how-to-retrieve-sequences-metadata-from-jdbc:

{code}
meta.getTables(connection.getCatalog(), null, "%_FOO", new String[] { 
"SEQUENCE" });
{code}

> Support NEXT/CURRENT VALUE FOR syntax for sequences usage
> ---------------------------------------------------------
>
>                 Key: CALCITE-494
>                 URL: https://issues.apache.org/jira/browse/CALCITE-494
>             Project: Calcite
>          Issue Type: Improvement
>            Reporter: James Taylor
>            Assignee: Julian Hyde
>              Labels: phoenix
>
> Support the ANSI standard NEXT VALUE FOR and CURRENT VALUE FOR syntax to 
> access/increment sequence values. See 
> http://phoenix.apache.org/sequences.html and 
> http://phoenix.apache.org/language/index.html#sequence for examples.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to