zenoyang opened a new issue, #9269:
URL: https://github.com/apache/incubator-doris/issues/9269

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/incubator-doris/issues?q=is%3Aissue) and 
found no similar issues.
   
   
   ### Version
   
   master b40668448
   
   ### What's Wrong?
   
   Query get wrong result when ColumnDict concurrent predicate eval.
   
   Reproduced on our production data:
   ```sql
   be.conf
   enable_storage_vectorization = true;
   enable_low_cardinality_optimize = true;
   mysql> set enable_vectorized_engine = true;
   
   mysql> SELECT count(distinct v1)
       ->   from tbl1
       ->  where dt='2022-04-13'
       ->    and k1 in ('xxx1','xxx2','xxx3','xxx4','xxx5');
   +-----------------------------+
   | count(DISTINCT `v1`) |
   +-----------------------------+
   |                    70645634 |
   +-----------------------------+
   
   
   mysql> set enable_vectorized_engine = false;
   mysql> SELECT count(distinct v1)   from tbl1  where dt='2022-04-13' and k1 
in ('xxx1','xxx2','xxx3','xxx4','xxx5');
   +-----------------------------+
   | count(DISTINCT `v1`) |
   +-----------------------------+
   |                    69672646 |
   +-----------------------------+
   
   
   be.conf
   enable_low_cardinality_optimize = false
   mysql> set enable_vectorized_engine = true;
   
   mysql> SELECT count(distinct v1)   from tbl1  where dt='2022-04-13' and k1 
in ('xxx1','xxx2','xxx3','xxx4','xxx5');
   +-----------------------------+
   | count(DISTINCT `v1`) |
   +-----------------------------+
   |                    69672646 |
   +-----------------------------+
   ```
   
   profile:
   ```
   VOLAP_SCAN_NODE  (id=0):(Active:  801.963ms,  %  non-child:  0.78%)
         -  NumScanners:  20
   ```
   
   
   ### What You Expected?
   
   return correct result.
   
   ### How to Reproduce?
   
   _No response_
   
   ### Anything Else?
   
   reason:
   `SegmentIterator` has member variables: `std::vector<ColumnPredicate*> 
col_predicates;` where `ColumnPredicate` is shared by multiple Scanners.
   The internal member variables of the current Predicate will be modified in 
the `SegmentIterator::_evaluate_short_circuit_predicate` method, resulting in 
incorrect results.
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
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.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