JingsongLi commented on code in PR #2381:
URL: https://github.com/apache/incubator-paimon/pull/2381#discussion_r1403923699
##########
paimon-core/src/main/java/org/apache/paimon/operation/KeyValueFileStoreScan.java:
##########
@@ -97,23 +103,50 @@ protected boolean filterByStats(ManifestEntry entry) {
/** Note: Keep this thread-safe. */
@Override
- protected boolean filterWholeBucketByStats(List<ManifestEntry> entries) {
+ protected List<ManifestEntry> filterWholeBucketByStats(List<ManifestEntry>
entries) {
+ if (valueFilter == null) {
+ return entries;
+ }
+
// entries come from the same bucket, if any of it doesn't meet the
request, we could filter
// the bucket.
- if (valueFilter != null) {
- for (ManifestEntry entry : entries) {
- if (valueFilter.test(
- entry.file().rowCount(),
- entry.file()
- .valueStats()
- .fields(
- fieldValueStatsConverters.getOrCreate(
- entry.file().schemaId()),
- entry.file().rowCount()))) {
- return true;
- }
+ if (canSkipWholeBucket(entries)) {
+ return Collections.emptyList();
+ }
+
+ // If there is no custom sequence field, we can filter the whole
bucket by the max level.
+ if (!hasCustomSequenceField) {
Review Comment:
You can add some ITCase to cover this.
--
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]