infvg commented on code in PR #12962:
URL: https://github.com/apache/gluten/pull/12962#discussion_r3926771383
##########
gluten-iceberg/src/test/scala/org/apache/gluten/execution/IcebergSuite.scala:
##########
@@ -60,6 +64,70 @@ abstract class IcebergSuite extends
WholeStageTransformerSuite {
}
}
+ test("rewrite_data_files uses an iceberg staged scan transformer") {
+ val tableName = "iceberg_rewrite_tb"
+ withTable(tableName) {
+ withSQLConf("spark.sql.adaptive.enabled" -> "false") {
+ spark.sql(s"CREATE TABLE $tableName (id INT, data STRING) USING
iceberg")
+ (1 to 5).foreach {
+ id => spark.sql(s"INSERT INTO $tableName VALUES ($id, 'value-$id')")
+ }
+
+ def dataFileCount: Long =
+ spark.table(s"spark_catalog.default.$tableName.files").count()
+
+ assert(dataFileCount == 5)
+ val stagedScanSeen = new CountDownLatch(1)
+ val listener = new QueryExecutionListener {
+ override def onSuccess(
+ funcName: String,
+ qe: QueryExecution,
+ durationNs: Long): Unit = {
+ if (
+ qe.executedPlan.exists {
+ case scan: IcebergScanTransformer =>
+ scan.scan.getClass.getSimpleName == "SparkStagedScan"
+ case _ => false
+ }
Review Comment:
fixed
--
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]