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 by FileSource. It is kept only to support tests for the legacy connector stack.
A StreamTableSource for simple CSV files with a (logically) unlimited number of fields.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Deprecated.
    A builder for creating CsvTableSource instances.
    static class 
    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.
    A InputFormatTableSource and LookupableTableSource 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.
    A InputFormatTableSource and LookupableTableSource 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.
    A InputFormatTableSource and LookupableTableSource for simple CSV files with a (logically) unlimited number of fields.
  • Method Summary

    Modifier and Type
    Method
    Description
    Deprecated.
    Return a new builder that builds a CsvTableSource.
    boolean
    Deprecated.
     
    Deprecated.
     
    org.apache.flink.table.functions.AsyncTableFunction<org.apache.flink.types.Row>
    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 a DataStream.
    org.apache.flink.table.functions.TableFunction<org.apache.flink.types.Row>
    getLookupFunction(String[] lookupKeys)
    Deprecated.
     
    org.apache.flink.table.types.DataType
    Deprecated.
     
    org.apache.flink.table.legacy.api.TableSchema
    Deprecated.
     
    int
    Deprecated.
     
    boolean
    Deprecated.
     
    boolean
    Deprecated.
    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, wait

    Methods 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.
      A InputFormatTableSource and LookupableTableSource 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.
      A InputFormatTableSource and LookupableTableSource 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.
      A InputFormatTableSource and LookupableTableSource 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 Details

    • 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 interface org.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 interface org.apache.flink.table.legacy.sources.TableSource<org.apache.flink.types.Row>
    • projectFields

      public CsvTableSource projectFields(int[] fields)
      Deprecated.
      Specified by:
      projectFields in interface org.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 interface StreamTableSource<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 a DataStream.

      NOTE: This method is for internal use only for defining a TableSource. Do not use it in Table API programs.

      Specified by:
      getDataStream in interface StreamTableSource<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 interface org.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 interface org.apache.flink.table.legacy.sources.LookupableTableSource<org.apache.flink.types.Row>
    • isAsyncEnabled

      public boolean isAsyncEnabled()
      Deprecated.
      Specified by:
      isAsyncEnabled in interface org.apache.flink.table.legacy.sources.LookupableTableSource<org.apache.flink.types.Row>
    • explainSource

      public String explainSource()
      Deprecated.
      Specified by:
      explainSource in interface org.apache.flink.table.legacy.sources.TableSource<org.apache.flink.types.Row>
    • equals

      public boolean equals(Object o)
      Deprecated.
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Deprecated.
      Overrides:
      hashCode in class Object