Class TextParsingSettings
java.lang.Object
org.apache.drill.exec.store.easy.text.reader.TextParsingSettings
-
Constructor Summary
ConstructorDescriptionTextParsingSettings
(TextFormatConfig config, TupleMetadata providedSchema) Configure the properties for this one scan based on: -
Method Summary
Modifier and TypeMethodDescriptionbyte
byte
Returns the field delimiter character.long
byte[]
byte
byte
getQuote()
Returns the character used for escaping values where the field delimiter is part of the value.byte
Returns the character used for escaping quotes inside an already quoted value.boolean
boolean
boolean
Indicates whether or not the first valid record parsed from the input should be considered as the row containing the names of each columnboolean
boolean
Indicates whether the CSV parser should accept unescaped quotes inside quoted values and parse them normally.void
setSkipFirstLine
(boolean skipFirstLine)
-
Constructor Details
-
TextParsingSettings
Configure the properties for this one scan based on:- The defaults in the plugin config (if properties not defined in the config JSON.
- The config values from the config JSON as stored in the plugin config.
- Table function settings expressed in the query (and passed in as part of the plugin config.
- Table properties.
The result is that the user can customize the behavior of a table just via the table properties; the user need not define a new storage config just to change a property. For example, by default, the `csv` config has no headers. But, if the user has a ".csv" file with headers, the user can just customize the table properties.
-
-
Method Details
-
getComment
public byte getComment() -
isSkipFirstLine
public boolean isSkipFirstLine() -
setSkipFirstLine
public void setSkipFirstLine(boolean skipFirstLine) -
getNewLineDelimiter
public byte[] getNewLineDelimiter() -
getQuote
public byte getQuote()Returns the character used for escaping values where the field delimiter is part of the value. Defaults to '"'- Returns:
- the quote character
-
getLineSeparatorString
-
getQuoteEscape
public byte getQuoteEscape()Returns the character used for escaping quotes inside an already quoted value. Defaults to '"'- Returns:
- the quote escape character
-
getDelimiter
public byte getDelimiter()Returns the field delimiter character. Defaults to ','- Returns:
- the field delimiter character
-
parseUnescapedQuotes
public boolean parseUnescapedQuotes()Indicates whether the CSV parser should accept unescaped quotes inside quoted values and parse them normally. Defaults totrue
.- Returns:
- a flag indicating whether or not the CSV parser should accept unescaped quotes inside quoted values.
-
isHeaderExtractionEnabled
public boolean isHeaderExtractionEnabled()Indicates whether or not the first valid record parsed from the input should be considered as the row containing the names of each column- Returns:
- true if the first valid record parsed from the input should be considered as the row containing the names of each column, false otherwise
-
getMaxCharsPerColumn
public long getMaxCharsPerColumn() -
getNormalizedNewLine
public byte getNormalizedNewLine() -
ignoreLeadingWhitespace
public boolean ignoreLeadingWhitespace() -
ignoreTrailingWhitespace
public boolean ignoreTrailingWhitespace()
-