Greg Hogan created FLINK-2569:
---------------------------------

             Summary: CsvReader support for ValueTypes
                 Key: FLINK-2569
                 URL: https://issues.apache.org/jira/browse/FLINK-2569
             Project: Flink
          Issue Type: Improvement
          Components: Java API
    Affects Versions: 0.9
            Reporter: Greg Hogan
            Priority: Minor


>From the Flink Programming Guide section on Data Sources: "readCsvFile(path) / 
>CsvInputFormat - Parses files of comma (or another char) delimited fields. 
>Returns a DataSet of tuples or POJOs. Supports the basic java types and their 
>Value counterparts as field types."

When specifying a ValueType, i.e.

    CsvReader csvReader = env.readCsvFile(filename);
    csvReader.types(IntValue.class, IntValue.class);

the following error occurs as BasicTypeInfo is specifically requested in 
CsvReader.types(...).

org.apache.flink.client.program.ProgramInvocationException: The main method 
caused an error.
        at 
org.apache.flink.client.program.PackagedProgram.callMainMethod(PackagedProgram.java:452)
        at 
org.apache.flink.client.program.PackagedProgram.invokeInteractiveModeForExecution(PackagedProgram.java:353)
        at org.apache.flink.client.program.Client.run(Client.java:327)
        at 
org.apache.flink.client.CliFrontend.executeProgram(CliFrontend.java:608)
        at org.apache.flink.client.CliFrontend.run(CliFrontend.java:296)
        at 
org.apache.flink.client.CliFrontend.parseParameters(CliFrontend.java:927)
        at org.apache.flink.client.CliFrontend.main(CliFrontend.java:977)
Caused by: java.lang.IllegalArgumentException: Type at position 0 is not a 
basic type.
        at 
org.apache.flink.api.java.typeutils.TupleTypeInfo.getBasicTupleTypeInfo(TupleTypeInfo.java:177)
        at org.apache.flink.api.java.io.CsvReader.types(CsvReader.java:393)
        at Driver.main(Driver.java:105)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at 
org.apache.flink.client.program.PackagedProgram.callMainMethod(PackagedProgram.java:437)
        ... 6 more




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

Reply via email to