You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by "mahesh kumar behera (Jira)" <ji...@apache.org> on 2021/04/12 02:16:00 UTC

[jira] [Created] (CALCITE-4579) Conversion of PIG scripts containing FLATTEN and STRSPLIT commands fails with ClassCastException

mahesh kumar behera created CALCITE-4579:
--------------------------------------------

             Summary: Conversion of PIG scripts containing FLATTEN and STRSPLIT commands fails with ClassCastException
                 Key: CALCITE-4579
                 URL: https://issues.apache.org/jira/browse/CALCITE-4579
             Project: Calcite
          Issue Type: Bug
            Reporter: mahesh kumar behera


The sql conversion expects the child to be a sqlIdentifier. But a sqlBasicCall is returned.

Script
{code:java}

A = LOAD 'scott.DEPT' as (DEPTNO:int, DNAME:chararray, LOC:CHARARRAY);"
FOREACH A GENERATE FLATTEN(STRSPLIT(DNAME, ',')) as NAMES;
 {code}
{code:java}
    java.lang.ClassCastException: org.apache.calcite.sql.SqlBasicCall cannot be cast to org.apache.calcite.sql.SqlIdentifier
        at org.apache.calcite.rel.rel2sql.SqlImplementor$Context.toSql(SqlImplementor.java:720)
        at org.apache.calcite.rel.rel2sql.RelToSqlConverter.visit(RelToSqlConverter.java:351)
        at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:531)
        at org.apache.calcite.rel.rel2sql.RelToSqlConverter.dispatch(RelToSqlConverter.java:134)
        at org.apache.calcite.rel.rel2sql.RelToSqlConverter.visitInput(RelToSqlConverter.java:142)
        at org.apache.calcite.rel.rel2sql.SqlImplementor.visitInput(SqlImplementor.java:185)
        at org.apache.calcite.rel.rel2sql.SqlImplementor.visitInput(SqlImplementor.java:173)
        at org.apache.calcite.rel.rel2sql.SqlImplementor.visitRoot(SqlImplementor.java:153)
        at org.apache.calcite.piglet.PigConverter.pigToSql(PigConverter.java:244)
        at org.apache.calcite.piglet.PigConverter.pigToSql(PigConverter.java:227)
        at org.apache.calcite.test.PigRelOpTest$Fluent.assertSql(PigRelOpTest.java:100)
        at org.apache.calcite.test.PigRelOpTest$Fluent.access$200(PigRelOpTest.java:64)
        at org.apache.calcite.test.PigRelOpTest.testUdf(PigRelOpTest.java:286) {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)