You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by "kasakrisz (via GitHub)" <gi...@apache.org> on 2023/06/07 09:31:24 UTC

[GitHub] [hive] kasakrisz commented on a diff in pull request #4391: ClassCastException for string to decimal64 conversion

kasakrisz commented on code in PR #4391:
URL: https://github.com/apache/hive/pull/4391#discussion_r1221262547


##########
ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/CastStringToDecimal.java:
##########
@@ -66,6 +67,10 @@ protected void func(DecimalColumnVector outputColVector, BytesColumnVector input
     }
   }
 
+  protected void setOutputColumnVectorValue(ColumnVector outputColVector, int i, String s) {
+    ((DecimalColumnVector) outputColVector).set(i, HiveDecimal.create(s));

Review Comment:
   Is it possible to change the type of `outputColVector` to `IDecimalColumnVector` to get rid of the cast? And maybe add a method 
   `void IDecimalColumnVector.set(int elementNum, HiveDecimal decimal)`



-- 
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: gitbox-unsubscribe@hive.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org