Class JSONOptions.Builder

Enclosing class:
JSONOptions

public static final class JSONOptions.Builder extends ColumnFilterOptions.Builder<JSONOptions.Builder>
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • withCudfPruneSchema

      public JSONOptions.Builder withCudfPruneSchema(boolean prune)
    • withLineDelimiter

      public JSONOptions.Builder withLineDelimiter(char delimiter)
    • withStrictValidation

      public JSONOptions.Builder withStrictValidation(boolean isAllowed)
      Should json validation be strict or not
    • withExperimental

      public JSONOptions.Builder withExperimental(boolean isAllowed)
      Should experimental features be enabled or not
    • withLeadingZeros

      public JSONOptions.Builder withLeadingZeros(boolean isAllowed)
      Should leading zeros on numbers be allowed or not. Strict validation must be enabled for this to have any effect.
    • withNonNumericNumbers

      public JSONOptions.Builder withNonNumericNumbers(boolean isAllowed)
      Should non-numeric numbers be allowed or not. Strict validation must be enabled for this to have any effect.
    • withUnquotedControlChars

      public JSONOptions.Builder withUnquotedControlChars(boolean isAllowed)
      Should unquoted control chars be allowed in strings. Strict validation must be enabled for this to have any effect.
    • withDayFirst

      public JSONOptions.Builder withDayFirst(boolean dayFirst)
      Whether to parse dates as DD/MM versus MM/DD
      Parameters:
      dayFirst - true: DD/MM, false, MM/DD
      Returns:
      builder for chaining
    • withLines

      public JSONOptions.Builder withLines(boolean perLine)
      Whether to read the file as a json object per line
      Parameters:
      perLine - true: per line, false: multi-line
      Returns:
      builder for chaining
    • withRecoverWithNull

      public JSONOptions.Builder withRecoverWithNull(boolean recoverWithNull)
      Specify how to handle invalid lines when parsing json. Setting recoverWithNull to true will cause null values to be returned for invalid lines. Setting recoverWithNull to false will cause the parsing to fail with an exception.
      Parameters:
      recoverWithNull - true: return nulls, false: throw exception
      Returns:
      builder for chaining
    • withNormalizeSingleQuotes

      public JSONOptions.Builder withNormalizeSingleQuotes(boolean normalizeSingleQuotes)
      Should the single quotes be normalized.
    • withNormalizeWhitespace

      public JSONOptions.Builder withNormalizeWhitespace(boolean normalizeWhitespace)
      Should the unquoted whitespace be removed.
    • withMixedTypesAsStrings

      public JSONOptions.Builder withMixedTypesAsStrings(boolean mixedTypesAsStrings)
      Specify how to handle columns that contain mixed types.
      Parameters:
      mixedTypesAsStrings - true: return unparsed JSON, false: throw exception
      Returns:
      builder for chaining
    • withKeepQuotes

      public JSONOptions.Builder withKeepQuotes(boolean keepQuotes)
      Set whether the reader should keep quotes of string values.
      Parameters:
      keepQuotes - true to keep them, else false.
      Returns:
      this for chaining.
    • includeColumn

      public JSONOptions.Builder includeColumn(String... names)
      Description copied from class: ColumnFilterOptions.Builder
      Include one or more specific columns. Any column not included will not be read.
      Overrides:
      includeColumn in class ColumnFilterOptions.Builder<JSONOptions.Builder>
      Parameters:
      names - the name of the column, or more than one if you want.
    • includeColumn

      public JSONOptions.Builder includeColumn(Collection<String> names)
      Description copied from class: ColumnFilterOptions.Builder
      Include one or more specific columns. Any column not included will not be read.
      Overrides:
      includeColumn in class ColumnFilterOptions.Builder<JSONOptions.Builder>
      Parameters:
      names - the name of the column, or more than one if you want.
    • build

      public JSONOptions build()