flyrain commented on issue #11922: URL: https://github.com/apache/iceberg/issues/11922#issuecomment-2576344681
I suspect this line, https://github.com/apache/iceberg/blob/3eec2fa36c4ef92e6abaf516eed4e8be338c0649/spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/source/SparkScanBuilder.java#L614-L614, it returns a null in case that a snapshot has no parent. Then it comes to this line, https://github.com/apache/iceberg/blob/3eec2fa36c4ef92e6abaf516eed4e8be338c0649/spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/source/SparkScanBuilder.java#L569-L569 in which case, it yields different results based on whether the end timestamp is given. The fix would be simple, we can remove following lines, and check on whether end snapshot id is null later after `getEndSnapshotId(endTimestamp)`. ``` if (startSnapshotId == null && endTimestamp == null) { emptyScan = true; } ``` I also suggest to add a unit test. -- 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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org