[
https://issues.apache.org/jira/browse/CALCITE-1940?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16149506#comment-16149506
]
Julian Hyde commented on CALCITE-1940:
--------------------------------------
bw. I somehow need to know in the SqlWriter which dialect a schema uses so that
I can call the appropriate unparse method.
Run {{JdbcAdapterTest.testFilterUnionPlan}} in the debugger with a breakpoint
in {{JdbcToEnumerableConverter.generateSql(SqlDialect)}}. You'll see that the
dialect comes from the convention of the input to the
{{JdbcToEnumerableConverter}}. That input is a {{JdbcRel}}, its convention is
an instance of {{JdbcConvention}}, and {{JdbcConvention}} has a {{sqlDialect}}
field.
In a hybrid plan (say joining a table in MySQL to a table in PostgreSQL) there
will be two instances of {{JdbcConvention}} with different dialects.
So you see the dialect is not associated with the schema. It is associated with
the JdbcRel via JdbcConvention.
It is conceivable that we send just a JdbcValues to PostgreSQL and generate
"select 1 union select 2". There is no schema in play because there is no table
yet we still know to use PostgreSQL dialect.
> Implement dialect specific support for sequences
> ------------------------------------------------
>
> Key: CALCITE-1940
> URL: https://issues.apache.org/jira/browse/CALCITE-1940
> Project: Calcite
> Issue Type: Improvement
> Reporter: Christian Beikov
> Assignee: Julian Hyde
>
> The Calcite parser and validator already supports sequences but the push down
> to the JDBC level is currently limited. SInce sequences are not supported on
> all DBMS every sql dialect should have the possibility to render it's own way
> of extracting sequence information or incrementing the value.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)