Record Class CsvFormatOptions
java.lang.Object
java.lang.Record
org.elasticsearch.xpack.esql.datasource.csv.CsvFormatOptions
- Record Components:
delimiter- field separator character (default: comma)quoteChar- character used to quote fields (default: double-quote)escapeChar- character used to escape special characters (default: backslash)commentPrefix- prefix for comment lines to skip (default: "//")nullValue- string representation of null in the data (default: empty string)encoding- character encoding of the input (default: UTF-8)datetimeFormatter- custom datetime format pattern, or null for ISO-8601/epochmaxFieldSize- maximum size in bytes for a single field value; 0 means no limit (default: 10MB). Provides OOM protection against malformed files.multiValueSyntax- syntax for multi-value fields: BRACKETS (default, [a,b,c]) or NONE
public record CsvFormatOptions(char delimiter, char quoteChar, char escapeChar, String commentPrefix, String nullValue, Charset encoding, DateTimeFormatter datetimeFormatter, int maxFieldSize, CsvFormatOptions.MultiValueSyntax multiValueSyntax)
extends Record
Configurable options for CSV/TSV parsing.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCsvFormatOptions(char delimiter, char quoteChar, char escapeChar, String commentPrefix, String nullValue, Charset encoding, DateTimeFormatter datetimeFormatter, int maxFieldSize, CsvFormatOptions.MultiValueSyntax multiValueSyntax) Creates an instance of aCsvFormatOptionsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecommentPrefixrecord component.Returns the value of thedatetimeFormatterrecord component.charReturns the value of thedelimiterrecord component.encoding()Returns the value of theencodingrecord component.final booleanIndicates whether some other object is "equal to" this one.charReturns the value of theescapeCharrecord component.final inthashCode()Returns a hash code value for this object.intReturns the value of themaxFieldSizerecord component.Returns the value of themultiValueSyntaxrecord component.Returns the value of thenullValuerecord component.charReturns the value of thequoteCharrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
DEFAULT
-
TSV
-
-
Constructor Details
-
CsvFormatOptions
public CsvFormatOptions(char delimiter, char quoteChar, char escapeChar, String commentPrefix, String nullValue, Charset encoding, DateTimeFormatter datetimeFormatter, int maxFieldSize, CsvFormatOptions.MultiValueSyntax multiValueSyntax) Creates an instance of aCsvFormatOptionsrecord class.- Parameters:
delimiter- the value for thedelimiterrecord componentquoteChar- the value for thequoteCharrecord componentescapeChar- the value for theescapeCharrecord componentcommentPrefix- the value for thecommentPrefixrecord componentnullValue- the value for thenullValuerecord componentencoding- the value for theencodingrecord componentdatetimeFormatter- the value for thedatetimeFormatterrecord componentmaxFieldSize- the value for themaxFieldSizerecord componentmultiValueSyntax- the value for themultiValueSyntaxrecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
delimiter
public char delimiter()Returns the value of thedelimiterrecord component.- Returns:
- the value of the
delimiterrecord component
-
quoteChar
public char quoteChar()Returns the value of thequoteCharrecord component.- Returns:
- the value of the
quoteCharrecord component
-
escapeChar
public char escapeChar()Returns the value of theescapeCharrecord component.- Returns:
- the value of the
escapeCharrecord component
-
commentPrefix
Returns the value of thecommentPrefixrecord component.- Returns:
- the value of the
commentPrefixrecord component
-
nullValue
Returns the value of thenullValuerecord component.- Returns:
- the value of the
nullValuerecord component
-
encoding
Returns the value of theencodingrecord component.- Returns:
- the value of the
encodingrecord component
-
datetimeFormatter
Returns the value of thedatetimeFormatterrecord component.- Returns:
- the value of the
datetimeFormatterrecord component
-
maxFieldSize
public int maxFieldSize()Returns the value of themaxFieldSizerecord component.- Returns:
- the value of the
maxFieldSizerecord component
-
multiValueSyntax
Returns the value of themultiValueSyntaxrecord component.- Returns:
- the value of the
multiValueSyntaxrecord component
-