[
https://issues.apache.org/jira/browse/ASTERIXDB-1901?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15999597#comment-15999597
]
Xikui Wang commented on ASTERIXDB-1901:
---------------------------------------
[~buyingyi] Hi Yingyi, I located where the problem is, but the fix is not quite
clear to me. Could you give me some suggestions?
The exception happens because the constant record {"id":1, "text":"lower text"}
has a closed datatype which causes the record type inconsistency in setting the
parameter value (an open datatype is expected here). The
IntroduceDynamicTypeCastForExternalFunctionRule finds possible type casting
when the parameter is a variable. In this constant parameter case, parameter is
a field of the function call, but not the parent... Thus I couldn't follow the
existed method to handle this situation. Probably this should be handled in
ConstantFoldingRule?
> UDF fails at constant parameter
> -------------------------------
>
> Key: ASTERIXDB-1901
> URL: https://issues.apache.org/jira/browse/ASTERIXDB-1901
> Project: Apache AsterixDB
> Issue Type: Bug
> Reporter: Xikui Wang
> Assignee: Xikui Wang
>
> If the declared datatype for UDF input is a open type, UDF will fail when
> given constant record (which has a closed datatype implicitly)
> Execute following query with default lib installed can reproduce this issue:
> {noformat}
> drop dataverse externallibtest if exists;
> create dataverse externallibtest;
> use dataverse externallibtest;
> create type TextType if not exists as open {
> id: int32,
> text: string
> };
> testlib#toUpper({"id":1, "text":"lower text"})
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)