You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
KSQL has rules for what types can be implicitly converted to a wider type, e.g INT can be implicitly converted to BIGINT. These rules are encapsulated in SqlBaseType.canImplicitlyCast and used by DefaultSqlValueCoercer.
Rules are that the following implicit casts are possible:
INT -> BIGINT -> DECIMAL -> DOUBLE.
(Yes, the DECIMAL -> DOUBLE is potentially lossy, but that's outside the scope of this issue).
The function framework does not support implicitly casting a parameter to a wider type. For example, the exp function can take a DOUBLE but there is not a variant that takes a DECIMAL. At the moment is you try and call exp with a DECIMAL it fails with an error. What is should do is use the implicit casting rules to widen the DECIMAL to a DOUBLE and call the double version.
Note: it looks like at some point that GenericRowValueTypeEnforcer might have done this conversion, though it doesn't enforce the same rules on what can be implicitly cast. Also, I'm about to remove it.
The text was updated successfully, but these errors were encountered:
This change sees `GenericRowValueTypeEnforcer` removed from the code base.
It's being removed as the functionality it provides is:
1. Not needed in the production code path as values are always of the right type.
1. Only needed for a few tests to pass, (which have been fixed up).
1. It supports coercing between types which are outside of KSQLs implicit casting rules, e.g. coerce String -> BIGINT.
We should support implicitly casting parameters to functions to wider types,
as defined by KSQLs implicit casting rules. However, this is not currently the
case. See confluentinc#3791.
This change sees `GenericRowValueTypeEnforcer` removed from the code base.
It's being removed as the functionality it provides is:
1. Not needed in the production code path as values are always of the right type.
1. Only needed for a few tests to pass, (which have been fixed up).
1. It supports coercing between types which are outside of KSQLs implicit casting rules, e.g. coerce String -> BIGINT.
We should support implicitly casting parameters to functions to wider types,
as defined by KSQLs implicit casting rules. However, this is not currently the
case. See #3791.
KSQL has rules for what types can be implicitly converted to a wider type, e.g
INT
can be implicitly converted toBIGINT
. These rules are encapsulated inSqlBaseType.canImplicitlyCast
and used byDefaultSqlValueCoercer
.Rules are that the following implicit casts are possible:
INT
->BIGINT
->DECIMAL
->DOUBLE
.(Yes, the
DECIMAL
->DOUBLE
is potentially lossy, but that's outside the scope of this issue).The function framework does not support implicitly casting a parameter to a wider type. For example, the
exp
function can take aDOUBLE
but there is not a variant that takes aDECIMAL
. At the moment is you try and call exp with aDECIMAL
it fails with an error. What is should do is use the implicit casting rules to widen theDECIMAL
to aDOUBLE
and call the double version.Note: it looks like at some point that
GenericRowValueTypeEnforcer
might have done this conversion, though it doesn't enforce the same rules on what can be implicitly cast. Also, I'm about to remove it.The text was updated successfully, but these errors were encountered: