You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "hagersaleh (JIRA)" <ji...@apache.org> on 2015/04/13 15:30:12 UTC
[jira] [Comment Edited] (FLINK-1872) How can generation dataset in
flink automatic depend on number of filed and data type
[ https://issues.apache.org/jira/browse/FLINK-1872?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14492386#comment-14492386 ]
hagersaleh edited comment on FLINK-1872 at 4/13/15 1:30 PM:
------------------------------------------------------------
how Casting csv file into dataset
was (Author: hager):
how Casting csv file is table to dataset
> How can generation dataset in flink automatic depend on number of filed and data type
> --------------------------------------------------------------------------------------
>
> Key: FLINK-1872
> URL: https://issues.apache.org/jira/browse/FLINK-1872
> Project: Flink
> Issue Type: Bug
> Reporter: hagersaleh
>
> when read csv file want generate dataset function automatic
> Example write this Mnola
> but want generate this code automatic for any csv flie input
> final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
>
> DataSet<Tuple5<Integer, String, String, Integer, Double>> customers = getCustomerDataSet(env);
> private static DataSet<Tuple5<Integer, String, String, Integer, Double>> getCustomerDataSet(ExecutionEnvironment env) {
> return env.readCsvFile(customerPath)
> .fieldDelimiter("|")
> .includeFields("11110100")
> .types(Integer.class, String.class, String.class, Integer.class, Double.class);
> }
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)