public class CsvTableSource extends Object implements BatchTableSource<Row>, StreamTableSource<Row>, ProjectableTableSource<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 . |
RowTypeInfo |
getReturnType()
Returns the
RowTypeInfo for the return type of the CsvTableSource . |
CsvTableSource |
projectFields(int[] fields)
Returns a copy of
TableSource with ability to project fields |
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
.
NOTE: This method is for internal use only for defining a TableSource
.
Do not use it in Table API programs.
getDataSet
in interface BatchTableSource<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
.
NOTE: This method is for internal use only for defining a TableSource
.
Do not use it in Table API programs.
getDataStream
in interface StreamTableSource<Row>
public CsvTableSource projectFields(int[] fields)
TableSource
with ability to project fieldsprojectFields
in interface ProjectableTableSource<Row>
fields
- The indexes of the fields to return.ProjectableTableSource
that projects its output.Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.