ygerzhedovich commented on code in PR #1623:
URL: https://github.com/apache/ignite-3/pull/1623#discussion_r1102637417
##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/exp/RexToLixTranslator.java:
##########
@@ -214,7 +218,18 @@ Expression translateCast(
Expression convert = null;
switch (targetType.getSqlTypeName()) {
case ANY:
- convert = operand;
+ // IgniteCustomType: conversion from some type to possibly a
custom data type.
+ // Should we add a hook here that can short-circuit when a
custom type can not be converted?
+ if (targetType instanceof UuidType) {
+ // We need to convert an argument to an object so a call
will throw a CastCastException
+ // instead of a NoSuchMethodError in runtime.
+ // It would be even better if this cast were not be
necessary.
+ return Expressions.call(UuidFunctions.class, "cast",
Expressions.convert_(operand, Object.class));
Review Comment:
I mean have abstract method in IgniteCustomType and realization like a
`public Expression cast() {
return Expressions.call(UuidFunctions.class, "cast",
Expressions.convert_(operand, Object.class));
`
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]