Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-1250

UNNEST should work with MAP data types

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.8.0
    • Component/s: core
    • Labels:
      None

      Description

      Unnest should also work with map data types and emit two columns for key and value of all entries, similar to what drill is doing with kv_gen() and hive with explode()

        Issue Links

          Activity

          Hide
          julianhyde Julian Hyde added a comment -

          It's not in the standard, but Presto also does this, and it's a very useful feature.

          I quickly reviewed the PR, and it looks as if you're on the right track. Can you add a test (maybe in SqlValidatorTest) to make sure that the columns are called KEY and VALUE when not aliased. Can you also make it work if UNNEST has more than one argument.

          Show
          julianhyde Julian Hyde added a comment - It's not in the standard, but Presto also does this, and it's a very useful feature. I quickly reviewed the PR, and it looks as if you're on the right track. Can you add a test (maybe in SqlValidatorTest) to make sure that the columns are called KEY and VALUE when not aliased. Can you also make it work if UNNEST has more than one argument.
          Hide
          baunz Johannes Schulte added a comment -

          Will do that

          Show
          baunz Johannes Schulte added a comment - Will do that
          Hide
          julianhyde Julian Hyde added a comment -

          Fixed in http://git-wip-us.apache.org/repos/asf/calcite/commit/d757201f. Thanks for the PR, Johannes Schulte! I saw that you needed to go to considerable effort to allow, say, combining a list and an array or a list and a map in an UNNEST. Nice work, and much appreciated!

          Show
          julianhyde Julian Hyde added a comment - Fixed in http://git-wip-us.apache.org/repos/asf/calcite/commit/d757201f . Thanks for the PR, Johannes Schulte ! I saw that you needed to go to considerable effort to allow, say, combining a list and an array or a list and a map in an UNNEST. Nice work, and much appreciated!
          Hide
          julianhyde Julian Hyde added a comment -

          Resolved in release 1.8.0 (2016-06-13).

          Show
          julianhyde Julian Hyde added a comment - Resolved in release 1.8.0 (2016-06-13).

            People

            • Assignee:
              baunz Johannes Schulte
              Reporter:
              baunz Johannes Schulte
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development