[
https://issues.apache.org/jira/browse/CALCITE-4406?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17234348#comment-17234348
]
xzh_dz commented on CALCITE-4406:
---------------------------------
The following case can reproduce this problem.
{code:java}
// code placeholder
@Test void testHintThroughShuttle() throws Exception {
final String sql = "select * from emp /*+ options('key1' = 'val1') */";
final SqlNode sqlNode = getSqlParser(sql).parseStmt();
final SqlNode shuttled = sqlNode.accept(new SqlShuttle() {
@Override public SqlNode visit(SqlIdentifier identifier) {
return new SqlIdentifier(identifier.names,
identifier.getParserPosition());
}
});
final String expected = "SELECT *\n"
+ "FROM `EMP`\n"
+ "/*+ `OPTIONS`('key1' = 'val1') */";
assertThat(linux(shuttled.toString()), is(expected));
}
{code}
> SqlTableRef OPERATOR should create a SqlTableRef as the call
> ------------------------------------------------------------
>
> Key: CALCITE-4406
> URL: https://issues.apache.org/jira/browse/CALCITE-4406
> Project: Calcite
> Issue Type: Improvement
> Components: core
> Affects Versions: 1.26.0
> Reporter: Danny Chen
> Assignee: Danny Chen
> Priority: Major
> Labels: pull-request-available
> Fix For: 1.27.0
>
> Attachments: image-2020-11-18-16-01-55-504.png
>
> Time Spent: 10m
> Remaining Estimate: 0h
>
> {{SqlTableRef}} OPERATOR should create a SqlTableRef as the call, so that
> after substitution of {{SqlShuttle}}, it is still a {{SqlTableRef}} instead
> of {{SqlBasicCall}}.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)