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

Perform propagating empty relation after RewritePredicateSubquery

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Reopened
    • Major
    • Resolution: Unresolved
    • 3.1.0
    • None
    • SQL
    • None

    Description

      scala> spark.sql(" select * from values(1), (2) t(key) where key in (select 1 as key where 1=0)").queryExecution
      res15: org.apache.spark.sql.execution.QueryExecution =
      == Parsed Logical Plan ==
      'Project [*]
      +- 'Filter 'key IN (list#39 [])
         :  +- Project [1 AS key#38]
         :     +- Filter (1 = 0)
         :        +- OneRowRelation
         +- 'SubqueryAlias t
            +- 'UnresolvedInlineTable [key], [List(1), List(2)]
      
      == Analyzed Logical Plan ==
      key: int
      Project [key#40]
      +- Filter key#40 IN (list#39 [])
         :  +- Project [1 AS key#38]
         :     +- Filter (1 = 0)
         :        +- OneRowRelation
         +- SubqueryAlias t
            +- LocalRelation [key#40]
      
      == Optimized Logical Plan ==
      Join LeftSemi, (key#40 = key#38)
      :- LocalRelation [key#40]
      +- LocalRelation <empty>, [key#38]
      
      == Physical Plan ==
      *(1) BroadcastHashJoin [key#40], [key#38], LeftSemi, BuildRight
      :- *(1) LocalTableScan [key#40]
      +- Br...
      

      Attachments

        Issue Links

          Activity

            People

              Qin Yao Kent Yao 2
              Qin Yao Kent Yao 2
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: