liujiayi771 commented on code in PR #5496:
URL: https://github.com/apache/incubator-gluten/pull/5496#discussion_r1577154978
##########
backends-velox/src/test/scala/org/apache/spark/sql/execution/VeloxParquetWriteForHiveSuite.scala:
##########
@@ -79,24 +79,30 @@ class VeloxParquetWriteForHiveSuite extends GlutenQueryTest
with SQLTestUtils {
.set("spark.gluten.sql.native.writer.enabled", "true")
}
- private def checkNativeWrite(sqlStr: String, native: Boolean): Unit = {
- val testAppender = new LogAppender("native write tracker")
- withLogAppender(testAppender) {
- spark.sql(sqlStr)
+ private def checkNativeWrite(sqlStr: String, checkNative: Boolean): Unit = {
+ var nativeUsed = false
+ val queryListener = new QueryExecutionListener {
+ override def onFailure(f: String, qe: QueryExecution, e: Exception):
Unit = {}
+ override def onSuccess(funcName: String, qe: QueryExecution, duration:
Long): Unit = {
+ if (!nativeUsed) {
+ nativeUsed = if (isSparkVersionGE("3.4")) {
+
qe.executedPlan.find(_.isInstanceOf[VeloxColumnarWriteFilesExec]).isDefined
+ } else {
+ qe.executedPlan.find(_.isInstanceOf[FakeRowAdaptor]).isDefined
+ }
+ }
+ }
}
- assert(
- testAppender.loggingEvents.exists(
- _.getMessage.toString.contains("Use Gluten parquet write for hive"))
== native)
Review Comment:
It is great to remove this hardcoding.
--
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]