csun5285 commented on code in PR #44973:
URL: https://github.com/apache/doris/pull/44973#discussion_r1872522165


##########
fe/fe-core/src/main/java/org/apache/doris/analysis/IndexDef.java:
##########
@@ -256,21 +261,29 @@ public void checkColumn(Column column, KeysType keysType, 
boolean enableUniqueKe
                 if (properties.size() != 2) {
                     throw new AnalysisException("ngram_bf index should have 
gram_size and bf_size properties");
                 }
-                try {
-                    int ngramSize = 
Integer.parseInt(properties.get(NGRAM_SIZE_KEY));
-                    int bfSize = 
Integer.parseInt(properties.get(NGRAM_BF_SIZE_KEY));
-                    if (ngramSize > 256 || ngramSize < 1) {
-                        throw new AnalysisException("gram_size should be 
integer and less than 256");
-                    }
-                    if (bfSize > 65535 || bfSize < 64) {
-                        throw new AnalysisException("bf_size should be integer 
and between 64 and 65535");
-                    }
-                } catch (NumberFormatException e) {
-                    throw new AnalysisException("invalid ngram properties:" + 
e.getMessage(), e);
-                }
+
+                parseAndValidateProperty(properties, NGRAM_SIZE_KEY, 
MIN_NGRAM_SIZE, MAX_NGRAM_SIZE);

Review Comment:
   need to modify `IndexDefinition.java`



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

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