flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wuchong <...@git.apache.org>
Subject [GitHub] flink pull request #2319: [FLINK-4294] [table] Allow access of composite typ...
Date Wed, 24 Aug 2016 11:06:03 GMT
Github user wuchong commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2319#discussion_r76036947
  
    --- Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/api/scala/table/expressionDsl.scala
---
    @@ -223,10 +223,28 @@ trait ImplicitExpressionOperations {
         */
       def toTime = Cast(expr, SqlTimeTypeInfo.TIME)
     
    -    /**
    +  /**
         * Parses a timestamp String in the form "yy-mm-dd hh:mm:ss.fff" to a SQL Timestamp.
         */
       def toTimestamp = Cast(expr, SqlTimeTypeInfo.TIMESTAMP)
    +
    +  /**
    +    * Accesses the field of a Flink composite type (such as Tuple, POJO, etc.) by name
and
    +    * returns it's value.
    +    *
    +    * @param name name of the field (similar to Flink's field expressions)
    +    * @return value of the field
    +    */
    +  def getField(name: String) = GetCompositeField(expr, name)
    --- End diff --
    
    😞  
    
    I find that `'*` can work. So if we want to extend wildcard, `address.get('*)` maybe a
good choice. Or we can use `_` to replace `*` , such as  `address.$_`.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message