Class 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.
    • Constructor Detail

      • 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 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 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