Tongwei created SPARK-37131: ------------------------------- Summary: Support use IN/EXISTS with subquery in Project/Aggregate Key: SPARK-37131 URL: https://issues.apache.org/jira/browse/SPARK-37131 Project: Spark Issue Type: Improvement Components: SQL Affects Versions: 3.2.0 Reporter: Tongwei
CREATE TABLE tbl1 (col1 INT, col2 STRING) USING PARQUET; INSERT OVERWRITE TABLE tbl1 SELECT 0,1; CREATE TABLE tbl2 (c1 INT, c2 STRING) USING PARQUET; INSERT OVERWRITE TABLE tbl2 SELECT 0,2; case 1: select c1 in (select col1 from tbl1) from tbl2 Error msg: IN/EXISTS predicate sub-queries can only be used in Filter/Join and a few commands: Project [] case 2: select count(*), case when c1 in (select col1 from tbl1) then "A" else "B" end as tag from tbl2 group by case when c1 in (select col1 from tbl1) then "A" else "B" end Error msg: IN/EXISTS predicate sub-queries can only be used in Filter/Join and a few commands: Aggregate [] -- This message was sent by Atlassian Jira (v8.3.4#803005) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org