water.parser
Class CsvParser

java.lang.Object
  extended by water.Iced
      extended by water.parser.CustomParser
          extended by water.parser.CsvParser
All Implemented Interfaces:
java.lang.Cloneable, Freezable

public class CsvParser
extends CustomParser


Nested Class Summary
 
Nested classes/interfaces inherited from class water.parser.CustomParser
CustomParser.CustomInspectDataOut, CustomParser.DataIn, CustomParser.DataOut, CustomParser.ParserSetup, CustomParser.ParserType, CustomParser.PSetupGuess, CustomParser.StreamData, CustomParser.StreamDataOut
 
Field Summary
static byte AUTO_SEP
           
 byte CHAR_DECIMAL_SEPARATOR
           
 byte CHAR_SEPARATOR
           
static byte HIVE_SEP
           
 
Fields inherited from class water.parser.CustomParser
_setup, CHAR_COMMA, CHAR_CR, CHAR_DOUBLE_QUOTE, CHAR_FF, CHAR_LF, CHAR_NULL, CHAR_SINGLE_QUOTE, CHAR_SPACE, CHAR_TAB, CHAR_VT, MAX_PREVIEW_COLS, MAX_PREVIEW_LINES
 
Constructor Summary
CsvParser(CustomParser.ParserSetup setup)
           
 
Method Summary
 CsvParser clone()
           
static CustomParser.PSetupGuess guessSetup(byte[] bits)
          Determines the CSV parser setup from the first two lines.
static CustomParser.PSetupGuess guessSetup(byte[] bits, CustomParser.ParserSetup setup)
           
static CustomParser.PSetupGuess guessSetup(byte[] bits, CustomParser.ParserSetup setup, boolean checkHeader)
           
 boolean isCompatible(CustomParser p)
           
 CustomParser.DataOut parallelParse(int cidx, CustomParser.DataIn din, CustomParser.DataOut dout)
           
 boolean parallelParseSupported()
           
 
Methods inherited from class water.parser.CustomParser
headers, isEOL, isWhitespace, streamParse, streamParse
 
Methods inherited from class water.Iced
frozenType, init, newInstance, read, toDocField, write, writeJSON, writeJSONFields
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AUTO_SEP

public static final byte AUTO_SEP
See Also:
Constant Field Values

CHAR_DECIMAL_SEPARATOR

public final byte CHAR_DECIMAL_SEPARATOR
See Also:
Constant Field Values

CHAR_SEPARATOR

public final byte CHAR_SEPARATOR

HIVE_SEP

public static final byte HIVE_SEP
See Also:
Constant Field Values
Constructor Detail

CsvParser

public CsvParser(CustomParser.ParserSetup setup)
Method Detail

clone

public CsvParser clone()
Specified by:
clone in class CustomParser

parallelParseSupported

public boolean parallelParseSupported()
Overrides:
parallelParseSupported in class CustomParser

parallelParse

public final CustomParser.DataOut parallelParse(int cidx,
                                                CustomParser.DataIn din,
                                                CustomParser.DataOut dout)
Overrides:
parallelParse in class CustomParser

guessSetup

public static CustomParser.PSetupGuess guessSetup(byte[] bits)
Determines the CSV parser setup from the first two lines. Also parses the next few lines, tossing out comments and blank lines. A separator is given or it is selected if both two lines have the same ammount of them and the tokenization then returns same number of columns.


guessSetup

public static CustomParser.PSetupGuess guessSetup(byte[] bits,
                                                  CustomParser.ParserSetup setup)

guessSetup

public static CustomParser.PSetupGuess guessSetup(byte[] bits,
                                                  CustomParser.ParserSetup setup,
                                                  boolean checkHeader)

isCompatible

public boolean isCompatible(CustomParser p)
Overrides:
isCompatible in class CustomParser