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

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_r88699109
  
    --- Diff: 
flink-libraries/flink-table/src/main/scala/org/apache/flink/api/table/plan/RexNodeTranslator.scala
 ---
    @@ -74,15 +75,52 @@ object RexNodeTranslator {
     
       /**
         * Parses all input expressions to [[UnresolvedAlias]].
    -    * And expands star to parent's full project list.
    +    * And expands star to parent's full project list and flattens 
composite types.
         */
    -  def expandProjectList(exprs: Seq[Expression], parent: LogicalNode): 
Seq[NamedExpression] = {
    +  def expandProjectList(
    +      exprs: Seq[Expression],
    +      parent: LogicalNode,
    +      tableEnv: TableEnvironment)
    +    : Seq[NamedExpression] = {
    +
         val projectList = new ListBuffer[NamedExpression]
         exprs.foreach {
    +
           case n: UnresolvedFieldReference if n.name == "*" =>
             projectList ++= parent.output.map(UnresolvedAlias(_))
    +
    +      // flattening can only applied on field references
    +      case Flattening(composite) if
    --- End diff --
    
    Add a case for `Flattening(_)` that catches Flattenings on non-field 
expressions and throw a `ValidationException`?


> 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)

Reply via email to