Copilot commented on code in PR #13704:
URL: https://github.com/apache/gluten/pull/13704#discussion_r4703178764


##########
.github/workflows/util/delta-spark-ut/patches/data-skipping-stats-file-layout.patch:
##########
@@ -0,0 +1,51 @@
+Subject: [PATCH] Give data-skipping statistics fixtures a deterministic file 
layout
+
+The flags and before/after OPTIMIZE tests assert per-file statistics, but
+repartition(2) does not specify which IDs go in each file. Spark and the
+Gluten columnar shuffle can produce different valid round-robin layouts.
+Create the range with two partitions and no shuffle. The two files now
+contain IDs 0-4 and 5-9; update their expected counts and bounds. The file
+pruning and post-OPTIMIZE checks stay unchanged.
+
+Remove this patch when the pinned Delta tests no longer rely on an
+incidental round-robin layout.
+
+diff --git 
a/spark/src/test/scala/org/apache/spark/sql/delta/stats/DataSkippingDeltaTests.scala
 
b/spark/src/test/scala/org/apache/spark/sql/delta/stats/DataSkippingDeltaTests.scala
+--- 
a/spark/src/test/scala/org/apache/spark/sql/delta/stats/DataSkippingDeltaTests.scala
++++ 
b/spark/src/test/scala/org/apache/spark/sql/delta/stats/DataSkippingDeltaTests.scala
+@@ -1064,15 +1064,14 @@ trait DataSkippingDeltaTests extends 
DataSkippingDeltaTestsBase
+         "OPTIMIZE is blocked on catalog-managed tables")
+       val t = "ds_stats_before_after_optimize"
+       withTable(t) {
+-        val (numTuples, numFiles) = (10, 2)
+-        val data = spark.range(0, numTuples, 1, 2).repartition(numFiles)
++        val data = spark.range(0, 10, 1, numPartitions = 2)
+         data.write.format("delta").saveAsTable(t)
+         var r = checkpointAndCreateNewLogIfNecessary(
+           DeltaLog.forTable(spark, TableIdentifier(t)))
+         def rStats: DataFrame =
+           getStatsDf(r, $"numRecords", $"minValues.id".as("id_min"), 
$"maxValues.id".as("id_max"))
+
+-        checkAnswer(rStats, Seq(Row(4, 0, 8), Row(6, 1, 9)))
++        checkAnswer(rStats, Seq(Row(5, 0, 4), Row(5, 5, 9)))

Review Comment:
   This patch uses two five-row ranges and changes the statistics assertions, 
but the PR describes a four/six-row fixture with unchanged assertions. That 
mismatch leaves the claimed byte-for-byte validation unsupported for the 
submitted patch; the flags assertion at line 48 has the same issue. Either 
commit the described fixture and align the README, or rerun the 22 cases and 
strict baseline gate on this exact patch and update the description before 
removing the baseline entries.



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