calcite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Feng Zhu (JIRA)" <>
Subject [jira] [Created] (CALCITE-3081) Literal NULL should be generated in SqlDialect
Date Tue, 21 May 2019 15:04:00 GMT
Feng Zhu created CALCITE-3081:

             Summary: Literal NULL should be generated in SqlDialect
                 Key: CALCITE-3081
             Project: Calcite
          Issue Type: Bug
    Affects Versions: 1.19.0
            Reporter: Feng Zhu

In Calcite, this simple query will throw exception during validation, even it is ok in many
final String query = "select NULL as col "
    + "from \"foodmart\".\"product\"";

Exception org.apache.calcite.runtime.CalciteContextException:
From line 1, column 8 to line 1, column 11: Illegal use of 'NULL'
The right way to use 'NULL' in Calcite is:
final String query = "select cast(NULL as integer) as col "
    + "from \"foodmart\".\"product\"";
However,  the converted query by *RelToSqlConverter* is illegal in Calcite again.
FROM \"foodmart\".\"product\"
The issue is trivial, but it is against to general sense. Maybe we can generate NULL literal
in SqlDialect?

This message was sent by Atlassian JIRA

View raw message