cloud-fan commented on a change in pull request #23057: [SPARK-26078][SQL] Dedup self-join attributes on IN subqueries URL: https://github.com/apache/spark/pull/23057#discussion_r240464363
########## File path: sql/core/src/test/scala/org/apache/spark/sql/SubquerySuite.scala ########## @@ -1280,4 +1281,46 @@ class SubquerySuite extends QueryTest with SharedSQLContext { assert(subqueries.length == 1) } } + + test("SPARK-26078: deduplicate fake self joins for IN subqueries") { + withTempView("a", "b") { + def genTestViewWithName(name: String): Unit = { + val df = spark.createDataFrame( + spark.sparkContext.parallelize(Seq(Row("a", 2), Row("b", 1))), + StructType(Seq(StructField("id", StringType), StructField("num", IntegerType)))) + df.createOrReplaceTempView(name) + } + genTestViewWithName("a") Review comment: nit: ``` Seq("a" -> 2, "b" -> 1).toDF("id", "num").createTempView("a") Seq("a" -> 2, "b" -> 1).toDF("id", "num").createTempView("b") ``` ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org