pyflink.datastream.formats.csv.CsvSchemaBuilder#
- class CsvSchemaBuilder[source]#
CsvSchemaBuilder is for building a
CsvSchema, corresponding to Javacom.fasterxml.jackson.dataformat.csv.CsvSchema.Builderclass.New in version 1.16.0.
Methods
add_array_column(name[, separator, element_type])Add an array column to schema, the type of elements could be specified via
element_type, which should be primitive types.add_boolean_column(name)Add a boolean column to schema, with type as
DataTypes.BOOLEAN().add_columns_from(schema)Add all columns in
schemato current schema.add_number_column(name[, number_type])Add a number column to schema, the type of number could be specified via
number_type.add_string_column(name)Add a string column to schema, with type as
DataTypes.STRING().build()Build the
CsvSchema.clear_columns()Delete all columns in the schema.
disable_array_element_separator()Set array element separator to
"".disable_escape_char()Disable escaping in csv file.
disable_quote_char()Disable quote char.
remove_array_element_separator(index)Set array element separator of a column specified by
indexto"".set_allow_comments([allow])Allow using
#prefixed comments in csv file.set_any_property_name(name)set_array_element_separator(separator)Set global array element separator, default to
;.set_column_separator(char)Set column separator,
charshould be a single char, default to,.set_escape_char(char)Set escape char,
charshould be a single char, default to no-escaping.set_line_separator(separator)Set line separator, default to
\n.set_null_value(null_value)Set literal for null value, default to empty sequence.
set_quote_char(char)Set quote char, default to
".set_skip_first_data_row([skip])Set whether to skip the first row of csv file.
set_strict_headers([strict])Set whether to use strict headers, which check column names in the header are consistent with the schema.
set_use_header([use])Set whether to read header.
size()