maropu commented on a change in pull request #31547: URL: https://github.com/apache/spark/pull/31547#discussion_r574176706
########## File path: sql/core/src/test/scala/org/apache/spark/sql/execution/SparkPlanSuite.scala ########## @@ -97,4 +98,13 @@ class SparkPlanSuite extends QueryTest with SharedSparkSession { } } } + + test("SPARK-34420: Throw exception if non-streaming Deduplicate is not replaced by aggregate") { + val df = spark.range(10) + val planner = spark.sessionState.planner + val deduplicate = Deduplicate(df.queryExecution.analyzed.output, df.queryExecution.analyzed) + intercept[IllegalStateException] { + planner.plan(deduplicate) + } Review comment: nit: could you check the error message, too? It looks fine, otherwise. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to 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 --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org