flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLINK-4294) Allow access of composite type fields
Date Fri, 19 Aug 2016 13:18:20 GMT

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

ASF GitHub Bot commented on FLINK-4294:
---------------------------------------

Github user fhueske commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2319#discussion_r75479361
  
    --- Diff: flink-libraries/flink-table/src/test/scala/org/apache/flink/api/scala/batch/sql/SelectITCase.scala
---
    @@ -146,4 +146,22 @@ class SelectITCase(
         tEnv.sql(sqlQuery)
       }
     
    +  @Test
    +  def testSelectWithCompositeType(): Unit = {
    +    val env = ExecutionEnvironment.getExecutionEnvironment
    +    val tEnv = TableEnvironment.getTableEnvironment(env, config)
    +
    +    val sqlQuery = "SELECT MyTable.a2, MyTable.a1._2 FROM MyTable"
    --- End diff --
    
    I found leaving out the table name (or table alias) leads to a Calcite exception which
is hard to understand. Can we throw a `TableException` instead which is more helpful for the
user?


> Allow access of composite type fields
> -------------------------------------
>
>                 Key: FLINK-4294
>                 URL: https://issues.apache.org/jira/browse/FLINK-4294
>             Project: Flink
>          Issue Type: New Feature
>          Components: Table API & SQL
>            Reporter: Timo Walther
>            Assignee: Timo Walther
>
> Currently all Flink CompositeTypes are treated as GenericRelDataTypes. It would be better
to access individual fields of composite types, too. e.g.
> {code}
> SELECT composite.name FROM composites
> SELECT tuple.f0 FROM tuples
> 'f0.getField(0)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message