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/09/15 13:39: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=16167868#comment-16167868 ]
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_r138919667
--- Diff: flink-core/src/main/java/org/apache/flink/api/common/typeinfo/Types.java ---
@@ -19,56 +19,408 @@
package org.apache.flink.api.common.typeinfo;
import org.apache.flink.annotation.PublicEvolving;
+import org.apache.flink.api.common.functions.InvalidTypesException;
+import org.apache.flink.api.java.typeutils.EitherTypeInfo;
+import org.apache.flink.api.java.typeutils.EnumTypeInfo;
+import org.apache.flink.api.java.typeutils.GenericTypeInfo;
+import org.apache.flink.api.java.typeutils.ListTypeInfo;
+import org.apache.flink.api.java.typeutils.MapTypeInfo;
+import org.apache.flink.api.java.typeutils.ObjectArrayTypeInfo;
+import org.apache.flink.api.java.typeutils.PojoField;
+import org.apache.flink.api.java.typeutils.PojoTypeInfo;
import org.apache.flink.api.java.typeutils.RowTypeInfo;
+import org.apache.flink.api.java.typeutils.TupleTypeInfo;
+import org.apache.flink.api.java.typeutils.TypeExtractor;
+import org.apache.flink.api.java.typeutils.ValueTypeInfo;
-import java.math.BigDecimal;
-import java.sql.Date;
-import java.sql.Time;
-import java.sql.Timestamp;
+import java.lang.reflect.Field;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
/**
- * This class gives access to the type information of the most most common types.
+ * This class gives access to the type information of the most common types for which Flink
+ * has built-in serializers and comparators.
+ *
+ * <p>In many cases, Flink tries to analyze generic signatures of functions to determine return
+ * types automatically. This class is intended for cases where the extraction is not possible
+ * (or inefficient) as well as cases where type information has to be supplied manually.
+ *
+ * <p>Depending on the API you are using (e.g. Scala API or Table API), there might be a more
--- End diff --
How about `Please note that the Scala API and Table API provide more specialized Types classes`, maybe linking to (or providing the full name) of these classes?
> 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)