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


##########
pinot-core/src/main/java/org/apache/pinot/core/operator/transform/function/CastTransformFunction.java:
##########
@@ -47,40 +47,54 @@ 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":
+          if (!isSVCol) {
+            // TODO: MV cast to BIG_DECIMAL type
+            throw new IllegalArgumentException("MV cast is not supported for 
type - " + targetType);

Review Comment:
   (nit) suggest changing the message to `"Cast is not supported on multi-value 
column to target type: " + targetType`



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