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 2022/03/02 11:42:04 UTC

[GitHub] [incubator-doris] yangzhg commented on a change in pull request #8289: [refactor] remove types_test

yangzhg commented on a change in pull request #8289:
URL: https://github.com/apache/incubator-doris/pull/8289#discussion_r817610939



##########
File path: fe/fe-core/src/main/java/org/apache/doris/catalog/ScalarType.java
##########
@@ -69,6 +66,12 @@
     // Keep consistent with backend ColumnType::CHAR_INLINE_LENGTH
     public static final int CHAR_INLINE_LENGTH = 128;
 
+    // Max length of String types, in be storage layer store string length
+    // using int32, the max length is 2GB, the first 4 bytes store the length
+    // so the max available length is 2GB - 4
+
+    public static final int MAX_STRING_LENGTH = 0x7fffffff - 4;

Review comment:
       It is explained in comments that the value is 2GB - 4, why  use `public static final int MAX_STRING_LENGTH = 2 << 30 - 1 - 4;` ?  How to compute 2GB - 4 is not important and  2 << 30 does not have performance advantages




-- 
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-unsubscribe@doris.apache.org

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