Jibing-Li commented on code in PR #11000:
URL: https://github.com/apache/doris/pull/11000#discussion_r924148547


##########
be/src/vec/exec/file_scan_node.cpp:
##########
@@ -90,18 +115,102 @@ Status FileScanNode::open(RuntimeState* state) {
     RETURN_IF_ERROR(ExecNode::open(state));
     RETURN_IF_CANCELLED(state);
 
+    RETURN_IF_ERROR(_acquire_and_build_runtime_filter(state));
+
     RETURN_IF_ERROR(start_scanners());
 
     return Status::OK();
 }
 
+Status FileScanNode::_acquire_and_build_runtime_filter(RuntimeState* state) {
+    // acquire runtime filter
+    _runtime_filter_ctxs.resize(_runtime_filter_descs.size());
+    for (size_t i = 0; i < _runtime_filter_descs.size(); ++i) {
+        auto& filter_desc = _runtime_filter_descs[i];
+        IRuntimeFilter* runtime_filter = nullptr;
+        state->runtime_filter_mgr()->get_consume_filter(filter_desc.filter_id, 
&runtime_filter);
+        DCHECK(runtime_filter != nullptr);

Review Comment:
   Will DCHECK(false) throw an exception? I didn't find its definition.



##########
be/src/vec/exec/file_scan_node.cpp:
##########
@@ -90,18 +115,102 @@ Status FileScanNode::open(RuntimeState* state) {
     RETURN_IF_ERROR(ExecNode::open(state));
     RETURN_IF_CANCELLED(state);
 
+    RETURN_IF_ERROR(_acquire_and_build_runtime_filter(state));
+
     RETURN_IF_ERROR(start_scanners());
 
     return Status::OK();
 }
 
+Status FileScanNode::_acquire_and_build_runtime_filter(RuntimeState* state) {
+    // acquire runtime filter
+    _runtime_filter_ctxs.resize(_runtime_filter_descs.size());
+    for (size_t i = 0; i < _runtime_filter_descs.size(); ++i) {
+        auto& filter_desc = _runtime_filter_descs[i];
+        IRuntimeFilter* runtime_filter = nullptr;
+        state->runtime_filter_mgr()->get_consume_filter(filter_desc.filter_id, 
&runtime_filter);
+        DCHECK(runtime_filter != nullptr);

Review Comment:
   What will happen if DCHECK(false)?



##########
fe/fe-core/src/main/java/org/apache/doris/planner/RuntimeFilterGenerator.java:
##########
@@ -321,7 +322,7 @@ private void finalizeRuntimeFilter(RuntimeFilter 
runtimeFilter) {
      * 2. Only olap scan nodes are supported:
      */
     private void assignRuntimeFilters(ScanNode scanNode) {
-        if (!(scanNode instanceof OlapScanNode)) {
+        if (!(scanNode instanceof OlapScanNode) && !(scanNode instanceof 
ExternalFileScanNode)) {

Review Comment:
   I suppose ExternalFileScanNode is used only when `enable_multi_catalog` is 
set to true.



-- 
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-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to