Class HeaderBuilder
java.lang.Object
org.apache.drill.exec.store.easy.text.reader.HeaderBuilder
Text output that implements a header reader/parser.
The caller parses out the characters of each header;
this class assembles UTF-8 bytes into Unicode characters,
fixes invalid characters (those not legal for SQL symbols),
and maps duplicate names to unique names.
That is, this class is as permissive as possible with file headers to avoid spurious query failures for trivial reasons.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
append
(byte data) boolean
boolean
endField()
void
String[]
long
boolean
isFull()
void
startField
(int index) void
-
Field Details
-
MAX_HEADER_LEN
public static final int MAX_HEADER_LENMaximum Drill symbol length, as enforced for headers. -
COLUMN_PREFIX
Prefix used to replace non-alphabetic characters at the start of a column name. For example, $foo becomes col_foo. Used because SQL does not allow _foo.- See Also:
-
ANONYMOUS_COLUMN_PREFIX
Prefix used to create numbered columns for missing headers. Typical names: column_1, column_2, ...- See Also:
-
-
Constructor Details
-
HeaderBuilder
public HeaderBuilder(org.apache.hadoop.fs.Path filePath)
-
-
Method Details
-
startField
public void startField(int index) -
endField
public boolean endField() -
endEmptyField
public boolean endEmptyField() -
append
public void append(byte data) -
finishRecord
public void finishRecord() -
startRecord
public void startRecord() -
getHeaders
-
getRecordCount
public long getRecordCount() -
isFull
public boolean isFull()
-