[
https://issues.apache.org/jira/browse/CALCITE-3840?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17055335#comment-17055335
]
Julian Hyde commented on CALCITE-3840:
--------------------------------------
Regarding CALCITE-3810. I previously said that rewriting the SqlNode AST was
OK, so let's go with that. Nitpicks in {{RelBuilderTest}} formatting (arguments
to {{builder.equals}} should be indented, you can write {{builder.call(}}
rather than {{builder.getRexBuilder().makeCall(}}, and {{"FROM (SELECT
\"EMPNO\", \"DEPTNO\"\nFROM \"scott\".\"EMP\") AS \"t\"\n"}} should be split
into 2 lines because of the "\n" in the middle). But +1 when you've fixed those.
> Re-aliasing of VALUES that has column aliases produces wrong SQL in the JDBC
> adapter
> ------------------------------------------------------------------------------------
>
> Key: CALCITE-3840
> URL: https://issues.apache.org/jira/browse/CALCITE-3840
> Project: Calcite
> Issue Type: Bug
> Components: jdbc-adapter
> Affects Versions: 1.21.0
> Reporter: Christian Beikov
> Priority: Major
>
> Rendering a VALUES relnode to e.g. PostgreSQL will produce \{{FROM
> (VALUES((1))) AS t(col_alias)}} where "t" is a static alias. When e.g.
> joining with such a VALUES, the RelToSqlConverter tries to re-alias this with
> a unique alias, but fails because it produces \{{FROM (VALUES((1))) AS
> t(col_alias) AS newAlias}}.
> The fix is to replace the static table alias instead.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)