[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=17323469#comment-17323469 ] Flink Jira Bot commented on FLINK-10273: This issue is assigned but has not received an update in 7 days so it has been labeled "stale-assigned". If you are still working on the issue, please give an update and remove the label. If you are no longer working on the issue, please unassign so someone else may work on it. In 7 days the issue will be automatically unassigned. > 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 SQL / API >Affects Versions: 1.7.0 >Reporter: Timo Walther >Assignee: Rong Rong >Priority: Major > Labels: pull-request-available, stale-assigned > Time Spent: 20m > Remaining Estimate: 0h > > 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 (v8.3.4#803005)
[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=17334095#comment-17334095 ] Flink Jira Bot commented on FLINK-10273: This issue was marked "stale-assigned" and has not received an update in 7 days. It is now automatically unassigned. If you are still working on it, you can assign it to yourself again. Please also give an update about the status of the work. > 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 SQL / API >Affects Versions: 1.7.0 >Reporter: Timo Walther >Assignee: Rong Rong >Priority: Major > Labels: pull-request-available, stale-assigned > Time Spent: 20m > Remaining Estimate: 0h > > 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 (v8.3.4#803005)
[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=16598676#comment-16598676 ] Timo Walther commented on FLINK-10273: -- [~walterddr] [~suez1224] Have you also experienced these issues? > 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 & 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)
[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=16598786#comment-16598786 ] Rong Rong commented on FLINK-10273: --- [~twalthr] Yes I remember there are cases where resulting Composite type cannot be further concat with composite type operations. I think one of the reason is that the resulting type is a {{GenericType}} instead of a specific {{RowTypeInfo}} which I had some hard time dealing with in FLINK-9294. Another think that might have been related is: FLINK-10019 where there are some issues with Calcite when trying to type inference a {{Struct Type}}. I can dig deeper into this :-) > 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 & 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)
[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=16598919#comment-16598919 ] Timo Walther commented on FLINK-10273: -- The function returns a proper row type. Registering a view and access the fields on the view works without problems. I assume that this is a pure Calcite issue. Or we are not using Calcite correctly. Feel free to dig deeper into this, if you find time. I will take a deeper look into FLINK-10019 soon, maybe this issue is just a duplicate of FLINK-10019. > 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 & 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)
[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=16598959#comment-16598959 ] Rong Rong commented on FLINK-10273: --- sounds good. FLINK-10019 is pretty specific. but the underlying CALCITE-2468 might be more generic. I tried to resolve the issue with a quick fix but it touches some of the fundamentals. Let me know if anything I can help. > 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 & 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)
[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: "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: "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: "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 & 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)
[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=16605340#comment-16605340 ] Timo Walther commented on FLINK-10273: -- [~walterddr] yes, this only occurs in SQL. It is not a runtime problem but a Calcite parser/validator issue. > 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 & 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)
[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=16606511#comment-16606511 ] Rong Rong commented on FLINK-10273: --- Yup. I can take a deeper look at this problem actually. This has been a limitation in our system for quite a while. > 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 & 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)
[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=16607907#comment-16607907 ] Rong Rong commented on FLINK-10273: --- I found a solution via modifying Calcite {{Parser.jj}}. However, it probably will need some additional polish to be able to added to Calcite's release. I will create a JIRA ticket though. > 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 & SQL >Affects Versions: 1.7.0 >Reporter: Timo Walther >Assignee: Rong Rong >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)