[
https://issues.apache.org/jira/browse/FLINK-2435?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16633714#comment-16633714
]
ASF GitHub Bot commented on FLINK-2435:
---------------------------------------
ex00 commented on a change in pull request #5862: [FLINK-2435] User-defined
types in CsvReader
URL: https://github.com/apache/flink/pull/5862#discussion_r221242052
##########
File path:
flink-core/src/main/java/org/apache/flink/api/java/typeutils/TupleTypeInfo.java
##########
@@ -238,6 +238,37 @@ public String toString() {
return tupleInfo;
}
+ /**
+ * Resolves a type information for each specified income type and forms
an instance of a resulting {@link TupleTypeInfo} type.
+ * @param incomeTypes tuple fields' types
+ * @param <X> a resulting type of a tuple, e.g. Tuple1, Tuple2...
+ * @return A tuple information type, built from the specified income
types.
+ */
+ @SuppressWarnings("unchecked")
+ @PublicEvolving
+ public static <X extends Tuple> TupleTypeInfo<X>
getTupleTypeInfo(Class<?>... incomeTypes) {
+ if (incomeTypes == null || incomeTypes.length == 0) {
+ throw new IllegalArgumentException();
Review comment:
I think the good idea add here message for exception.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Add support for custom CSV field parsers
> ----------------------------------------
>
> Key: FLINK-2435
> URL: https://issues.apache.org/jira/browse/FLINK-2435
> Project: Flink
> Issue Type: New Feature
> Components: DataSet API
> Affects Versions: 0.10.0
> Reporter: Fabian Hueske
> Assignee: Dmitrii Kober
> Priority: Minor
> Labels: pull-request-available
>
> The {{CSVInputFormats}} have only {{FieldParsers}} for Java's primitive types
> (byte, short, int, long, float, double, boolean, String).
> It would be good to add support for CSV field parsers for custom data types
> which can be registered in a {{CSVReader}}.
> We could offer two interfaces for field parsers.
> 1. The regular low-level {{FieldParser}} which operates on a byte array and
> offsets.
> 2. A {{StringFieldParser}} which operates on a String that has been extracted
> by a {{StringParser}} before. This interface will be easier to implement but
> less efficient.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)