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

lijibing pushed a commit to branch cast
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/cast by this push:
     new 2b8bce9f56d [feature](cast)Add session variable for strict mode cast. 
(#50885)
2b8bce9f56d is described below

commit 2b8bce9f56d9eba5a447711b22895dee063bbf7e
Author: James <[email protected]>
AuthorDate: Wed May 14 14:29:55 2025 +0800

    [feature](cast)Add session variable for strict mode cast. (#50885)
    
    ### What problem does this PR solve?
    Add session variable for strict mode cast.
---
 .../src/main/java/org/apache/doris/qe/SessionVariable.java    | 11 +++++++++++
 gensrc/thrift/PaloInternalService.thrift                      |  2 ++
 2 files changed, 13 insertions(+)

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 e3bae3f4c70..2379f772e78 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
@@ -732,6 +732,8 @@ public class SessionVariable implements Serializable, 
Writable {
 
     public static final String ENABLE_TEXT_VALIDATE_UTF8 = 
"enable_text_validate_utf8";
 
+    public static final String ENABLE_STRICT_CAST = "enable_strict_cast";
+
     /**
      * If set false, user couldn't submit analyze SQL and FE won't allocate 
any related resources.
      */
@@ -2274,6 +2276,10 @@ public class SessionVariable implements Serializable, 
Writable {
             needForward = true)
     public boolean enableExternalTableBatchMode = true;
 
+    @VariableMgr.VarAttr(name = ENABLE_STRICT_CAST,
+            description = {"cast使用严格模式", "Use strict mode for cast"})
+    public boolean enableStrictCast = true;
+
     public Set<Integer> getIgnoredRuntimeFilterIds() {
         Set<Integer> ids = Sets.newLinkedHashSet();
         if (ignoreRuntimeFilterIds.isEmpty()) {
@@ -4182,6 +4188,7 @@ public class SessionVariable implements Serializable, 
Writable {
 
         
tResult.setMinimumOperatorMemoryRequiredKb(minimumOperatorMemoryRequiredKB);
         tResult.setExchangeMultiBlocksByteSize(exchangeMultiBlocksByteSize);
+        tResult.setEnableStrictCast(enableStrictCast);
         return tResult;
     }
 
@@ -4805,4 +4812,8 @@ public class SessionVariable implements Serializable, 
Writable {
     public boolean showSplitProfileInfo() {
         return enableProfile() && getProfileLevel() > 1;
     }
+
+    public boolean enableStrictCast() {
+        return enableStrictCast;
+    }
 }
diff --git a/gensrc/thrift/PaloInternalService.thrift 
b/gensrc/thrift/PaloInternalService.thrift
index 81e4d1f877c..75eba955001 100644
--- a/gensrc/thrift/PaloInternalService.thrift
+++ b/gensrc/thrift/PaloInternalService.thrift
@@ -394,6 +394,8 @@ struct TQueryOptions {
   163: optional bool inverted_index_compatible_read = false
   164: optional bool check_orc_init_sargs_success = false
   165: optional i32 exchange_multi_blocks_byte_size = 262144 
+  // true to use strict cast mode.
+  166: optional bool enable_strict_cast = true
 
   // For cloud, to control if the content would be written into file cache
   // In write path, to control if the content would be written into file cache.


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

Reply via email to