You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2020/12/14 10:41:19 UTC

[GitHub] [incubator-doris] morningman commented on a change in pull request #5072: [Bug] Fix the bug of where condition a in ('A', 'B', 'V') and a in ('A') return error result

morningman commented on a change in pull request #5072:
URL: https://github.com/apache/incubator-doris/pull/5072#discussion_r542208102



##########
File path: be/src/exec/olap_common.h
##########
@@ -495,6 +517,55 @@ bool ColumnValueRange<T>::is_in_range(const T& value) {
     return false;
 }
 
+template <class T>
+void ColumnValueRange<T>::intersection(ColumnValueRange<T>& range) {
+    // 1. clear if column type not match
+    if (_column_type != range._column_type) {
+        set_empty_value_range();
+    }
+
+    // 2. clear if any range is empty
+    if (is_empty_value_range() || range.is_empty_value_range()) {
+        set_empty_value_range();
+    }
+
+    std::set<T> result_values;
+    // 3. fixed_value intersection
+    if (is_fixed_value_range() || range.is_fixed_value_range()) {

Review comment:
       calculate `is_fixed_value_range` and `range.is_fixed_value_range` once.




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

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