You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "zhangstar333 (via GitHub)" <gi...@apache.org> on 2026/10/09 05:37:38 UTC
[PR] Prefilter boolean [doris]
zhangstar333 opened a new pull request, #68813:
URL: https://github.com/apache/doris/pull/68813
### What problem does this PR solve?
Issue Number: close #xxx
Related PR: #xxx
Problem Summary:
### Release note
None
### Check List (For Author)
- Test <!-- At least one of them must be included. -->
- [ ] Regression test
- [ ] Unit Test
- [ ] Manual test (add detailed scripts or steps below)
- [ ] No need to test or manual test. Explain why:
- [ ] This is a refactor/code format and no logic has been changed.
- [ ] Previous test can cover this change.
- [ ] No code files have been changed.
- [ ] Other reason <!-- Add your reason? -->
- Behavior changed:
- [ ] No.
- [ ] Yes. <!-- Explain the behavior change -->
- Does this need documentation?
- [ ] No.
- [ ] Yes. <!-- Add document PR link here. eg: https://github.com/apache/doris-website/pull/1214 -->
### Check List (For Reviewer who merge this PR)
- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label <!-- Add branch pick label that this PR should merge into -->
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] Prefilter boolean [doris]
Posted by "zhangstar333 (via GitHub)" <gi...@apache.org>.
zhangstar333 commented on code in PR #68813:
URL: https://github.com/apache/doris/pull/68813#discussion_r4227912805
##########
be/test/format_v2/table/lance_reader_test.cpp:
##########
@@ -923,15 +923,15 @@ TEST(LanceTableReaderVectorSearchTest, MultiVectorScoresFiltersOffsetsAndIndexed
}
// Read metrics after close: lance-c publishes its final execution summary
// when the stream is released, including for an early top-k stop.
- for (const char* name : {"LancePrefilterLoads", "LancePrefilterInputRows",
- "LancePrefilterInputBatches", "LancePrefilterRowIds",
- "LancePrefilterLoadTime", "LancePrefilterInputTime",
- "LancePrefilterBuildTime"}) {
+ for (const char* name : {"RowIdPrefilterLoads", "RowIdPrefilterInputRows",
+ "RowIdPrefilterInputBatches", "RowIdPrefilterIds",
+ "RowIdPrefilterLoadTime", "RowIdPrefilterInputTime",
Review Comment:
done
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] Prefilter boolean [doris]
Posted by "zhangstar333 (via GitHub)" <gi...@apache.org>.
zhangstar333 commented on PR #68813:
URL: https://github.com/apache/doris/pull/68813#issuecomment-6077215446
/review
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [opt](lance) add prefilter option for filter execution control [doris]
Posted by "zhangstar333 (via GitHub)" <gi...@apache.org>.
zhangstar333 commented on PR #68813:
URL: https://github.com/apache/doris/pull/68813#issuecomment-6083255520
run buildall
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] Prefilter boolean [doris]
Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #68813:
URL: https://github.com/apache/doris/pull/68813#issuecomment-6075013111
Thank you for your contribution to Apache Doris.
Don't know what should be done next? See [How to process your PR](https://doris.apache.org/community/how-to-contribute/review-and-ci).
Please clearly describe your PR:
1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
3. What features were added. Why was this function added?
4. Which code was refactored and why was this part of the code refactored?
5. Which functions were optimized and what is the difference before and after the optimization?
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] Prefilter boolean [doris]
Posted by "zhangstar333 (via GitHub)" <gi...@apache.org>.
zhangstar333 commented on PR #68813:
URL: https://github.com/apache/doris/pull/68813#issuecomment-6076836996
/review
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] Prefilter boolean [doris]
Posted by "zhangstar333 (via GitHub)" <gi...@apache.org>.
zhangstar333 commented on code in PR #68813:
URL: https://github.com/apache/doris/pull/68813#discussion_r4227715777
##########
fe/fe-core/src/main/java/org/apache/doris/tablefunction/LanceExternalSearchTableValuedFunction.java:
##########
@@ -196,6 +197,10 @@ protected static PreparedSearch prepareSearch(CommonSearch common, int fieldId,
.setFormat(TSearchFilterFormat.SQL)
.setPayload(validateAndEncodeSqlFilter(common.params.get(FILTER))));
}
+ // Keep the search-filter timing common to vector and full-text TVFs. Omission defaults
+ // to postfilter for both kinds of search.
Review Comment:
no rolling upgrades now.
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] Prefilter boolean [doris]
Posted by "zhangstar333 (via GitHub)" <gi...@apache.org>.
zhangstar333 commented on code in PR #68813:
URL: https://github.com/apache/doris/pull/68813#discussion_r4227721919
##########
thirdparty/patches/lance-c-foyer.patch:
##########
@@ -547,32 +6861,9 @@ index 0000000000000000000000000000000000000000..cfc47f1528d11b6be068c09dd4703ff4
+use crate::runtime::block_on;
+use crate::session::{LanceSession, session_new_with_data_cache_factory};
+
-+const CACHE_KEY_VERSION: &str = "lance-data-v2";
++const CACHE_KEY_VERSION: &str = "lance-data-v1";
+const FOYER_PAGE_SIZE: usize = 4096;
+
-+struct OriginNamespace {
-+ origin: Weak<dyn ObjectStore>,
-+ namespace: uuid::Uuid,
-+}
-+
-+static ORIGIN_NAMESPACES: LazyLock<Mutex<HashMap<usize, OriginNamespace>>> =
-+ LazyLock::new(|| Mutex::new(HashMap::new()));
-+
-+fn origin_namespace(origin: &Arc<dyn ObjectStore>) -> uuid::Uuid {
-+ // store_prefix omits endpoint/credentials, and this interface exposes no stable
-+ // backend identity. Only the same live origin may reuse metadata or data.
-+ // Persist a random namespace, never an address that another process can reuse.
-+ let mut namespaces = ORIGIN_NAMESPACES.lock().unwrap();
-+ namespaces.retain(|_, entry| entry.origin.strong_count() != 0);
-+ namespaces
-+ .entry(Arc::as_ptr(origin) as *const () as usize)
-+ .or_insert_with(|| OriginNamespace {
-+ origin: Arc::downgrade(origin),
-+ namespace: uuid::Uuid::new_v4(),
-+ })
-+ .namespace
-+}
-+
+/// Configuration for the optional Foyer data-file cache.
+#[repr(C)]
Review Comment:
no
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [opt](lance) add prefilter option for filter execution control [doris]
Posted by "Gabriel39 (via GitHub)" <gi...@apache.org>.
Gabriel39 merged PR #68813:
URL: https://github.com/apache/doris/pull/68813
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [opt](lance) add prefilter option for filter execution control [doris]
Posted by "zhangstar333 (via GitHub)" <gi...@apache.org>.
zhangstar333 commented on PR #68813:
URL: https://github.com/apache/doris/pull/68813#issuecomment-6092657101
run buildall
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [opt](lance) add prefilter option for filter execution control [doris]
Posted by "Gabriel39 (via GitHub)" <gi...@apache.org>.
Gabriel39 commented on PR #68813:
URL: https://github.com/apache/doris/pull/68813#issuecomment-6093097958
/review
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [opt](lance) add prefilter option for filter execution control [doris]
Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #68813:
URL: https://github.com/apache/doris/pull/68813#issuecomment-6083753220
# FE UT Coverage Report
Increment line coverage ` 33.33% (3/9)` :tada:
[Increment coverage report](http://coverage.selectdb-in.cc/coverage/68813_65077a5afe817b0ccd4a2ad9b0045bc1ca9547a2/fe_increment_report/index.html)
[Complete coverage report](http://coverage.selectdb-in.cc/coverage/68813_65077a5afe817b0ccd4a2ad9b0045bc1ca9547a2/fe_report/index.html)
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] Prefilter boolean [doris]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #68813:
URL: https://github.com/apache/doris/pull/68813#issuecomment-6077070916
Codex automated review failed and did not complete.
Error: Review recovery stopped: No final review submission was declared
Workflow run: https://github.com/apache/doris/actions/runs/37901705711
Please inspect the workflow logs and rerun the review after the underlying issue is resolved.
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [opt](lance) add prefilter option for filter execution control [doris]
Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #68813:
URL: https://github.com/apache/doris/pull/68813#issuecomment-6086652541
# FE UT Coverage Report
Increment line coverage ` 33.33% (3/9)` :tada:
[Increment coverage report](http://coverage.selectdb-in.cc/coverage/68813_8f3ca56a65b8ee5410df9e823b8117ed4a53383c/fe_increment_report/index.html)
[Complete coverage report](http://coverage.selectdb-in.cc/coverage/68813_8f3ca56a65b8ee5410df9e823b8117ed4a53383c/fe_report/index.html)
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [opt](lance) add prefilter option for filter execution control [doris]
Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #68813:
URL: https://github.com/apache/doris/pull/68813#issuecomment-6094038772
# FE UT Coverage Report
Increment line coverage ` 33.33% (3/9)` :tada:
[Increment coverage report](http://coverage.selectdb-in.cc/coverage/68813_d6dcb816a1eff36d64f92f57ba2c3022b71409e2/fe_increment_report/index.html)
[Complete coverage report](http://coverage.selectdb-in.cc/coverage/68813_d6dcb816a1eff36d64f92f57ba2c3022b71409e2/fe_report/index.html)
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] Prefilter boolean [doris]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on code in PR #68813:
URL: https://github.com/apache/doris/pull/68813#discussion_r4227447649
##########
fe/fe-core/src/main/java/org/apache/doris/tablefunction/LanceExternalSearchTableValuedFunction.java:
##########
@@ -196,6 +197,10 @@ protected static PreparedSearch prepareSearch(CommonSearch common, int fieldId,
.setFormat(TSearchFilterFormat.SQL)
.setPayload(validateAndEncodeSqlFilter(common.params.get(FILTER))));
}
+ // Keep the search-filter timing common to vector and full-text TVFs. Omission defaults
+ // to postfilter for both kinds of search.
Review Comment:
[P1] Preserve filter semantics during BE rolling upgrades. A new FE sends `prefilter=false` for an omitted property, which an old BE ignores and still prefilters; conversely, an old FE sends no field, which this new BE treats as postfilter. With `top_k=3` and `filter=category = 'odd'`, one BE returns only row 2 while the other returns rows 2, 4, and 6, so the same query changes with split placement. Version or capability gate this semantic change on both sides, or retain the old default until all eligible BEs understand it.
##########
be/test/format_v2/table/lance_reader_test.cpp:
##########
@@ -923,15 +923,15 @@ TEST(LanceTableReaderVectorSearchTest, MultiVectorScoresFiltersOffsetsAndIndexed
}
// Read metrics after close: lance-c publishes its final execution summary
// when the stream is released, including for an early top-k stop.
- for (const char* name : {"LancePrefilterLoads", "LancePrefilterInputRows",
- "LancePrefilterInputBatches", "LancePrefilterRowIds",
- "LancePrefilterLoadTime", "LancePrefilterInputTime",
- "LancePrefilterBuildTime"}) {
+ for (const char* name : {"RowIdPrefilterLoads", "RowIdPrefilterInputRows",
+ "RowIdPrefilterInputBatches", "RowIdPrefilterIds",
+ "RowIdPrefilterLoadTime", "RowIdPrefilterInputTime",
Review Comment:
[P2] Set `prefilter=true` in the BE cases that still assert prefilter behavior. This filtered test only sets `search_filter`, so the new BE passes false to Lance, while the changed assertions require every row-ID prefilter counter to be positive. The filtered TopK expectations in this file also assume prefilter-before-ranking and will fail. Set the flag explicitly in those existing cases and cover the new false/default path separately.
##########
thirdparty/patches/lance-c-foyer.patch:
##########
@@ -1003,32 +7293,20 @@ index 0000000000000000000000000000000000000000..cfc47f1528d11b6be068c09dd4703ff4
+ },
+ )
+ .await?;
-+ // HTTP responses carry transport extensions even for immutable files.
-+ // Cache metadata independently; request-specific extensions are never replayed.
++ // Cache only immutable metadata and attributes, never request-specific state.
+ self.reader.cache.metadata.insert(
-+ metadata_key.clone(),
++ metadata_key,
+ (result.meta.clone(), result.attributes.clone()),
+ );
-+ (result.meta, result.attributes, result.extensions)
++ (result.meta, result.attributes)
+ };
+ let object_size = metadata.size;
-+ let size_bytes = object_size.to_le_bytes();
-+ // WriteOnInsertion enqueues disk I/O even for an identical value. Look in
-+ // both tiers so warm reads, including recovered entries, remain read-only.
Review Comment:
[P2] Skip the size-key insert on warm reads. This `cached_get` path is reached by ordinary Lance range reads, and `WriteOnInsertion` enqueues a disk write for the same 8-byte size record on every call, even when metadata and data blocks are cached. The previous patch checked the memory and disk tiers before inserting and had a zero-write warm-read test; retain that guard and test to avoid persistent write amplification.
##########
be/src/format_v2/table/lance_reader.cpp:
##########
@@ -1180,7 +1066,8 @@ void LanceTableReader::_collect_scan_statistics(void* callback_ctx, const void*
update_counter(reader->_execution_iops, statistics->iops, "iops");
update_counter(reader->_execution_requests, statistics->requests, "requests");
update_counter(reader->_execution_bytes_read, statistics->bytes_read, "bytes_read");
- update_counter(reader->_index_partition_cache_miss_loads, statistics->index_partitions_loaded,
+ update_counter(reader->_index_object_loads, statistics->indices_loaded, "indices_loaded");
+ update_counter(reader->_index_components_loaded, statistics->index_partitions_loaded,
"index_partitions_loaded");
update_counter(reader->_index_comparisons, statistics->index_comparisons, "index_comparisons");
Review Comment:
[P2] Keep the counter tree stable across Lance scanner tasks. These groups are now created only for metrics reported by each task, but FE `RuntimeProfile.mergeCounters` traverses only the first task's child-counter map. A vector query with an uncovered flat split and an indexed split can therefore lose all `LanceVectorIndex` metrics in its aggregate Profile when the flat task is first. Pre-register the hierarchy for every scanner or merge the union of counter names, and cover the mixed-split aggregate.
##########
be/src/format_v2/table/lance_reader.cpp:
##########
@@ -1197,38 +1084,20 @@ void LanceTableReader::_collect_scan_statistics(void* callback_ctx, const void*
continue;
}
const std::string_view name(metric.name == nullptr ? "" : metric.name, metric.name_len);
- RuntimeProfile::Counter* counter = nullptr;
- switch (metric.kind) {
- case LANCE_SCAN_METRIC_COUNT: {
- const auto found = reader->_lance_count_metrics.find(name);
- if (found != reader->_lance_count_metrics.end()) {
- counter = found->second;
+ for (const auto& definition : LANCE_SCAN_METRICS) {
+ if (definition.native_name != name) {
+ continue;
}
- break;
- }
- case LANCE_SCAN_METRIC_TIME_NANOSECONDS: {
- const auto found = reader->_lance_time_metrics.find(name);
- if (found != reader->_lance_time_metrics.end()) {
- counter = found->second;
- } else if (name == "search_time") {
- // Scalar-index metrics exist only when Lance includes the corresponding
- // execution node in this scan plan.
- counter = ADD_CHILD_TIMER_WITH_LEVEL(reader->_scanner_profile,
Review Comment:
[P2] Keep metric allocation out of the Lance statistics callback. `add_lance_counter` now allocates counters and map entries for every first-seen metric at EOF; an allocation failure can throw through `LanceScanStatisticsCallback`, whose ABI requires callbacks to return normally, potentially aborting the BE. Pre-register these metrics before handing the callback to Lance, or catch allocation failures inside the callback and skip best-effort profiling.
##########
thirdparty/patches/lance-c-foyer.patch:
##########
@@ -547,32 +6861,9 @@ index 0000000000000000000000000000000000000000..cfc47f1528d11b6be068c09dd4703ff4
+use crate::runtime::block_on;
+use crate::session::{LanceSession, session_new_with_data_cache_factory};
+
-+const CACHE_KEY_VERSION: &str = "lance-data-v2";
++const CACHE_KEY_VERSION: &str = "lance-data-v1";
+const FOYER_PAGE_SIZE: usize = 4096;
+
-+struct OriginNamespace {
-+ origin: Weak<dyn ObjectStore>,
-+ namespace: uuid::Uuid,
-+}
-+
-+static ORIGIN_NAMESPACES: LazyLock<Mutex<HashMap<usize, OriginNamespace>>> =
-+ LazyLock::new(|| Mutex::new(HashMap::new()));
-+
-+fn origin_namespace(origin: &Arc<dyn ObjectStore>) -> uuid::Uuid {
-+ // store_prefix omits endpoint/credentials, and this interface exposes no stable
-+ // backend identity. Only the same live origin may reuse metadata or data.
-+ // Persist a random namespace, never an address that another process can reuse.
-+ let mut namespaces = ORIGIN_NAMESPACES.lock().unwrap();
-+ namespaces.retain(|_, entry| entry.origin.strong_count() != 0);
-+ namespaces
-+ .entry(Arc::as_ptr(origin) as *const () as usize)
-+ .or_insert_with(|| OriginNamespace {
-+ origin: Arc::downgrade(origin),
-+ namespace: uuid::Uuid::new_v4(),
-+ })
-+ .namespace
-+}
-+
+/// Configuration for the optional Foyer data-file cache.
+#[repr(C)]
Review Comment:
[P1] Include the actual storage origin in Foyer cache keys. This now retains only Lance's `store_prefix`, which is `s3$bucket` for S3 and omits `aws_endpoint`, while Doris passes per-catalog endpoints into a BE-wide default-enabled session. Two catalogs with the same bucket and object path on different endpoints can read the first endpoint's cached data (or a recovered disk block) instead of their own, even when the second origin would deny the read. Key both metadata and blocks by a stable endpoint/authorization identity, or isolate origins, and restore the distinct-endpoint tests.
##########
docs/lance-prefilter-profile.md:
##########
@@ -32,17 +32,17 @@ vectors use a different loader and are not included in these counters.
| Counter | Meaning |
| --- | --- |
-| `LancePrefilterLoads` | Number of row-ID prefilter loader executions started. |
-| `LancePrefilterInputBatches` | Successfully consumed input batches. |
-| `LancePrefilterInputRows` | Non-null input row IDs, including duplicates. |
-| `LancePrefilterRowIds` | Sum of distinct row IDs in successfully completed allow sets. |
-| `LancePrefilterLoadTime` | Total loader wall time, including input polling and set construction. |
-| `LancePrefilterInputTime` | Wall time polling input batches, including upstream execution, I/O, decoding and scheduling. |
-| `LancePrefilterBuildTime` | Wall time inserting row IDs into the allow set, measured once per batch. |
+| `RowIdPrefilterLoads` | Number of row-ID prefilter loader executions started. |
Review Comment:
[P3] Update the prefilter guide for the new default. The paragraph above this renamed counter table still says an actual filter uses the row-ID prefilter path, but a `vector_search` with `filter` and no `prefilter` now postfilters and can have no row-ID prefilter counters. Qualify that statement with `prefilter=true` and describe the false/default case so profiles are interpreted correctly.
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] Prefilter boolean [doris]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on code in PR #68813:
URL: https://github.com/apache/doris/pull/68813#discussion_r4228261574
##########
fe/fe-core/src/main/java/org/apache/doris/tablefunction/LanceExternalSearchTableValuedFunction.java:
##########
@@ -206,6 +207,10 @@ protected static PreparedSearch prepareSearch(CommonSearch common, int fieldId,
.setFormat(TSearchFilterFormat.SQL)
.setPayload(validateAndEncodeSqlFilter(common.params.get(FILTER))));
}
+ // Keep the search-filter timing common to vector and full-text TVFs. Omission defaults
+ // to postfilter for both kinds of search.
Review Comment:
[P1] Apply postfilter after merging split candidates. With `top_k=1`, `prefilter=false`, and two uncovered fragments, the nearest row in fragment A can fail `filter` while a farther row in fragment B passes. Each Lance scanner filters after its own TopK, so A emits nothing and B emits its row; Doris's global TopN returns B. A snapshot-wide TopK would rank A first and then postfilter to an empty result. The new default and explicit `false` both reach this path; separate FTS index segments have the same ordering. Preserve unfiltered candidates through the global TopN before applying the TVF postfilter, and cover two splits with a rejected global winner.
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [opt](lance) add prefilter option for filter execution control [doris]
Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #68813:
URL: https://github.com/apache/doris/pull/68813#issuecomment-6095490990
# FE Regression Coverage Report
Increment line coverage ` 10.71% (9/84)` :tada:
[Increment coverage report](http://coverage.selectdb-in.cc/coverage/68813_d6dcb816a1eff36d64f92f57ba2c3022b71409e2_merge_fe/increment_report/index.html)
[Complete coverage report](http://coverage.selectdb-in.cc/coverage/68813_d6dcb816a1eff36d64f92f57ba2c3022b71409e2_merge_fe/report/index.html)
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [opt](lance) add prefilter option for filter execution control [doris]
Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #68813:
URL: https://github.com/apache/doris/pull/68813#issuecomment-6089241676
# FE Regression Coverage Report
Increment line coverage ` 22.22% (2/9)` :tada:
[Increment coverage report](http://coverage.selectdb-in.cc/coverage/68813_8f3ca56a65b8ee5410df9e823b8117ed4a53383c_merge_fe/increment_report/index.html)
[Complete coverage report](http://coverage.selectdb-in.cc/coverage/68813_8f3ca56a65b8ee5410df9e823b8117ed4a53383c_merge_fe/report/index.html)
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] Prefilter boolean [doris]
Posted by "zhangstar333 (via GitHub)" <gi...@apache.org>.
zhangstar333 commented on PR #68813:
URL: https://github.com/apache/doris/pull/68813#issuecomment-6075660771
/review
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] Prefilter boolean [doris]
Posted by "zhangstar333 (via GitHub)" <gi...@apache.org>.
zhangstar333 commented on code in PR #68813:
URL: https://github.com/apache/doris/pull/68813#discussion_r4228534624
##########
fe/fe-core/src/main/java/org/apache/doris/tablefunction/LanceExternalSearchTableValuedFunction.java:
##########
@@ -206,6 +207,10 @@ protected static PreparedSearch prepareSearch(CommonSearch common, int fieldId,
.setFormat(TSearchFilterFormat.SQL)
.setPayload(validateAndEncodeSqlFilter(common.params.get(FILTER))));
}
+ // Keep the search-filter timing common to vector and full-text TVFs. Omission defaults
+ // to postfilter for both kinds of search.
Review Comment:
doris postfilter will be execute at local scan, not after global topn.
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [opt](lance) add prefilter option for filter execution control [doris]
Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #68813:
URL: https://github.com/apache/doris/pull/68813#issuecomment-6084420315
# Cloud UT Coverage Report
Increment line coverage ` ` :tada:
[Increment coverage report](http://coverage.selectdb-in.cc/coverage/8f3ca56a65b8ee5410df9e823b8117ed4a53383c_8f3ca56a65b8ee5410df9e823b8117ed4a53383c_cloud/increment_report/index.html)
[Complete coverage report](http://coverage.selectdb-in.cc/coverage/8f3ca56a65b8ee5410df9e823b8117ed4a53383c_8f3ca56a65b8ee5410df9e823b8117ed4a53383c_cloud/report/index.html)
| Category | Coverage |
|-------------------|--------------------|
| Function Coverage | 78.52% (1963/2500) |
| Line Coverage | 65.43% (35365/54048) |
| Region Coverage | 53.07% (34022/64102) |
| Branch Coverage | 55.82% (10476/18767) |
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] Prefilter boolean [doris]
Posted by "zhangstar333 (via GitHub)" <gi...@apache.org>.
zhangstar333 commented on code in PR #68813:
URL: https://github.com/apache/doris/pull/68813#discussion_r4227908355
##########
be/src/format_v2/table/lance_reader.cpp:
##########
@@ -1180,7 +1066,8 @@ void LanceTableReader::_collect_scan_statistics(void* callback_ctx, const void*
update_counter(reader->_execution_iops, statistics->iops, "iops");
update_counter(reader->_execution_requests, statistics->requests, "requests");
update_counter(reader->_execution_bytes_read, statistics->bytes_read, "bytes_read");
- update_counter(reader->_index_partition_cache_miss_loads, statistics->index_partitions_loaded,
+ update_counter(reader->_index_object_loads, statistics->indices_loaded, "indices_loaded");
+ update_counter(reader->_index_components_loaded, statistics->index_partitions_loaded,
"index_partitions_loaded");
update_counter(reader->_index_comparisons, statistics->index_comparisons, "index_comparisons");
Review Comment:
done
##########
thirdparty/patches/lance-c-foyer.patch:
##########
@@ -1003,32 +7293,20 @@ index 0000000000000000000000000000000000000000..cfc47f1528d11b6be068c09dd4703ff4
+ },
+ )
+ .await?;
-+ // HTTP responses carry transport extensions even for immutable files.
-+ // Cache metadata independently; request-specific extensions are never replayed.
++ // Cache only immutable metadata and attributes, never request-specific state.
+ self.reader.cache.metadata.insert(
-+ metadata_key.clone(),
++ metadata_key,
+ (result.meta.clone(), result.attributes.clone()),
+ );
-+ (result.meta, result.attributes, result.extensions)
++ (result.meta, result.attributes)
+ };
+ let object_size = metadata.size;
-+ let size_bytes = object_size.to_le_bytes();
-+ // WriteOnInsertion enqueues disk I/O even for an identical value. Look in
-+ // both tiers so warm reads, including recovered entries, remain read-only.
Review Comment:
no
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] Prefilter boolean [doris]
Posted by "Gabriel39 (via GitHub)" <gi...@apache.org>.
Gabriel39 commented on PR #68813:
URL: https://github.com/apache/doris/pull/68813#issuecomment-6077629396
run buildall
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] Prefilter boolean [doris]
Posted by "zhangstar333 (via GitHub)" <gi...@apache.org>.
zhangstar333 commented on code in PR #68813:
URL: https://github.com/apache/doris/pull/68813#discussion_r4227910667
##########
be/src/format_v2/table/lance_reader.cpp:
##########
@@ -1197,38 +1084,20 @@ void LanceTableReader::_collect_scan_statistics(void* callback_ctx, const void*
continue;
}
const std::string_view name(metric.name == nullptr ? "" : metric.name, metric.name_len);
- RuntimeProfile::Counter* counter = nullptr;
- switch (metric.kind) {
- case LANCE_SCAN_METRIC_COUNT: {
- const auto found = reader->_lance_count_metrics.find(name);
- if (found != reader->_lance_count_metrics.end()) {
- counter = found->second;
+ for (const auto& definition : LANCE_SCAN_METRICS) {
+ if (definition.native_name != name) {
+ continue;
}
- break;
- }
- case LANCE_SCAN_METRIC_TIME_NANOSECONDS: {
- const auto found = reader->_lance_time_metrics.find(name);
- if (found != reader->_lance_time_metrics.end()) {
- counter = found->second;
- } else if (name == "search_time") {
- // Scalar-index metrics exist only when Lance includes the corresponding
- // execution node in this scan plan.
- counter = ADD_CHILD_TIMER_WITH_LEVEL(reader->_scanner_profile,
Review Comment:
done
##########
docs/lance-prefilter-profile.md:
##########
@@ -32,17 +32,17 @@ vectors use a different loader and are not included in these counters.
| Counter | Meaning |
| --- | --- |
-| `LancePrefilterLoads` | Number of row-ID prefilter loader executions started. |
-| `LancePrefilterInputBatches` | Successfully consumed input batches. |
-| `LancePrefilterInputRows` | Non-null input row IDs, including duplicates. |
-| `LancePrefilterRowIds` | Sum of distinct row IDs in successfully completed allow sets. |
-| `LancePrefilterLoadTime` | Total loader wall time, including input polling and set construction. |
-| `LancePrefilterInputTime` | Wall time polling input batches, including upstream execution, I/O, decoding and scheduling. |
-| `LancePrefilterBuildTime` | Wall time inserting row IDs into the allow set, measured once per batch. |
+| `RowIdPrefilterLoads` | Number of row-ID prefilter loader executions started. |
Review Comment:
done
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [opt](lance) add prefilter option for filter execution control [doris]
Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #68813:
URL: https://github.com/apache/doris/pull/68813#issuecomment-6079948040
# FE UT Coverage Report
Increment line coverage ` 33.33% (3/9)` :tada:
[Increment coverage report](http://coverage.selectdb-in.cc/coverage/68813_65077a5afe817b0ccd4a2ad9b0045bc1ca9547a2/fe_increment_report/index.html)
[Complete coverage report](http://coverage.selectdb-in.cc/coverage/68813_65077a5afe817b0ccd4a2ad9b0045bc1ca9547a2/fe_report/index.html)
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org