felipepessoto opened a new pull request, #13704: URL: https://github.com/apache/gluten/pull/13704
## What changes are proposed in this pull request? Relates to #12743. This fixes **22 known failures** by changing how two Delta tests build their input in Gluten CI. No assertions or production code change. **Before** — both fixtures asked for two partitions, then asserted which IDs ended up in each file. `repartition(2)` does not guarantee that assignment. These are the original [flags](https://github.com/delta-io/delta/blob/cebdc44dc07d331383e72811177af4ffc8638990/spark/src/test/scala/org/apache/spark/sql/delta/stats/DataSkippingDeltaTests.scala#L2385-L2410) and [OPTIMIZE](https://github.com/delta-io/delta/blob/cebdc44dc07d331383e72811177af4ffc8638990/spark/src/test/scala/org/apache/spark/sql/delta/stats/DataSkippingDeltaTests.scala#L1064-L1078) inputs: ```scala // data skipping flags val data = spark.range(10).repartition(2) // data skipping stats before and after optimize val (numTuples, numFiles) = (10, 2) val data = spark.range(0, numTuples, 1, 2).repartition(numFiles) ``` **After** — both tests use the same ten `Long` IDs. The helper assigns one group to each input partition, so the resulting two files have the counts and bounds the assertions require: ```scala // In DataSkippingDeltaTests, shared by both tests: protected def twoFileStatsFixture: DataFrame = { val idsByFile = Seq(Seq(0L, 4L, 5L, 8L), Seq(1L, 2L, 3L, 6L, 7L, 9L)) spark.sparkContext.parallelize(idsByFile, idsByFile.size).flatMap(ids => ids).toDF("id") } // In each test, replacing its input definition above: val data = twoFileStatsFixture ``` With the [November 20 nightly](https://github.com/apache/gluten/actions/runs/44678380655) bundle, a read of the original native-written files confirmed that their `(count, min ID, max ID)` values were correct: `(4, 0, 9)` and `(6, 1, 7)`. The tests expected `(4, 0, 8)` and `(6, 1, 9)` instead. The flags test still checks absent vs. collected stats and **4 files read without skipping vs. 3 with skipping** for `id = 0`. The OPTIMIZE test still checks that compaction produces one file with `(10, 0, 9)`. Native writes, schema variants, and the upstream skip for catalog-managed OPTIMIZE are unchanged. ## How was this patch tested? Applied Gluten CI’s complete patch set to Delta **v4.4.1** and ran `spark/testScalastyle` and targeted `spark/testOnly` selections with **Spark 4.1, Scala 2.13.17, and the nightly Velox bundle**. The final patch produces the same Scala source byte-for-byte as the tested version. | Test selection | Generated suites | Passed | | --- | ---: | ---: | | `data skipping flags` | 7 | 14/14 | | `data skipping stats before and after optimize` | 4 | 8/8 | All **22 exact baseline IDs** ran and passed; none were skipped, canceled, ignored, or pending. On these reports the unchanged strict gate rejected the old baseline with exactly 22 now-passing tests and accepted the new one with zero regressions. Only those 22 entries were removed: **171 → 149**. ## Was this patch authored or co-authored using generative AI tooling? Generated-by: GitHub Copilot (GPT-6.2 Astra) -- 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]
