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

sql lateral view same name gives wrong value

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.5.1, 1.6.0
    • Component/s: SQL
    • Labels:
      None

      Description

      This query will return wrong result:

      select 
      insideLayer1.json as json_insideLayer1, 
      insideLayer2.json as json_insideLayer2 
      from (select '1' id) creatives 
      lateral view json_tuple('{"layer1": {"layer2": "text inside layer 2"}}', 'layer1') insideLayer1 as json 
      lateral view json_tuple(insideLayer1.json, 'layer2') insideLayer2 as json 
      

      It got

      ( {"layer2": "text inside layer 2"},  {"layer2": "text inside layer 2"})
      

      instead of

      ( {"layer2": "text inside layer 2"},  text inside layer 2)
      

        Attachments

          Activity

            People

            • Assignee:
              davies Davies Liu
              Reporter:
              davies Davies Liu
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: