You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Rui Wang (Jira)" <ji...@apache.org> on 2020/06/03 19:31:00 UTC
[jira] [Comment Edited] (CALCITE-4039) Missing LATERAL keyword
after sql validate
[ https://issues.apache.org/jira/browse/CALCITE-4039?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17125253#comment-17125253 ]
Rui Wang edited comment on CALCITE-4039 at 6/3/20, 7:30 PM:
------------------------------------------------------------
Will it it helpful to
1. still goes through the validation.
2. but get the SQL query by unparsing un-validated SqlNode.
Basically unparsing from un-validated SqlNode could be relatively robust as SqlParserTest and SqlUnparserTest provide test coverage on SQL syntax.
Validation will just a method call before you use the un-parsed query.
was (Author: amaliujia):
Will it it helpful to
1. still goes through the validation.
2. but get the SQL query by unparsing un-validated SqlNode.
Basically unparsing from un-validated SqlNode could be relatively robust as SqlParserTest and SqlUnparserTest provide test coverage on SQL syntax.
> Missing LATERAL keyword after sql validate
> ------------------------------------------
>
> Key: CALCITE-4039
> URL: https://issues.apache.org/jira/browse/CALCITE-4039
> Project: Calcite
> Issue Type: Bug
> Components: core
> Affects Versions: 1.23.0
> Reporter: YufeiLiu
> Priority: Major
>
> I tried format to sql string after validate SqlNode, but the {{LATERAL}} keyword was missing in the result.
> original sql:
> {code:sql}
> SELECT `B`, `C`, `D`, `E`
> FROM `source_table`,
> LATERAL TABLE(`MY_TABLE_FUNCTION`(`A`)) AS `T` (`B`, `C`, `D`, `E`)
> {code}
> validated sql:
> {code:sql}
> SELECT `B`, `C`, `D`, `E`
> FROM `source_table`,
> TABLE(`MY_TABLE_FUNCTION`(`A`)) AS `T` (`B`, `C`, `D`, `E`)
> {code}
> In {{SqlValidatorImpl}}, only return newOperand and missing the LATERAL operator.
> {code:java}
> case LATERAL:
> return registerFrom(
> parentScope,
> usingScope,
> register,
> ((SqlCall) node).operand(0),
> enclosingNode,
> alias,
> extendList,
> forceNullable,
> true);
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)