public class HeaderBuilder extends Object
That is, this class is as permissive as possible with file headers to avoid spurious query failures for trivial reasons.
| Modifier and Type | Class and Description |
|---|---|
static class |
HeaderBuilder.HeaderError
Exception that reports header errors.
|
| Modifier and Type | Field and Description |
|---|---|
static String |
ANONYMOUS_COLUMN_PREFIX
Prefix used to create numbered columns for missing
headers.
|
static String |
COLUMN_PREFIX
Prefix used to replace non-alphabetic characters at the start of
a column name.
|
ByteBuffer |
currentField |
List<String> |
headers |
static int |
MAX_HEADER_LEN
Maximum Drill symbol length, as enforced for headers.
|
| Constructor and Description |
|---|
HeaderBuilder() |
| Modifier and Type | Method and Description |
|---|---|
void |
append(byte data)
This function appends the byte to the output character data buffer
|
void |
appendIgnoringWhitespace(byte data)
Add the provided data but drop any whitespace.
|
boolean |
endEmptyField()
Shortcut that lets the output know that we are closing ending a field with no data.
|
boolean |
endField()
End processing a field within a record.
|
void |
finishBatch()
Does any final cleanup that is required for closing a batch.
|
void |
finishRecord()
Completes the processing of a given record.
|
String[] |
getHeaders() |
long |
getRecordCount()
Return the total number of records (across batches) processed
|
boolean |
rowHasData()
Helper method to check if the current record has any non-empty fields
|
void |
startBatch()
Informs output to setup for new record batch.
|
void |
startField(int index)
Start processing a new field within a record.
|
public static final int MAX_HEADER_LEN
public static final String COLUMN_PREFIX
public static final String ANONYMOUS_COLUMN_PREFIX
public final ByteBuffer currentField
public void startField(int index)
index - index within the recordpublic boolean endField()
public boolean endEmptyField()
public void append(byte data)
data - current byte readpublic void finishRecord()
public long getRecordCount()
public void startBatch()
public void finishBatch()
public boolean rowHasData()
public String[] getHeaders()
public void appendIgnoringWhitespace(byte data)
data - Copyright © 2017 The Apache Software Foundation. All rights reserved.