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/04/07 04:26:07 UTC

[GitHub] [incubator-doris] morningman commented on a diff in pull request #8882: [Feature] Disable cast operation of hll/bitmap type

morningman commented on code in PR #8882:
URL: https://github.com/apache/incubator-doris/pull/8882#discussion_r844641534


##########
fe/fe-core/src/main/java/org/apache/doris/analysis/CastExpr.java:
##########
@@ -134,23 +134,29 @@ public TypeDef getTargetTypeDef() {
         return targetTypeDef;
     }
 
+    private static boolean disableRegisterCastingFunction(Type fromType, Type toType) {
+        // Disable casting from boolean to decimal or datetime or date
+        if (fromType.isBoolean() &&
+                (toType.equals(Type.DECIMALV2) ||
+                        toType.equals(Type.DATETIME) || toType.equals(Type.DATE))) {
+            return true;
+        }
+
+        // Disable casting operation of hll/bitmap
+        if (fromType.isBitmapType() || fromType.isHllType() || toType.isHllType() || toType.isBitmapType()) {

Review Comment:
   We also had a `QUANTILE_STATE
   You can use `isObjectStored()` instead.



##########
fe/fe-core/src/main/java/org/apache/doris/catalog/PrimitiveType.java:
##########
@@ -266,8 +264,6 @@
         builder.put(STRING, DECIMALV2);
         builder.put(STRING, VARCHAR);
         builder.put(STRING, STRING);
-        builder.put(STRING, HLL);
-        builder.put(STRING, BITMAP);
         builder.put(STRING, QUANTILE_STATE);

Review Comment:
   disable `STRING, QUANTILE_STATE`



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