You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Rong Rong (JIRA)" <ji...@apache.org> on 2018/09/06 00:46:00 UTC

[jira] [Commented] (FLINK-10273) Access composite type fields after a function

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

Rong Rong commented on FLINK-10273:
-----------------------------------

I was able to reproduce it on SQL but not Table API. See: https://github.com/apache/flink/compare/master...walterddr:test-FLINK-10273
SQL API throws Exception:

{code}
org.apache.flink.table.api.SqlParserException: SQL parse failed. Encountered "." at line 1, column 19.
Was expecting one of:
    <EOF> 
    "ORDER" ...
    ....
	at org.apache.flink.table.calcite.FlinkPlannerImpl.parse(FlinkPlannerImpl.scala:79)
	at org.apache.flink.table.api.TableEnvironment.sqlQuery(TableEnvironment.scala:649)
	at org.apache.flink.table.runtime.stream.sql.SqlITCase.testMyTest(SqlITCase.scala:89)
    ....
Caused by: org.apache.calcite.sql.parser.SqlParseException: Encountered "." at line 1, column 19.
Was expecting one of:
    <EOF> 
    "ORDER" ...
    ....
	at org.apache.calcite.sql.parser.impl.SqlParserImpl.convertException(SqlParserImpl.java:347)
	at org.apache.calcite.sql.parser.impl.SqlParserImpl.normalizeException(SqlParserImpl.java:128)
	at org.apache.calcite.sql.parser.SqlParser.parseQuery(SqlParser.java:137)
	at org.apache.calcite.sql.parser.SqlParser.parseStmt(SqlParser.java:162)
	at org.apache.flink.table.calcite.FlinkPlannerImpl.parse(FlinkPlannerImpl.scala:75)
	... 30 more
Caused by: org.apache.calcite.sql.parser.impl.ParseException: Encountered "." at line 1, column 19.
Was expecting one of:
    <EOF> 
    "ORDER" ...
    ....
	at org.apache.calcite.sql.parser.impl.SqlParserImpl.generateParseException(SqlParserImpl.java:23019)
	at org.apache.calcite.sql.parser.impl.SqlParserImpl.jj_consume_token(SqlParserImpl.java:22836)
	at org.apache.calcite.sql.parser.impl.SqlParserImpl.SqlStmtEof(SqlParserImpl.java:870)
	at org.apache.calcite.sql.parser.impl.SqlParserImpl.parseSqlStmtEof(SqlParserImpl.java:184)
	at org.apache.calcite.sql.parser.SqlParser.parseQuery(SqlParser.java:130)
	... 32 more
{code}

while Scala Table API is perfectly fine getting the field out. 
[~twalthr] does this match your finding? I can take a quick look, it doesn't seem to be related to FLINK-10019, but seems familiar when we dealt with FLINK-7923.

> Access composite type fields after a function
> ---------------------------------------------
>
>                 Key: FLINK-10273
>                 URL: https://issues.apache.org/jira/browse/FLINK-10273
>             Project: Flink
>          Issue Type: Bug
>          Components: Table API &amp; SQL
>    Affects Versions: 1.7.0
>            Reporter: Timo Walther
>            Priority: Major
>
> If a function returns a composite type, for example, {{Row(lon: Float, lat: Float)}}. There is currently no way of accessing fields.
> Both queries fail with exceptions:
> {code}
> select t.c.lat, t.c.lon FROM (select toCoords(12) as c) AS t
> {code}
> {code}
> select toCoords(12).lat
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)