[
https://issues.apache.org/jira/browse/DRILL-3232?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14981886#comment-14981886
]
ASF GitHub Bot commented on DRILL-3232:
---------------------------------------
Github user jacques-n commented on a diff in the pull request:
https://github.com/apache/drill/pull/207#discussion_r43471737
--- Diff:
exec/java-exec/src/main/java/org/apache/drill/exec/expr/ExpressionTreeMaterializer.java
---
@@ -308,10 +334,115 @@ public LogicalExpression
visitFunctionCall(FunctionCall call, FunctionLookupCont
return matchedNonDrillFuncHolder.getExpr(call.getName(),
extArgsWithCast, call.getPosition());
}
+ if (hasUnionInput(call)) {
+ return rewriteUnionFunction(call, functionLookupContext);
+ }
+
logFunctionResolutionError(errorCollector, call);
return NullExpression.INSTANCE;
}
+ private static final Set<String> UNION_FUNCTIONS;
+
+ static {
+ UNION_FUNCTIONS = new HashSet<>();
+ for (MinorType t : MinorType.values()) {
+ UNION_FUNCTIONS.add("assert_" + t.name().toLowerCase());
+ UNION_FUNCTIONS.add("is_" + t.name().toLowerCase());
+ }
+ UNION_FUNCTIONS.add("typeof");
+ }
+
+ private boolean hasUnionInput(FunctionCall call) {
+ for (LogicalExpression arg : call.args) {
+ if (arg.getMajorType().getMinorType() == MinorType.UNION) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private LogicalExpression rewriteUnionFunction(FunctionCall call,
FunctionLookupContext functionLookupContext) {
--- End diff --
javadoc please
> Modify existing vectors to allow type promotion
> -----------------------------------------------
>
> Key: DRILL-3232
> URL: https://issues.apache.org/jira/browse/DRILL-3232
> Project: Apache Drill
> Issue Type: Sub-task
> Components: Execution - Codegen, Execution - Data Types, Execution -
> Relational Operators, Functions - Drill
> Reporter: Steven Phillips
> Assignee: Hanifi Gunes
> Fix For: 1.3.0
>
>
> Support the ability for existing vectors to be promoted similar to supported
> implicit casting rules.
> For example:
> INT > DOUBLE > STRING > EMBEDDED
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)