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 2021/04/12 18:31:00 UTC

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

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

Julian Hyde commented on CALCITE-4579:
--------------------------------------

Sounds valid. This relates to the "piglet" component. Contributions welcome.

> 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
>            Priority: Major
>
> 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)