adiranjan25 opened a new pull request, #19209:
URL: https://github.com/apache/iceberg/pull/19209
## Summary
Addresses the incorrect changelog scan equivalence reported in #19193.
Changelog scans over different timestamp windows can be treated as
equal because SparkChangelogScan uses the snapshot IDs originally
provided through SparkReadConf rather than the resolved snapshot
boundaries used during scan construction.
The scan identity also does not distinguish empty scans from
nonempty scans.
Consequently, Spark can reuse an incompatible scan when multiple
changelog views are combined in a single query, silently returning
incorrect results.
## Implementation
- Pass resolved start and end snapshot IDs from SparkScanBuilder
into SparkChangelogScan.
- Include the immutable empty-scan state in scan identity.
- Keep equals() and hashCode() consistent.
- Preserve existing timestamp resolution and scan planning behavior.
## Regression coverage
- Empty and nonempty timestamp windows combined in one query.
- Different nonempty timestamp windows combined in one query.
- Equivalent timestamp-based and snapshot-ID-based windows.
- Independent changelog view results.
- Hive, Hadoop, REST and SparkSessionCatalog configurations.
## Validation
Spark 3.5, Java 17.
Original regression before fix:
- 4 tests failed across four catalog configurations.
Original regression after fix:
- 4 tests passed.
Full TestCreateChangelogViewProcedure suite:
- 92 tests passed.
- 0 failures.
- 0 errors.
- 0 skipped.
Checkstyle, Spotless and git diff --check passed.
## Review considerations
This draft focuses on Spark 3.5.
Feedback is welcome regarding resolved snapshot boundaries,
empty-scan identity, unbounded scan semantics and applicability
to other supported Spark versions.
Related to #19193.
--
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]