public class CsvParser extends Parser
Modifier and Type | Field and Description |
---|---|
static byte |
HIVE_SEP
Separators recognized by the CSV parser.
|
_jobKey, _keepColumns, _setup, CHAR_DECIMAL_SEP, CHAR_SEPARATOR, COND_QUOTE, COND_QUOTED_NUMBER_END, COND_QUOTED_TOKEN, EOL, EXPECT_COND_LF, HASHTAG, LARGEST_DIGIT_NUMBER, NUMBER, NUMBER_END, NUMBER_EXP, NUMBER_EXP_START, NUMBER_FRACTION, NUMBER_SKIP, NUMBER_SKIP_NO_DOT, POSSIBLE_CURRENCY, POSSIBLE_EMPTY_LINE, POSSIBLE_ESCAPED_QUOTE, SEPARATOR_OR_EOL, SKIP_LINE, STRING, STRING_END, TOKEN, WHITESPACE_BEFORE_TOKEN
Modifier and Type | Method and Description |
---|---|
static java.lang.String[] |
determineTokens(java.lang.String from,
byte separator,
boolean singleQuotes)
Determines the tokens that are inside a line and returns them as strings
in an array.
|
static java.lang.String[] |
determineTokens(java.lang.String from,
byte separator,
byte singleQuote) |
protected int |
fileHasHeader(byte[] bits,
ParseSetup ps) |
static int |
guessNcols(java.lang.String[] columnNames,
java.lang.String[][] data) |
static byte |
guessSeparator(java.lang.String l1,
java.lang.String l2,
boolean singleQuotes) |
ParseWriter |
parseChunk(int cidx,
ParseReader din,
ParseWriter dout) |
isEOL, sequentialParse, streamParse, streamParseZip
asBytes, clone, copyOver, frozenType, read, readExternal, readJSON, reloadFromBytes, toJsonString, write, writeExternal, writeJSON
public static final byte HIVE_SEP
public ParseWriter parseChunk(int cidx, ParseReader din, ParseWriter dout)
parseChunk
in class Parser
protected int fileHasHeader(byte[] bits, ParseSetup ps)
fileHasHeader
in class Parser
public static java.lang.String[] determineTokens(java.lang.String from, byte separator, boolean singleQuotes)
public static java.lang.String[] determineTokens(java.lang.String from, byte separator, byte singleQuote)
public static byte guessSeparator(java.lang.String l1, java.lang.String l2, boolean singleQuotes)
public static int guessNcols(java.lang.String[] columnNames, java.lang.String[][] data)