Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-5919

Add non-numeric support for JSON processing

    XMLWordPrintableJSON

Details

    Description

      Add session options to allow drill working with non standard json strings number literals like: NaN, Infinity, -Infinity. By default these options will be switched off, the user will be able to toggle them during working session.

      For documentation
      1. Added two session options store.json.reader.allow_nan_inf and store.json.writer.allow_nan_inf that allow to read/write NaN and Infinity as numbers. By default these options are set to true.

      2. Extended signature of convert_toJSON and convert_fromJSON functions by adding second optional parameter that enables read/write NaN and Infinity.
      For example:

      select convert_fromJSON('{"key": NaN}') from (values(1)); will result with JsonParseException, but
      select convert_fromJSON('{"key": NaN}', true) from (values(1)); will parse NaN as a number.
      

      3. Added unit tests, including tests for math functions.

      Attachments

        Issue Links

          Activity

            People

              volodymyr.tkach Volodymyr Tkach
              volodymyr.tkach Volodymyr Tkach
              Paul Rogers Paul Rogers
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: