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

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

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

    https://github.com/apache/flink/pull/2919#discussion_r91111043
  
    --- Diff: 
flink-libraries/flink-table/src/main/scala/org/apache/flink/api/scala/table/expressionDsl.scala
 ---
    @@ -454,6 +455,29 @@ trait ImplicitExpressionOperations {
         * into a flat representation where every subtype is a separate field.
         */
       def flatten() = Flattening(expr)
    +
    +  /**
    +    * Accesses the element of an array based on an index (starting at 1).
    +    *
    +    * @param index position of the element (starting at 1)
    +    * @return value of the element
    +    */
    +  def at(index: Expression) = ArrayElementAt(expr, index)
    +
    +  /**
    +    * Returns the number of elements of an array.
    +    *
    +    * @return number of element
    +    */
    +  def cardinality() = ArrayCardinality(expr)
    +
    +  /**
    +    * Returns the sole element of an array. Returns null if the collection 
is empty.
    +    * Throws an exception if the array has more than one element.
    +    *
    +    * @return first element of the array
    --- End diff --
    
    `the only element of an array with a single entry`?


> Add support for array types
> ---------------------------
>
>                 Key: FLINK-4554
>                 URL: https://issues.apache.org/jira/browse/FLINK-4554
>             Project: Flink
>          Issue Type: New Feature
>          Components: Table API & SQL
>            Reporter: Timo Walther
>            Assignee: Timo Walther
>
> Support creating arrays:
> {code}ARRAY[1, 2, 3]{code}
> Access array values:
> {code}myArray[3]{code}
> And operations like:
> {{UNNEST, UNNEST WITH ORDINALITY, CARDINALITY}}



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

Reply via email to