You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by "YufeiLiu (Jira)" <ji...@apache.org> on 2020/06/03 03:52:00 UTC

[jira] [Created] (CALCITE-4039) Missing LATERAL keyword after sql validate

YufeiLiu created CALCITE-4039:
---------------------------------

             Summary: 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


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)