sundapeng opened a new pull request, #9456: URL: https://github.com/apache/paimon/pull/9456
### Purpose Follow up on #9379 by making row-count inference conservative across Paimon table scans. Paimon split and scan statistics use non-positive row counts for unknown values, while HMS-compatible catalogs may expose any value less than or equal to zero when statistics are unavailable. Treating such a value as an exact row count can make an optimizer plan against an apparently empty scan that still contains data. This change: - treats non-positive catalog partition row counts as unknown in Core format-table scan plans; - makes Spark reject non-positive scan and split row counts, while preserving exact zero for structurally empty scans and positive scan-level statistics; - makes Flink return `TableStats.UNKNOWN` for non-positive or overflowed row-count sums from both partition entries and splits; - uses checked addition so overflow cannot turn a large table into a misleading row count. Empty input collections still produce an exact zero. There is no public API change. ### Tests - [x] `CatalogManagedPartitionScanTest` (23 tests) - [x] `PaimonStatisticsTest` (5 tests) - [x] `FlinkTableSourceStatisticsTest` (3 tests) - [x] `CatalogManagedPartitionAnalyzeTest` Spark integration suite (22 tests) - [x] Spotless apply/check for Core, Flink common, and Spark common -- 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]
