public class CsvTableSource extends Object implements BatchTableSource<Row>, StreamTableSource<Row>
BatchTableSource
and StreamTableSource
for simple CSV files with a
(logically) unlimited number of fields.
Constructor and Description |
---|
CsvTableSource(String path,
String[] fieldNames,
TypeInformation<?>[] fieldTypes)
A
BatchTableSource and StreamTableSource for simple CSV files with a
(logically) unlimited number of fields. |
CsvTableSource(String path,
String[] fieldNames,
TypeInformation<?>[] fieldTypes,
String fieldDelim,
String rowDelim,
Character quoteCharacter,
boolean ignoreFirstLine,
String ignoreComments,
boolean lenient) |
Modifier and Type | Method and Description |
---|---|
DataSet<Row> |
getDataSet(ExecutionEnvironment execEnv)
Returns the data of the table as a
DataSet of Row . |
DataStream<Row> |
getDataStream(StreamExecutionEnvironment streamExecEnv)
Returns the data of the table as a
DataStream of Row . |
String[] |
getFieldsNames()
Returns the names of the table fields.
|
TypeInformation<?>[] |
getFieldTypes()
Returns the types of the table fields.
|
int |
getNumberOfFields()
Returns the number of fields of the table.
|
RowTypeInfo |
getReturnType()
Returns the
RowTypeInfo for the return type of the CsvTableSource . |
public CsvTableSource(String path, String[] fieldNames, TypeInformation<?>[] fieldTypes, String fieldDelim, String rowDelim, Character quoteCharacter, boolean ignoreFirstLine, String ignoreComments, boolean lenient)
public CsvTableSource(String path, String[] fieldNames, TypeInformation<?>[] fieldTypes)
BatchTableSource
and StreamTableSource
for simple CSV files with a
(logically) unlimited number of fields.
path
- The path to the CSV file.fieldNames
- The names of the table fields.fieldTypes
- The types of the table fields.public DataSet<Row> getDataSet(ExecutionEnvironment execEnv)
DataSet
of Row
.getDataSet
in interface BatchTableSource<Row>
public TypeInformation<?>[] getFieldTypes()
getFieldTypes
in interface TableSource<Row>
public String[] getFieldsNames()
getFieldsNames
in interface TableSource<Row>
public int getNumberOfFields()
getNumberOfFields
in interface TableSource<Row>
public RowTypeInfo getReturnType()
RowTypeInfo
for the return type of the CsvTableSource
.getReturnType
in interface TableSource<Row>
public DataStream<Row> getDataStream(StreamExecutionEnvironment streamExecEnv)
DataStream
of Row
.getDataStream
in interface StreamTableSource<Row>
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.