From 85817f890ff6f24484ba5669bf2f0905f83dc57a Mon Sep 17 00:00:00 2001 From: wuyunfeng01 Date: Tue, 20 Oct 2020 12:52:28 +0800 Subject: [PATCH] [Doris On ES][Bug-Fix] Can not pushdown limit when some predicate can not processed by ES --- be/src/exec/es_http_scan_node.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/be/src/exec/es_http_scan_node.cpp b/be/src/exec/es_http_scan_node.cpp index 9cc9b25f32453a..ed3c1cf8d4696c 100644 --- a/be/src/exec/es_http_scan_node.cpp +++ b/be/src/exec/es_http_scan_node.cpp @@ -440,7 +440,8 @@ void EsHttpScanNode::scanner_worker(int start_idx, int length, std::promisebatch_size()); properties[ESScanReader::KEY_HOST_PORT] = get_host_port(es_scan_range.es_hosts); // push down limit to Elasticsearch - if (limit() != -1 && limit() <= _runtime_state->batch_size()) { + // if predicate in _conjunct_ctxs can not be processed by Elasticsearch, we can not push down limit operator to Elasticsearch + if (limit() != -1 && limit() <= _runtime_state->batch_size() && _conjunct_ctxs.empty()) { properties[ESScanReader::KEY_TERMINATE_AFTER] = std::to_string(limit()); }