Package org.apache.flink.table.sources
Class CsvTableSource
- java.lang.Object
-
- org.apache.flink.table.sources.CsvTableSource
-
- All Implemented Interfaces:
StreamTableSource<org.apache.flink.types.Row>
,org.apache.flink.table.legacy.sources.LookupableTableSource<org.apache.flink.types.Row>
,org.apache.flink.table.legacy.sources.ProjectableTableSource<org.apache.flink.types.Row>
,org.apache.flink.table.legacy.sources.TableSource<org.apache.flink.types.Row>
@Internal @Deprecated public class CsvTableSource extends Object implements StreamTableSource<org.apache.flink.types.Row>, org.apache.flink.table.legacy.sources.LookupableTableSource<org.apache.flink.types.Row>, org.apache.flink.table.legacy.sources.ProjectableTableSource<org.apache.flink.types.Row>
Deprecated.The legacy CSV connector has been replaced byFileSource
. It is kept only to support tests for the legacy connector stack.AStreamTableSource
for simple CSV files with a (logically) unlimited number of fields.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CsvTableSource.Builder
Deprecated.A builder for creating CsvTableSource instances.static class
CsvTableSource.CsvLookupFunction
Deprecated.LookupFunction to support lookup in CsvTableSource.
-
Constructor Summary
Constructors Constructor Description CsvTableSource(String path, String[] fieldNames, org.apache.flink.api.common.typeinfo.TypeInformation<?>[] fieldTypes)
Deprecated.AInputFormatTableSource
andLookupableTableSource
for simple CSV files with a (logically) unlimited number of fields.CsvTableSource(String path, String[] fieldNames, org.apache.flink.api.common.typeinfo.TypeInformation<?>[] fieldTypes, int[] selectedFields, String fieldDelim, String lineDelim, Character quoteCharacter, boolean ignoreFirstLine, String ignoreComments, boolean lenient)
Deprecated.AInputFormatTableSource
andLookupableTableSource
for simple CSV files with a (logically) unlimited number of fields.CsvTableSource(String path, String[] fieldNames, org.apache.flink.api.common.typeinfo.TypeInformation<?>[] fieldTypes, String fieldDelim, String lineDelim, Character quoteCharacter, boolean ignoreFirstLine, String ignoreComments, boolean lenient)
Deprecated.AInputFormatTableSource
andLookupableTableSource
for simple CSV files with a (logically) unlimited number of fields.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static CsvTableSource.Builder
builder()
Deprecated.Return a new builder that builds a CsvTableSource.boolean
equals(Object o)
Deprecated.String
explainSource()
Deprecated.org.apache.flink.table.functions.AsyncTableFunction<org.apache.flink.types.Row>
getAsyncLookupFunction(String[] lookupKeys)
Deprecated.org.apache.flink.streaming.api.datastream.DataStream<org.apache.flink.types.Row>
getDataStream(org.apache.flink.streaming.api.environment.StreamExecutionEnvironment execEnv)
Deprecated.Returns the data of the table as aDataStream
.org.apache.flink.table.functions.TableFunction<org.apache.flink.types.Row>
getLookupFunction(String[] lookupKeys)
Deprecated.org.apache.flink.table.types.DataType
getProducedDataType()
Deprecated.org.apache.flink.table.legacy.api.TableSchema
getTableSchema()
Deprecated.int
hashCode()
Deprecated.boolean
isAsyncEnabled()
Deprecated.boolean
isBounded()
Deprecated.Returns true if this is a bounded source, false if this is an unbounded source.CsvTableSource
projectFields(int[] fields)
Deprecated.
-
-
-
Constructor Detail
-
CsvTableSource
public CsvTableSource(String path, String[] fieldNames, org.apache.flink.api.common.typeinfo.TypeInformation<?>[] fieldTypes)
Deprecated.AInputFormatTableSource
andLookupableTableSource
for simple CSV files with a (logically) unlimited number of fields.- Parameters:
path
- The path to the CSV file.fieldNames
- The names of the table fields.fieldTypes
- The types of the table fields.
-
CsvTableSource
public CsvTableSource(String path, String[] fieldNames, org.apache.flink.api.common.typeinfo.TypeInformation<?>[] fieldTypes, String fieldDelim, String lineDelim, Character quoteCharacter, boolean ignoreFirstLine, String ignoreComments, boolean lenient)
Deprecated.AInputFormatTableSource
andLookupableTableSource
for simple CSV files with a (logically) unlimited number of fields.- Parameters:
path
- The path to the CSV file.fieldNames
- The names of the table fields.fieldTypes
- The types of the table fields.fieldDelim
- The field delimiter, "," by default.lineDelim
- The row delimiter, "\n" by default.quoteCharacter
- An optional quote character for String values, null by default.ignoreFirstLine
- Flag to ignore the first line, false by default.ignoreComments
- An optional prefix to indicate comments, null by default.lenient
- Flag to skip records with parse error instead to fail, false by default.
-
CsvTableSource
public CsvTableSource(String path, String[] fieldNames, org.apache.flink.api.common.typeinfo.TypeInformation<?>[] fieldTypes, int[] selectedFields, String fieldDelim, String lineDelim, Character quoteCharacter, boolean ignoreFirstLine, String ignoreComments, boolean lenient)
Deprecated.AInputFormatTableSource
andLookupableTableSource
for simple CSV files with a (logically) unlimited number of fields.- Parameters:
path
- The path to the CSV file.fieldNames
- The names of the table fields.fieldTypes
- The types of the table fields.selectedFields
- The fields which will be read and returned by the table source. If None, all fields are returned.fieldDelim
- The field delimiter, "," by default.lineDelim
- The row delimiter, "\n" by default.quoteCharacter
- An optional quote character for String values, null by default.ignoreFirstLine
- Flag to ignore the first line, false by default.ignoreComments
- An optional prefix to indicate comments, null by default.lenient
- Flag to skip records with parse error instead to fail, false by default.
-
-
Method Detail
-
builder
public static CsvTableSource.Builder builder()
Deprecated.Return a new builder that builds a CsvTableSource. For example:CsvTableSource source = new CsvTableSource.builder() .path("/path/to/your/file.csv") .field("myfield", Types.STRING) .field("myfield2", Types.INT) .build();
- Returns:
- a new builder to build a CsvTableSource
-
getProducedDataType
public org.apache.flink.table.types.DataType getProducedDataType()
Deprecated.- Specified by:
getProducedDataType
in interfaceorg.apache.flink.table.legacy.sources.TableSource<org.apache.flink.types.Row>
-
getTableSchema
public org.apache.flink.table.legacy.api.TableSchema getTableSchema()
Deprecated.- Specified by:
getTableSchema
in interfaceorg.apache.flink.table.legacy.sources.TableSource<org.apache.flink.types.Row>
-
projectFields
public CsvTableSource projectFields(int[] fields)
Deprecated.- Specified by:
projectFields
in interfaceorg.apache.flink.table.legacy.sources.ProjectableTableSource<org.apache.flink.types.Row>
-
isBounded
public boolean isBounded()
Deprecated.Description copied from interface:StreamTableSource
Returns true if this is a bounded source, false if this is an unbounded source. Default is unbounded for compatibility.- Specified by:
isBounded
in interfaceStreamTableSource<org.apache.flink.types.Row>
-
getDataStream
public org.apache.flink.streaming.api.datastream.DataStream<org.apache.flink.types.Row> getDataStream(org.apache.flink.streaming.api.environment.StreamExecutionEnvironment execEnv)
Deprecated.Description copied from interface:StreamTableSource
Returns the data of the table as aDataStream
.NOTE: This method is for internal use only for defining a
TableSource
. Do not use it in Table API programs.- Specified by:
getDataStream
in interfaceStreamTableSource<org.apache.flink.types.Row>
-
getLookupFunction
public org.apache.flink.table.functions.TableFunction<org.apache.flink.types.Row> getLookupFunction(String[] lookupKeys)
Deprecated.- Specified by:
getLookupFunction
in interfaceorg.apache.flink.table.legacy.sources.LookupableTableSource<org.apache.flink.types.Row>
-
getAsyncLookupFunction
public org.apache.flink.table.functions.AsyncTableFunction<org.apache.flink.types.Row> getAsyncLookupFunction(String[] lookupKeys)
Deprecated.- Specified by:
getAsyncLookupFunction
in interfaceorg.apache.flink.table.legacy.sources.LookupableTableSource<org.apache.flink.types.Row>
-
isAsyncEnabled
public boolean isAsyncEnabled()
Deprecated.- Specified by:
isAsyncEnabled
in interfaceorg.apache.flink.table.legacy.sources.LookupableTableSource<org.apache.flink.types.Row>
-
explainSource
public String explainSource()
Deprecated.- Specified by:
explainSource
in interfaceorg.apache.flink.table.legacy.sources.TableSource<org.apache.flink.types.Row>
-
-