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-8038) Support MAP value constructor
Date Thu, 16 Nov 2017 13:17:00 GMT

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

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

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

    https://github.com/apache/flink/pull/5015#discussion_r151406114
  
    --- Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/expressions/ExpressionParser.scala
---
    @@ -141,6 +142,7 @@ object ExpressionParser extends JavaTokenParsers with PackratParsers
{
       lazy val dataType: PackratParser[TypeInformation[_]] =
         PRIMITIVE_ARRAY ~ "(" ~> dataType <~ ")" ^^ { ct => Types.PRIMITIVE_ARRAY(ct)
} |
         OBJECT_ARRAY ~ "(" ~> dataType <~ ")" ^^ { ct => Types.OBJECT_ARRAY(ct)
} |
    +    MAP ~ "(" ~> dataType ~ dataType <~ ")" ^^ { tt => Types.MAP(tt._1, tt._2)}
|
    --- End diff --
    
    Maybe you can test an identity cast just to test the functionality.


> Support MAP value constructor
> -----------------------------
>
>                 Key: FLINK-8038
>                 URL: https://issues.apache.org/jira/browse/FLINK-8038
>             Project: Flink
>          Issue Type: New Feature
>          Components: Table API & SQL
>            Reporter: Rong Rong
>            Assignee: Rong Rong
>
> Similar to https://issues.apache.org/jira/browse/FLINK-4554
> We want to support Map value constructor which is supported by Calcite:
> https://calcite.apache.org/docs/reference.html#value-constructors
> {code:sql}
> SELECT
>   MAP['key1', f0, 'key2', f1] AS stringKeyedMap,
>   MAP['key', 'value'] AS literalMap,
>   MAP[f0, f1] AS fieldMap
> FROM
>   table
> {code}
> This should enable users to construct MapTypeInfo, one of the CompositeType.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message