philo-he commented on code in PR #12502:
URL: https://github.com/apache/gluten/pull/12502#discussion_r3574450850


##########
gluten-ut/spark40/src/test/scala/org/apache/spark/sql/execution/GlutenSQLViewSuite.scala:
##########
@@ -16,6 +16,45 @@
  */
 package org.apache.spark.sql.execution
 
-import org.apache.spark.sql.GlutenSQLTestsTrait
+import org.apache.spark.SparkException
+import org.apache.spark.sql.{GlutenSQLTestsTrait, Row}
+import org.apache.spark.sql.internal.SQLConf.STORE_ANALYZED_PLAN_FOR_VIEW
 
-class GlutenSimpleSQLViewSuite extends SimpleSQLViewSuite with 
GlutenSQLTestsTrait {}
+class GlutenSimpleSQLViewSuite extends SimpleSQLViewSuite with 
GlutenSQLTestsTrait {
+  import testImplicits._
+
+  private def assertMissingFileError(f: => Unit): Unit = {
+    val exception = intercept[SparkException](f)
+    val messages = Iterator
+      .iterate[Throwable](exception)(_.getCause)
+      .takeWhile(_ != null)
+      .flatMap(e => Option(e.getMessage))
+
+    assert(messages.exists(_.contains("FILE_NOT_FOUND")))
+  }
+
+  testGluten("alter temporary view should follow current 
storeAnalyzedPlanForView config") {
+    withTable("t") {
+      Seq(2, 3, 1).toDF("c1").write.format("parquet").saveAsTable("t")
+      withView("v1") {
+        withSQLConf(STORE_ANALYZED_PLAN_FOR_VIEW.key -> "true") {
+          sql("CREATE TEMPORARY VIEW v1 AS SELECT * FROM t")
+          Seq(4, 6, 
5).toDF("c1").write.mode("overwrite").format("parquet").saveAsTable("t")
+          assertMissingFileError(sql("SELECT * FROM v1").collect())

Review Comment:
   Thanks for the PR.
   
   Could we override parent test class's `checkErrorMatchPVals` to match 
Gluten/Velox's test expectation? If feasible, we can avoid copying Spark test 
code.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to