You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Julian Hyde (Jira)" <ji...@apache.org> on 2020/08/07 06:07:00 UTC
[jira] [Updated] (CALCITE-4165) RelToSqlConverter fails on literal,
untyped nulls
[ https://issues.apache.org/jira/browse/CALCITE-4165?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Julian Hyde updated CALCITE-4165:
---------------------------------
Description:
Simple test in RelToSqlConverterTest (the expected SQL is probably not exactly the right expected SQL, but the test explodes on 1.24 so it doesn't matter for our purposes):
{code:java}
@Test void testUntypedNull() {
final String sql = "SELECT NULL FROM \"warehouse_class\"";
final String expected = "SELECT NULL FROM \"warehouse_class\"";
sql(sql).ok(expected);
}{code}
Stack trace (on current master [ad53962f|https://github.com/apache/calcite/commit/ad53962f76a48e2627da1c155eb5f005150d3dcb]) :
{noformat}
Unsupported type when convertTypeToSpec: NULLUnsupported type when convertTypeToSpec: NULL
java.lang.UnsupportedOperationException: Unsupported type when convertTypeToSpec: NULL at org.apache.calcite.sql.type.SqlTypeUtil.convertTypeToSpec(SqlTypeUtil.java:1027)
at org.apache.calcite.sql.SqlDialect.getCastSpec(SqlDialect.java:778)
at org.apache.calcite.rel.rel2sql.RelToSqlConverter.castNullType(RelToSqlConverter.java:361){noformat}
Seems to be an unintended side-effect of the fix for CALCITE-4066, [8db7c9d6|https://github.com/apache/calcite/commit/8db7c9d6ddc317b5fee8705e136c0794c44b463a#diff-fe53d9c0364e000f0aeafa786587e815R1079].
was:
Simple test in RelToSqlConverterTest (the expected SQL is probably not exactly the right expected SQL, but the test explodes on 1.24 so it doesn't matter for our purposes):
{code:java}
@Test void testUntypedNull() {
final String sql = "SELECT NULL FROM \"warehouse_class\"";
final String expected = "SELECT NULL FROM \"warehouse_class\"";
sql(sql).ok(expected);
}{code}
stack trace top (on current master ad53962f76a48e2627da1c155eb5f005150d3dcb)
{noformat}
Unsupported type when convertTypeToSpec: NULLUnsupported type when convertTypeToSpec: NULL
java.lang.UnsupportedOperationException: Unsupported type when convertTypeToSpec: NULL at org.apache.calcite.sql.type.SqlTypeUtil.convertTypeToSpec(SqlTypeUtil.java:1027)
at org.apache.calcite.sql.SqlDialect.getCastSpec(SqlDialect.java:778)
at org.apache.calcite.rel.rel2sql.RelToSqlConverter.castNullType(RelToSqlConverter.java:361){noformat}
Seems to be an unintended side-effect of [https://github.com/apache/calcite/commit/8db7c9d6ddc317b5fee8705e136c0794c44b463a#diff-fe53d9c0364e000f0aeafa786587e815R1079]
> RelToSqlConverter fails on literal, untyped nulls
> -------------------------------------------------
>
> Key: CALCITE-4165
> URL: https://issues.apache.org/jira/browse/CALCITE-4165
> Project: Calcite
> Issue Type: Bug
> Reporter: Steven Talbot
> Assignee: Julian Hyde
> Priority: Major
>
> Simple test in RelToSqlConverterTest (the expected SQL is probably not exactly the right expected SQL, but the test explodes on 1.24 so it doesn't matter for our purposes):
>
> {code:java}
> @Test void testUntypedNull() {
> final String sql = "SELECT NULL FROM \"warehouse_class\"";
> final String expected = "SELECT NULL FROM \"warehouse_class\"";
> sql(sql).ok(expected);
> }{code}
> Stack trace (on current master [ad53962f|https://github.com/apache/calcite/commit/ad53962f76a48e2627da1c155eb5f005150d3dcb]) :
> {noformat}
> Unsupported type when convertTypeToSpec: NULLUnsupported type when convertTypeToSpec: NULL
> java.lang.UnsupportedOperationException: Unsupported type when convertTypeToSpec: NULL at org.apache.calcite.sql.type.SqlTypeUtil.convertTypeToSpec(SqlTypeUtil.java:1027)
> at org.apache.calcite.sql.SqlDialect.getCastSpec(SqlDialect.java:778)
> at org.apache.calcite.rel.rel2sql.RelToSqlConverter.castNullType(RelToSqlConverter.java:361){noformat}
>
> Seems to be an unintended side-effect of the fix for CALCITE-4066, [8db7c9d6|https://github.com/apache/calcite/commit/8db7c9d6ddc317b5fee8705e136c0794c44b463a#diff-fe53d9c0364e000f0aeafa786587e815R1079].
--
This message was sent by Atlassian Jira
(v8.3.4#803005)