[ 
https://issues.apache.org/jira/browse/ASTERIXDB-1901?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16007479#comment-16007479
 ] 

ASF subversion and git services commented on ASTERIXDB-1901:
------------------------------------------------------------

Commit bacf0c595eb0172522ce88a2600a6deaaafbc98b in asterixdb's branch 
refs/heads/master from [~idleft]
[ https://git-wip-us.apache.org/repos/asf?p=asterixdb.git;h=bacf0c5 ]

ASTERIXDB-1901 Fix IntroduceDynamicTypeCastForExternalFunctionRule

1. Instead of pattern matching, now we will inspect every paramter of
   UDF. If there is a type mismatch, a cast function will be added.
2. Fixed the issue that type casting only applies to the first argument.
3. Added test case for this.

Change-Id: I6f44b2460ae3322fc52451e7939b6b5e711790a7
Reviewed-on: https://asterix-gerrit.ics.uci.edu/1730
Reviewed-by: Yingyi Bu <[email protected]>
Sonar-Qube: Jenkins <[email protected]>
Tested-by: Jenkins <[email protected]>


> 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
> };
> /* This will fail */
> let $i:=testlib#toUpper({"id":1, "text":"lower text"})
> return $i
> /* This works */
> let $i:={"id":1, "text":"lower text"}
> return testlib#toUpper($i)
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to