adiranjan25 commented on issue #19193:
URL: https://github.com/apache/iceberg/issues/19193#issuecomment-7270733001

   I'd like to investigate and contribute a fix for this issue.
   
   I reviewed the reported Spark 3.5 reproduction and traced the changelog scan 
construction through `SparkScanBuilder` and `SparkChangelogScan`.
   
   One likely source of the problem is scan equality. 
`SparkChangelogScan.equals()` and `hashCode()` currently compare the table, 
projected schema, filters, and the start/end snapshot IDs obtained directly 
from `SparkReadConf`.
   
   However, timestamp-based changelog scans resolve their effective boundaries 
during `SparkScanBuilder.buildChangelogScan()`. The builder can also identify 
an empty scan without that state being represented in the equality comparison.
   
   This appears consistent with the reported behavior where each changelog view 
returns the correct rows independently, but combining views with different time 
windows can produce incorrect results.
   
   My proposed approach is to:
   
   1. Add regression tests reproducing the incorrect result when combining two 
changelog views in one query.
   2. Verify scan equality for different timestamp windows, snapshot-ID 
windows, and empty versus nonempty scans.
   3. Make the minimum change necessary to ensure semantically different 
changelog scans are not treated as equivalent, while keeping `equals()` and 
`hashCode()` consistent.
   4. Validate against existing Spark 3.5 changelog tests and check whether the 
same behavior affects other Spark versions.
   
   I have not yet run the regression locally, so the exact cause remains to be 
confirmed. I'll establish the failing baseline first and then submit a focused 
fix.
   
   Maintainer feedback on the appropriate scan-identity semantics would be 
appreciated.


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