Hello Anon. E. Moose (1000171), Jenkins, I'd like you to reexamine a change. Please visit
https://asterix-gerrit.ics.uci.edu/3406 to look at the new patch set (#2). Change subject: [ASTERIXDB-2458][COMP] Fix InjectTypeCastForFunctionArgumentsRule ...................................................................... [ASTERIXDB-2458][COMP] Fix InjectTypeCastForFunctionArgumentsRule - user model changes: no - storage format changes: no - interface changes: no Details: InjectTypeCastForFunctionArgumentsRule is for functions that can potentially return any of their arguments. switch and if_null(expr1, expr2, ...) are examples. All the arguments need to be casted (opened) to the type that the function will return which is the generalized type of all arguments. Some functions like if_null can determine the exact expression they will return, e.g. if_null(1, {"id": 3}) in which case the return type is always integer. The rule tries to cast th 2nd argument, the record, to integer and fails. In such cases, these functions do not need to cast their arguments. If the function determines its output type to be ANY, then all arguments need to be casted (opened). If the function determines its output to be a dervied type, then casting is also needed since that output type should be the generalized type of all arguments. Change-Id: I2fee234d883b59319e4ec4df58d61ecd498373fd --- M asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/InjectTypeCastForFunctionArgumentsRule.java A asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/misc/cast-ASTERIXDB-2458/cast-ASTERIXDB-2458.1.query.sqlpp A asterixdb/asterix-app/src/test/resources/runtimets/results/misc/cast-ASTERIXDB-2458/cast-ASTERIXDB-2458.1.adm M asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml M asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/common/TypeResolverUtil.java 5 files changed, 71 insertions(+), 22 deletions(-) git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb refs/changes/06/3406/2 -- To view, visit https://asterix-gerrit.ics.uci.edu/3406 To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings Gerrit-Project: asterixdb Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I2fee234d883b59319e4ec4df58d61ecd498373fd Gerrit-Change-Number: 3406 Gerrit-PatchSet: 2 Gerrit-Owner: Ali Alsuliman <ali.al.solai...@gmail.com> Gerrit-Reviewer: Anon. E. Moose (1000171) Gerrit-Reviewer: Jenkins <jenk...@fulliautomatix.ics.uci.edu>