Copilot commented on code in PR #12502:
URL: https://github.com/apache/gluten/pull/12502#discussion_r3567611526
##########
gluten-ut/spark41/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")))
+ }
Review Comment:
`assertMissingFileError` currently requires a `SparkException` and only
matches the literal substring `"FILE_NOT_FOUND"` in exception messages. Other
Gluten/Velox missing-file paths assert on different text (e.g., "No such file
or directory"), and Spark may also surface missing-file failures as
non-`SparkException` throwables depending on the wrapper. Consider making the
helper accept any throwable and detect missing-file via cause type and/or
multiple message variants to reduce brittleness across Spark/Velox versions and
platforms.
##########
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")))
+ }
Review Comment:
`assertMissingFileError` currently requires a `SparkException` and only
matches the literal substring `"FILE_NOT_FOUND"` in exception messages. Other
Gluten/Velox missing-file paths assert on different text (e.g., "No such file
or directory"), and Spark may also surface missing-file failures as
non-`SparkException` throwables depending on the wrapper. Consider making the
helper accept any throwable and detect missing-file via cause type and/or
multiple message variants to reduce brittleness across Spark/Velox versions and
platforms.
--
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]