SabrinaZhaozyf commented on code in PR #9296:
URL: https://github.com/apache/pinot/pull/9296#discussion_r960060129


##########
pinot-core/src/main/java/org/apache/pinot/core/operator/transform/function/CastTransformFunction.java:
##########
@@ -47,40 +49,51 @@ public void init(List<TransformFunction> arguments, 
Map<String, DataSource> data
 
     _transformFunction = arguments.get(0);
     TransformFunction castFormatTransformFunction = arguments.get(1);
+    boolean isSVCol = _transformFunction.getResultMetadata().isSingleValue();
 
     if (castFormatTransformFunction instanceof LiteralTransformFunction) {
       String targetType = ((LiteralTransformFunction) 
castFormatTransformFunction).getLiteral().toUpperCase();
       switch (targetType) {
         case "INT":
         case "INTEGER":
-          _resultMetadata = INT_SV_NO_DICTIONARY_METADATA;
+          _resultMetadata = isSVCol ? INT_SV_NO_DICTIONARY_METADATA : 
INT_MV_NO_DICTIONARY_METADATA;
           break;
         case "LONG":
-          _resultMetadata = LONG_SV_NO_DICTIONARY_METADATA;
+          _resultMetadata = isSVCol ? LONG_SV_NO_DICTIONARY_METADATA : 
LONG_MV_NO_DICTIONARY_METADATA;
           break;
         case "FLOAT":
-          _resultMetadata = FLOAT_SV_NO_DICTIONARY_METADATA;
+          _resultMetadata = isSVCol ? FLOAT_SV_NO_DICTIONARY_METADATA : 
FLOAT_MV_NO_DICTIONARY_METADATA;
           break;
         case "DOUBLE":
-          _resultMetadata = DOUBLE_SV_NO_DICTIONARY_METADATA;
+          _resultMetadata = isSVCol ? DOUBLE_SV_NO_DICTIONARY_METADATA : 
DOUBLE_MV_NO_DICTIONARY_METADATA;
           break;
         case "DECIMAL":
         case "BIGDECIMAL":
         case "BIG_DECIMAL":
+          // TODO: MV cast to BIG_DECIMAL type

Review Comment:
   Good catch! Will throw an exception as well because we decided to address 
this TODO in a separate PR in the future after our discussion.



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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to