sunchao opened a new issue, #7784:
URL: https://github.com/apache/datafusion-comet/issues/7784

   ### Describe the bug
   
   The native V1 Parquet scan checks every `TIMESTAMP_MILLIS` it converts in an 
unfiltered batch. For a caller that stops early, Spark and Comet can decode 
different numbers of rows before returning the first one. An overflow after the 
last row in Spark's batch can make Comet fail a query that succeeds in Spark. 
This follows from the reader and limit paths on `main` at `f67d51d2` and was 
raised in [the review of 
#7731](https://github.com/apache/datafusion-comet/pull/7731#discussion_r4703091770).
   
   ### Steps to reproduce
   
   1. Write a single Parquet row group with a plain INT64 column `ts` annotated 
`TIMESTAMP_MILLIS`. Store `0` and `9223372036854776` in that order.
   2. Enable the V1 vectorized Parquet reader and set 
`spark.sql.parquet.columnarReaderBatchSize=1` and `spark.comet.batchSize=2`.
   3. Compare `spark.read.parquet(path).select("ts").limit(1).collect()` with 
Comet off and on. Also try `queryExecution.toRdd.take(1)` on the unlimited 
DataFrame, followed by `collect()`.
   
   ### Expected behavior
   
   Spark can return the epoch timestamp after reading its first batch. Full 
collection must still report `ArithmeticException: long overflow`. If the bad 
value is in the first batch Spark decodes, even a partial read can fail. Align 
checked conversion in filtered and unfiltered scans with the rows Spark 
actually decodes, including when the same execution RDD is reused.
   
   ### Additional context
   
   The unfiltered example above is a proposed regression case based on source 
inspection. #7731 tests this batch boundary for filtered scans and restricts 
the additional check to full collection. #5739 tracks the separate problem of 
matching Spark's Parquet pruning decisions.
   


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