[
https://issues.apache.org/jira/browse/HIVEMALL-165?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16981435#comment-16981435
]
ASF GitHub Bot commented on HIVEMALL-165:
-----------------------------------------
myui commented on pull request #217: [HIVEMALL-165] Fixed to accept any
primitive
URL: https://github.com/apache/incubator-hivemall/pull/217
## What changes were proposed in this pull request?
Fix a bug that `array_remove` UDF throws exception when the first argument
is null
## What type of PR is it?
Bug Fix
## What is the Jira issue?
https://issues.apache.org/jira/browse/HIVEMALL-165
## How was this patch tested?
manual tests on EMR
## How to use this feature?
```sql
WITH data4 as (
select false as n, array('2.0', '3.0', '4.0') as nums
)
select
array_remove(if(n = true, null, nums), '2.0') as c1,
array_remove(if(n = true, null, nums), array('3.0','2.0')) as c2,
array_remove(if(n = false, null, nums), '2.0') as c3
from
data4;
WITH data4 as (
select false as n, array(2.0, 3.0, 4.0) as nums
)
select
array_remove(if(n = true, null, nums), 2.0) as c1,
array_remove(if(n = true, null, nums), array(3.0,2.0)) as c2,
array_remove(if(n = false, null, nums), 2.0) as c3
from
data4;
```
## Checklist
- [x] Did you apply source code formatter, i.e., `./bin/format_code.sh`, for
your commit?
- [ ] Did you run system tests on Hive (or Spark)?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> array_remove UDF throws exception when the first argument is null
> -----------------------------------------------------------------
>
> Key: HIVEMALL-165
> URL: https://issues.apache.org/jira/browse/HIVEMALL-165
> Project: Hivemall
> Issue Type: Bug
> Reporter: Makoto Yui
> Assignee: Makoto Yui
> Priority: Major
> Fix For: 0.6.0
>
>
> The following error caused where the first argument is null.
> {code}
> Caused by: org.apache.hadoop.hive.ql.metadata.HiveException: Unable to
> execute method public java.util.List
> hivemall.tools.array.ArrayRemoveUDF.evaluate(java.util.List,org.apache.hadoop.io.Text)
> on object hivemall.tools.array.ArrayRemoveUDF@54e2fe of class
> hivemall.tools.array.ArrayRemoveUDF with arguments {null,
> :org.apache.hadoop.io.Text} of size 2
> at
> org.apache.hadoop.hive.ql.exec.FunctionRegistry.invoke(FunctionRegistry.java:1251)
> at
> org.apache.hadoop.hive.ql.udf.generic.GenericUDFBridge.evaluate(GenericUDFBridge.java:182)
> at
> org.apache.hadoop.hive.ql.exec.ExprNodeGenericFuncEvaluator._evaluate(ExprNodeGenericFuncEvaluator.java:166)
> at
> org.apache.hadoop.hive.ql.exec.ExprNodeEvaluator.evaluate(ExprNodeEvaluator.java:77)
> at
> org.apache.hadoop.hive.ql.exec.ExprNodeGenericFuncEvaluator$DeferredExprObject.get(ExprNodeGenericFuncEvaluator.java:77)
> at
> org.apache.hadoop.hive.ql.udf.generic.GenericUDFBridge.evaluate(GenericUDFBridge.java:178)
> at
> org.apache.hadoop.hive.ql.exec.ExprNodeGenericFuncEvaluator._evaluate(ExprNodeGenericFuncEvaluator.java:166)
> at
> org.apache.hadoop.hive.ql.exec.ExprNodeEvaluator.evaluate(ExprNodeEvaluator.java:77)
> at
> org.apache.hadoop.hive.ql.exec.ExprNodeEvaluator.evaluate(ExprNodeEvaluator.java:65)
> at
> org.apache.hadoop.hive.ql.exec.SelectOperator.processOp(SelectOperator.java:79)
> at org.apache.hadoop.hive.ql.exec.Operator.forward(Operator.java:793)
> at
> org.apache.hadoop.hive.ql.exec.TableScanOperator.processOp(TableScanOperator.java:92)
> at org.apache.hadoop.hive.ql.exec.Operator.forward(Operator.java:793)
> at
> org.apache.hadoop.hive.ql.exec.MapOperator.process(MapOperator.java:539)
> ... 9 more
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)