stantheman0128 commented on PR #7638:
URL: 
https://github.com/apache/datafusion-comet/pull/7638#issuecomment-7221193388

   @andygrove @comphead thanks for the reviews. Pushed 
6e94bb290add13cfe3f932d80af4e2f36f5acf8a.
   
   **End-to-end test (andygrove)**
   
   New suite `CometNativeShuffleLocalDirSuite`, in 
`spark/src/test/scala/org/apache/spark/sql/comet/execution/shuffle/`. It runs 
in its own `SparkSession` with `spark.local.dir` set to a temp directory named 
`local.data` and `spark.comet.shuffle.mode=native`. The test:
   
   - asserts that every block manager dir (`getLocalDiskDirs`) sits directly 
under that `local.data` directory, so an environment override such as 
`SPARK_LOCAL_DIRS` cannot make it pass without reproducing the issue
   - runs `SELECT * FROM tbl` over a Parquet table, repartitioned by `_1` into 
10 partitions, and asserts with `checkCometExchange(df, 1, native = true)` that 
the plan has one native `CometShuffleExchangeExec`
   - checks the result with `checkAnswer` against the 100 rows the test wrote
   
   With the old `replace(".data", ".data.tmp")` path, the temp data file would 
land under `local.data.tmp/blockmgr-...`, a directory that does not exist, 
which is the error from #7594. The suite is listed in the `shuffle` group of 
both `pr_build_linux.yml` and `pr_build_macos.yml`.
   
   Since this goes through `writeInternal`, I removed the `localTempDataFile` 
wrapper and the unit test that called it. `writeInternal` now calls 
`resolver.createTempFile(dataFile)` directly.
   
   **Cleanup in `stop(false)` (comphead)**
   
   Agreed. In Spark 3.5.8 and 4.1.1, `ShuffleWriteProcessor.write` calls 
`stop(success = false)` only from its `catch` of `Exception`, which means 
`write` threw, or `stop(true)` or the push-merge code after it threw. In the 
first case the `catch` in our `write` has already deleted the temp file. In the 
other two, `localTempData` was cleared right after 
`writeMetadataFileAndCommit`. So `stop(false)` never has anything left to 
delete. I dropped that branch and the `stop(false)` test, and 
`discardLocalTemp` now takes the failure directly instead of an `Option`. 
`localTempData` is now plain `private`, since no test reads it. One small note: 
`CometBypassMergeSortShuffleWriter.stop(false)` does still call 
`cleanupPartitionWriters(null)`, but that does not change the answer for this 
writer.
   
   **What I ran on Windows**
   
   - `./mvnw test-compile` from the repo root (default Spark 4.1 profile, 
scalastyle and the Spotless check skipped): BUILD SUCCESS. I did not compile 
the other Spark profiles.
   - Spotless `apply` on the three changed Scala files, using the contents of 
`dev/copyright/java-header.txt` for the header as before. The header file is 
not part of the commit.
   - `dev/ci/check-suites.py`: passes.
   
   I could not run the new suite here because there is still no native library 
on this machine. The fork CI run did not start for this push either: the `CI 
(fork)` check reports no run for 6e94bb290 on my fork. So the new suite has not 
run anywhere yet.
   
   Prepared with Claude Code.
   


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