diff --git a/be/src/exec/es/es_scan_reader.cpp b/be/src/exec/es/es_scan_reader.cpp index 4d6673815c..43af7862ae 100644 --- a/be/src/exec/es/es_scan_reader.cpp +++ b/be/src/exec/es/es_scan_reader.cpp @@ -27,14 +27,15 @@ #include "exec/es/es_scroll_query.h" namespace doris { -const std::string REUQEST_SCROLL_FILTER_PATH = "filter_path=_scroll_id,hits.hits._source,hits.total,_id,hits.hits._source.fields,hits.hits.fields"; + +const std::string SOURCE_SCROLL_SEARCH_FILTER_PATH = "filter_path=_scroll_id,hits.hits._source,hits.total,_id"; +const std::string DOCVALUE_SCROLL_SEARCH_FILTER_PATH = "filter_path=_scroll_id,hits.total,hits.hits._score,hits.hits.fields"; + const std::string REQUEST_SCROLL_PATH = "_scroll"; const std::string REQUEST_PREFERENCE_PREFIX = "&preference=_shards:"; const std::string REQUEST_SEARCH_SCROLL_PATH = "/_search/scroll"; const std::string REQUEST_SEPARATOR = "/"; -const std::string REQUEST_SEARCH_FILTER_PATH = "filter_path=hits.hits._source,hits.total,_id,hits.hits._source.fields,hits.hits.fields"; - ESScanReader::ESScanReader(const std::string& target, const std::map& props, bool doc_value_mode) : _scroll_keep_alive(config::es_scroll_keepalive), _http_timeout_ms(config::es_http_timeout_ms), @@ -57,6 +58,7 @@ ESScanReader::ESScanReader(const std::string& target, const std::map= _size) { - // _source is fetched from ES - if (!_doc_value_mode) { - return Status::OK(); - } - - // _fields(doc_value) is fetched from ES - if (_total <= 0 || _line_index >= _total) { - return Status::OK(); - } - - - // here is operations for `enable_doc_value_scan`. - // This indicates that the fields does not exist(e.g. never assign values to these fields), but other fields have values. - // so, number of rows is >= 0, we need fill `NULL` to these fields that does not exist. - _line_index++; - tuple->init(tuple_desc->byte_size()); - for (int i = 0; i < tuple_desc->slots().size(); ++i) { - const SlotDescriptor* slot_desc = tuple_desc->slots()[i]; - if (slot_desc->is_materialized()) { - tuple->set_null(slot_desc->null_indicator_offset()); - } - } - - *line_eof = false; return Status::OK(); }