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

Accessing canonicalized plan for query with limit throws exception

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Incomplete
    • 2.2.0
    • None
    • SQL

    Description

      Accessing the logical, canonicalized plan fails for queries with limits.
      The following demonstrates the issue:

      val session = SparkSession.builder.master("local").getOrCreate()
      
      // This works
      session.sql("select * from (values 0, 1)").queryExecution.logical.canonicalized
      
      // This fails
      session.sql("select * from (values 0, 1) limit 1").queryExecution.logical.canonicalized
      

      The message in the thrown exception is somewhat confusing (or at least not directly related to the limit):
      "Invalid call to toAttribute on unresolved object, tree: *"

      Attachments

        Activity

          People

            Unassigned Unassigned
            BToldbod Bjoern Toldbod
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: