Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-1575

get_json_object does not support JSON array at the root level

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.7.0
    • 1.2.0
    • UDF
    • None

    Description

      Currently, get_json_object(json_txt, path) always returns null if json_txt is not a JSON object (e.g. is a JSON array) at the root level.

      I have a table column of JSON arrays at the root level, but I can't parse it because of that.

      get_json_object should accept any JSON value (string, number, object, array, true, false, null), not just object, at the root level. In other words, it should behave as if it were named get_json_value or simply get_json.

      Per the JSON RFC, an array is indeed legal top-level JSON-text

      Attachments

        1. HIVE-1575.5.patch
          13 kB
          Alexander Pivovarov
        2. HIVE-1575.4.patch
          13 kB
          Alexander Pivovarov
        3. HIVE-1575.3.patch
          10 kB
          Alexander Pivovarov
        4. HIVE-1575.2.patch
          3 kB
          Alexander Pivovarov
        5. 0001-Updated-UDFJson-to-allow-arrays-as-a-root-object.patch
          4 kB
          Mike Lewis

        Activity

          People

            apivovarov Alexander Pivovarov
            slider Steven K. Wong
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: