Class RootParser
java.lang.Object
org.apache.drill.exec.store.easy.json.parser.RootParser
- Direct Known Subclasses:
RootParser.EmbeddedArrayParser
,RootParser.EmbeddedObjectParser
,RootParser.RootArrayParser
,RootParser.RootObjectParser
The root parsers are special: they must detect EOF. Drill supports
top-level objects either enclosed in an array (which forms legal
JSON), or as the
jsonlines format, restricted
to a list of objects (but not scalars or arrays.) Although jsonlines
requires newline separators between objects, this parser allows
any amount of whitespace, including none.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Parser for data embedded within a message structure which is encoded as an array of objects.static class
Parser for data embedded within a message structure which is encoded as a single JSON object.static class
Parser for a compliant JSON data set which consists of an array at the top level, where each element of the array is a JSON object that represents a data record.static class
Parser for a jsonlines-style data set which consists of a series of objects. -
Field Summary
Modifier and TypeFieldDescriptionprotected static final org.slf4j.Logger
protected final ObjectParser
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected ErrorFactory
abstract boolean
parseRoot
(TokenIterator tokenizer) Parse one data object.protected boolean
parseRootObject
(com.fasterxml.jackson.core.JsonToken token, TokenIterator tokenizer) Parse one data object.
-
Field Details
-
logger
protected static final org.slf4j.Logger logger -
rootObject
-
-
Constructor Details
-
RootParser
-
-
Method Details
-
parseRoot
Parse one data object. This is the "root" object which may contain nested objects. Overridden to handle different end-of-data indicators for different contexts.- Returns:
true
if an object was found,false
if the end of data was reached.
-
parseRootObject
protected boolean parseRootObject(com.fasterxml.jackson.core.JsonToken token, TokenIterator tokenizer) Parse one data object. This is the "root" object which may contain nested objects. Called when the outer parser detects a start object token for a data object.- Returns:
true
if an object was found,false
if the end of data was reached.
-
errorFactory
-