java.lang.Object
org.apache.drill.exec.store.easy.json.parser.RootParser
Direct Known Subclasses:
RootParser.EmbeddedArrayParser, RootParser.EmbeddedObjectParser, RootParser.RootArrayParser, RootParser.RootObjectParser

public abstract class RootParser extends Object
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.
  • Field Details

    • logger

      protected static final org.slf4j.Logger logger
    • rootObject

      protected final ObjectParser rootObject
  • Constructor Details

  • Method Details

    • parseRoot

      public abstract boolean parseRoot(TokenIterator tokenizer)
      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

      protected ErrorFactory errorFactory()