Class CsvRowSchemaConverter

java.lang.Object
org.apache.flink.formats.csv.CsvRowSchemaConverter

public final class CsvRowSchemaConverter extends Object
Converter functions that covert Flink's type information to Jackson's CsvSchema.

In CsvSchema, there are four types (string, number, boolean, and array). In order to satisfy various Flink types, this class sorts out instances of TypeInformation and LogicalType that are not supported. It converts supported types to one of CsvSchema's types.

Note: Changes in this class need to be kept in sync with the corresponding runtime classes CsvRowDeserializationSchema and CsvRowSerializationSchema.

  • Method Summary

    Modifier and Type
    Method
    Description
    static org.apache.flink.shaded.jackson2.com.fasterxml.jackson.dataformat.csv.CsvSchema
    convert(org.apache.flink.api.java.typeutils.RowTypeInfo rowType)
    Convert RowTypeInfo to CsvSchema.
    static org.apache.flink.shaded.jackson2.com.fasterxml.jackson.dataformat.csv.CsvSchema
    convert(org.apache.flink.table.types.logical.RowType rowType)
    Convert RowType to CsvSchema.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • convert

      public static org.apache.flink.shaded.jackson2.com.fasterxml.jackson.dataformat.csv.CsvSchema convert(org.apache.flink.api.java.typeutils.RowTypeInfo rowType)
      Convert RowTypeInfo to CsvSchema.
    • convert

      public static org.apache.flink.shaded.jackson2.com.fasterxml.jackson.dataformat.csv.CsvSchema convert(org.apache.flink.table.types.logical.RowType rowType)
      Convert RowType to CsvSchema.