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

Add json_tuple() UDTF function

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.7.0
    • 0.7.0
    • UDF
    • None
    • Reviewed

    Description

      Currently the only way to evaluate a path expression on a JSON object is through get_json_object. If there are many fields in the JSON object need to be extract, we have to call this UDF multiple times.

      There are many use cases that get_json_object needs to be called many times in one query to convert the JSON object to a relational schema. It would be much desirable if we have a JSON UDTF that supports the following syntax:

      select a.id, b.*
      from a lateral view json_tuple(a.json_str, '$.f1',  '$.f2', ..., '$.fn') b as f1, f2, ..., fn
      

      where the json_table function only scans the json_object once and return a set of tuple of (f1, f2,..., fn).

      Attachments

        1. HIVE-1528.2.patch
          31 kB
          Ning Zhang
        2. HIVE-1528.patch
          32 kB
          Ning Zhang

        Activity

          People

            nzhang Ning Zhang
            nzhang Ning Zhang
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: