Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-11329

Expand Star when creating a struct

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.6.0
    • SQL
    • None

    Description

      It is pretty common for customers to do regular extractions of update data from an external datasource (e.g. mysql or postgres). While this is possible today, the syntax is a little onerous. With some small improvements to the analyzer I think we could make this much easier.
      Goal: Allow users to execute the following two queries as well as their dataframe equivalents
      to find the most recent record for each key

      SELECT max(struct(timestamp, *)) as mostRecentRecord GROUP BY key

      to unnest the struct from above.

      SELECT mostRecentRecord.* FROM data

      Attachments

        Issue Links

          Activity

            People

              nongli Nong Li
              yhuai Yin Huai
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: