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.
A
StreamTableSource for simple CSV files with a (logically) unlimited number of fields.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classDeprecated.A builder for creating CsvTableSource instances.static classDeprecated.LookupFunction to support lookup in CsvTableSource. -
Constructor Summary
ConstructorsConstructorDescriptionCsvTableSource(String path, String[] fieldNames, org.apache.flink.api.common.typeinfo.TypeInformation<?>[] fieldTypes) Deprecated.AInputFormatTableSourceandLookupableTableSourcefor 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.AInputFormatTableSourceandLookupableTableSourcefor 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.AInputFormatTableSourceandLookupableTableSourcefor simple CSV files with a (logically) unlimited number of fields. -
Method Summary
Modifier and TypeMethodDescriptionstatic CsvTableSource.Builderbuilder()Deprecated.Return a new builder that builds a CsvTableSource.booleanDeprecated.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.DataTypeDeprecated.org.apache.flink.table.legacy.api.TableSchemaDeprecated.inthashCode()Deprecated.booleanDeprecated.booleanDeprecated.Returns true if this is a bounded source, false if this is an unbounded source.projectFields(int[] fields) Deprecated.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.flink.table.legacy.sources.TableSource
getReturnType
-
Constructor Details
-
CsvTableSource
public CsvTableSource(String path, String[] fieldNames, org.apache.flink.api.common.typeinfo.TypeInformation<?>[] fieldTypes) Deprecated.AInputFormatTableSourceandLookupableTableSourcefor 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.AInputFormatTableSourceandLookupableTableSourcefor 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.AInputFormatTableSourceandLookupableTableSourcefor 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 Details
-
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:
getProducedDataTypein 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:
getTableSchemain interfaceorg.apache.flink.table.legacy.sources.TableSource<org.apache.flink.types.Row>
-
projectFields
Deprecated.- Specified by:
projectFieldsin interfaceorg.apache.flink.table.legacy.sources.ProjectableTableSource<org.apache.flink.types.Row>
-
isBounded
public boolean isBounded()Deprecated.Description copied from interface:StreamTableSourceReturns true if this is a bounded source, false if this is an unbounded source. Default is unbounded for compatibility.- Specified by:
isBoundedin 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:StreamTableSourceReturns 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:
getDataStreamin 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:
getLookupFunctionin 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:
getAsyncLookupFunctionin interfaceorg.apache.flink.table.legacy.sources.LookupableTableSource<org.apache.flink.types.Row>
-
isAsyncEnabled
public boolean isAsyncEnabled()Deprecated.- Specified by:
isAsyncEnabledin interfaceorg.apache.flink.table.legacy.sources.LookupableTableSource<org.apache.flink.types.Row>
-
explainSource
Deprecated.- Specified by:
explainSourcein interfaceorg.apache.flink.table.legacy.sources.TableSource<org.apache.flink.types.Row>
-
equals
Deprecated. -
hashCode
public int hashCode()Deprecated.
-
FileSource. It is kept only to support tests for the legacy connector stack.