public static class CsvTableSource.Builder extends Object
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
CsvTableSource |
build()
Apply the current values and constructs a newly-created CsvTableSource.
|
CsvTableSource.Builder |
commentPrefix(String prefix)
Sets a prefix to indicate comments, null by default.
|
CsvTableSource.Builder |
emptyColumnAsNull()
Treat empty column as null, false by default.
|
CsvTableSource.Builder |
field(String fieldName,
DataType fieldType)
Adds a field with the field name and the data type.
|
CsvTableSource.Builder |
field(String fieldName,
TypeInformation<?> fieldType)
Deprecated.
This method will be removed in future versions as it uses the old type
system. It is recommended to use
field(String, DataType) instead which uses
the new type system based on DataTypes . Please make sure to use either the
old or the new type system consistently to avoid unintended behavior. See the website
documentation for more information. |
CsvTableSource.Builder |
fieldDelimiter(String delim)
Sets the field delimiter, "," by default.
|
CsvTableSource.Builder |
ignoreFirstLine()
Ignore the first line.
|
CsvTableSource.Builder |
ignoreParseErrors()
Skip records with parse error instead to fail.
|
CsvTableSource.Builder |
lineDelimiter(String delim)
Sets the line delimiter, "\n" by default.
|
CsvTableSource.Builder |
path(String path)
Sets the path to the CSV file.
|
CsvTableSource.Builder |
quoteCharacter(Character quote)
Sets a quote character for String values, null by default.
|
public CsvTableSource.Builder path(String path)
path
- the path to the CSV filepublic CsvTableSource.Builder fieldDelimiter(String delim)
delim
- the field delimiterpublic CsvTableSource.Builder lineDelimiter(String delim)
delim
- the line delimiterpublic CsvTableSource.Builder field(String fieldName, DataType fieldType)
fieldName
- the field namefieldType
- the data type of the field@Deprecated public CsvTableSource.Builder field(String fieldName, TypeInformation<?> fieldType)
field(String, DataType)
instead which uses
the new type system based on DataTypes
. Please make sure to use either the
old or the new type system consistently to avoid unintended behavior. See the website
documentation for more information.fieldName
- the field namefieldType
- the type information of the fieldpublic CsvTableSource.Builder quoteCharacter(Character quote)
quote
- the quote characterpublic CsvTableSource.Builder commentPrefix(String prefix)
prefix
- the prefix to indicate commentspublic CsvTableSource.Builder ignoreFirstLine()
public CsvTableSource.Builder ignoreParseErrors()
public CsvTableSource.Builder emptyColumnAsNull()
public CsvTableSource build()
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.