Class JsonLoaderOptions

java.lang.Object
org.apache.drill.exec.store.easy.json.parser.JsonStructureOptions
org.apache.drill.exec.store.easy.json.loader.JsonLoaderOptions

public class JsonLoaderOptions extends JsonStructureOptions
Extends the JsonStructureOptions class, which provides JSON syntactic options, with a number of semantic options enforced at the JSON loader level.
  • Field Details

    • allTextMode

      public boolean allTextMode
      JSON returns values as typed tokens. If allTextMode is set, the structure parser converts all scalars (except null) to text and forwards the values to the listener as text. Implements Drill's "all-text mode" for JSON.
    • readNumbersAsDouble

      public boolean readNumbersAsDouble
      Forces all numbers to be double, even if the first number that appears is an integer.
    • unionEnabled

      public boolean unionEnabled
    • classicArrayNulls

      public boolean classicArrayNulls
      Drill prior to version 1.18 would read a null string array element as the string "null". Drill 1.18 and later reads the same token as a blank string. This flag forces the pre-1.18 behavior.

      For {a: [null]}

      • If true: --> "null"
      • if false: --> ""
    • unknownsAsJson

      public boolean unknownsAsJson
      If a field contains all nulls, all empty arrays, or the first non-empty array contains a null ([ null, ... ], then the default action is to read the column as JSON: literally convert the values (of any JSON complexity) to JSON string of that structure. If false, then uses the default type.
    • nullType

      public TypeProtos.MinorType nullType
      Type to use for a field which contains all nulls, or all empty arrays. Also the default type for an array that starts with the null value, if unknownsAsJson is false.
    • enableExtendedTypes

      public boolean enableExtendedTypes
      Enable support for Mongo-style extended types:
      { field: { "$type": value }, ... }<?code>
  • Constructor Details

    • JsonLoaderOptions

      public JsonLoaderOptions()
    • JsonLoaderOptions

      public JsonLoaderOptions(OptionSet options)