You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/10/02 14:41:01 UTC

[jira] [Commented] (FLINK-7452) Add helper methods for all built-in Flink types to Types

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

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

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

    https://github.com/apache/flink/pull/4612#discussion_r142157854
  
    --- Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/Types.scala ---
    @@ -20,60 +20,123 @@ package org.apache.flink.table.api
     import org.apache.flink.api.common.typeinfo.{PrimitiveArrayTypeInfo, TypeInformation, Types => JTypes}
     import org.apache.flink.api.java.typeutils.{MapTypeInfo, ObjectArrayTypeInfo}
     import org.apache.flink.table.typeutils.TimeIntervalTypeInfo
    -import org.apache.flink.types.Row
     
     import _root_.scala.annotation.varargs
     
     /**
    -  * This class enumerates all supported types of the Table API.
    +  * This class enumerates all supported types of the Table API & SQL.
       */
     object Types {
    --- End diff --
    
    Makes sense, thanks


> Add helper methods for all built-in Flink types to Types
> --------------------------------------------------------
>
>                 Key: FLINK-7452
>                 URL: https://issues.apache.org/jira/browse/FLINK-7452
>             Project: Flink
>          Issue Type: Improvement
>          Components: Type Serialization System
>            Reporter: Timo Walther
>            Assignee: Timo Walther
>
> Sometimes it is very difficult to provide `TypeInformation` manually, in case some extraction fails or is not available. {{TypeHint}}s should be the preferred way but this methods can ensure correct types.
> I propose to add all built-in Flink types to the {{Types}}. Such as:
> {code}
> Types.POJO(MyPojo.class)
> Types.POJO(Map<String, TypeInformation>)
> Types.GENERIC(Object.class)
> Types.TUPLE(TypeInformation, ...)
> Types.MAP(TypeInformation, TypeInformation)
> {code}
> The methods should validate that the returned type is exactly the requested type. And especially in case of POJO should help creating  {{PojoTypeInfo}}.
> Once this is in place, we can deprecate the {{TypeInfoParser}}.



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