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

YufeiLiu commented on CALCITE-4039:
-----------------------------------

[~danny0405] I want to build a sql format tool of our internal platform, could 
do some internal check and complete query fields like "SELECT *" in validate.

I think the unparse sql string from SqlNode should have the same functionality 
as the original one.

> 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)

Reply via email to