This is an automated email from the ASF dual-hosted git repository.

dataroaring pushed a commit to branch branch-3.0
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-3.0 by this push:
     new e9ae2d7a668 [Chore](session-variable) set default value when 
maxScanKeyNum/maxPushdownConditionsPerColumn h… (#39713)
e9ae2d7a668 is described below

commit e9ae2d7a668169f84d7564baf2d8a87e440f41e6
Author: Pxl <[email protected]>
AuthorDate: Thu Aug 22 10:21:18 2024 +0800

    [Chore](session-variable) set default value when 
maxScanKeyNum/maxPushdownConditionsPerColumn h… (#39713)
    
    …as invalid value
    
    ## Proposed changes
    set default value when maxScanKeyNum/maxPushdownConditionsPerColumn has
    invalid value
    related with #39219
---
 be/src/exec/olap_common.h                          | 10 ++++++++++
 .../java/org/apache/doris/qe/SessionVariable.java  | 23 ++++++++++++----------
 2 files changed, 23 insertions(+), 10 deletions(-)

diff --git a/be/src/exec/olap_common.h b/be/src/exec/olap_common.h
index c2199cd6be9..76d5ec83d7d 100644
--- a/be/src/exec/olap_common.h
+++ b/be/src/exec/olap_common.h
@@ -770,6 +770,7 @@ bool 
ColumnValueRange<primitive_type>::convert_to_avg_range_value(
         if (step_size > MAX_STEP_SIZE) {
             return no_split();
         }
+        size_t real_step_size = 0;
 
         // Add null key if contain null, must do after no_split check
         if (contain_null()) {
@@ -797,6 +798,15 @@ bool 
ColumnValueRange<primitive_type>::convert_to_avg_range_value(
                 break;
             }
             ++min_value;
+            ++real_step_size;
+            if (real_step_size > MAX_STEP_SIZE) {
+                throw Exception(Status::InternalError(
+                        "convert_to_avg_range_value meet error. type={}, 
step_size={}, "
+                        "min_value={}, max_value={}",
+                        int(primitive_type), step_size,
+                        cast_to_string<primitive_type, CppType>(min_value, 
scale()),
+                        cast_to_string<primitive_type, CppType>(max_value, 
scale())));
+            }
         }
 
         return step_size != 0;
diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java 
b/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java
index ce726463b0e..c9e28053e12 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java
@@ -2800,14 +2800,6 @@ public class SessionVariable implements Serializable, 
Writable {
         this.storageEngine = storageEngine;
     }
 
-    public int getMaxScanKeyNum() {
-        return maxScanKeyNum;
-    }
-
-    public void setMaxScanKeyNum(int maxScanKeyNum) {
-        this.maxScanKeyNum = maxScanKeyNum;
-    }
-
     public int getMaxPushdownConditionsPerColumn() {
         return maxPushdownConditionsPerColumn;
     }
@@ -3552,8 +3544,19 @@ public class SessionVariable implements Serializable, 
Writable {
         tResult.setBatchSize(batchSize);
         tResult.setDisableStreamPreaggregations(disableStreamPreaggregations);
         
tResult.setEnableDistinctStreamingAggregation(enableDistinctStreamingAggregation);
-        tResult.setMaxScanKeyNum(maxScanKeyNum);
-        
tResult.setMaxPushdownConditionsPerColumn(maxPushdownConditionsPerColumn);
+
+        if (maxScanKeyNum > 0) {
+            tResult.setMaxScanKeyNum(maxScanKeyNum);
+        } else {
+            // for old version default value
+            tResult.setMaxScanKeyNum(48);
+        }
+        if (maxPushdownConditionsPerColumn > 0) {
+            
tResult.setMaxPushdownConditionsPerColumn(maxPushdownConditionsPerColumn);
+        } else {
+            // for old version default value
+            tResult.setMaxPushdownConditionsPerColumn(1024);
+        }
 
         tResult.setRuntimeFilterWaitTimeMs(runtimeFilterWaitTimeMs);
         tResult.setRuntimeFilterMaxInNum(runtimeFilterMaxInNum);


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to