You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "xiaolo (JIRA)" <ji...@apache.org> on 2018/02/26 06:08:00 UTC
[jira] [Comment Edited] (HIVE-18801) MERGE INTO SQL not work fully
[ https://issues.apache.org/jira/browse/HIVE-18801?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16376425#comment-16376425 ]
xiaolo edited comment on HIVE-18801 at 2/26/18 6:07 AM:
--------------------------------------------------------
It is on Spark..
But i tested on MapReduce, if *transactions* table * *is not *PARTITIONED,* sql3 will return error like this (sql1 sql2 work success):
{quote}{{ERROR [main] mr.MapredLocalTask: Hive Runtime Error: Map local work failed java.lang.NullPointerException at org.apache.hadoop.hive.ql.exec.ExprNodeColumnEvaluator.initialize(ExprNodeColumnEvaluator.java:57) ~[hive-exec-2.3.2.jar:2.3.2] at org.apache.hadoop.hive.ql.exec.JoinUtil.getObjectInspectorsFromEvaluators(JoinUtil.java:91) ~[hive-exec-2.3.2.jar:2.3.2] at org.apache.hadoop.hive.ql.exec.HashTableSinkOperator.initializeOp(HashTableSinkOperator.java:153) ~[hive-exec-2.3.2.jar:2.3.2] at org.apache.hadoop.hive.ql.exec.Operator.initialize(Operator.java:366) ~[hive-exec-2.3.2.jar:2.3.2] at org.apache.hadoop.hive.ql.exec.Operator.initialize(Operator.java:556) ~[hive-exec-2.3.2.jar:2.3.2] at org.apache.hadoop.hive.ql.exec.Operator.initializeChildren(Operator.java:508) ~[hive-exec-2.3.2.jar:2.3.2] at org.apache.hadoop.hive.ql.exec.Operator.initialize(Operator.java:376) ~[hive-exec-2.3.2.jar:2.3.2] at org.apache.hadoop.hive.ql.exec.mr.MapredLocalTask.initializeOperators(MapredLocalTask.java:508) ~[hive-exec-2.3.2.jar:2.3.2] at org.apache.hadoop.hive.ql.exec.mr.MapredLocalTask.startForward(MapredLocalTask.java:411) ~[hive-exec-2.3.2.jar:2.3.2] at org.apache.hadoop.hive.ql.exec.mr.MapredLocalTask.executeInProcess(MapredLocalTask.java:391) ~[hive-exec-2.3.2.jar:2.3.2] at org.apache.hadoop.hive.ql.exec.mr.ExecDriver.main(ExecDriver.java:764) ~[hive-exec-2.3.2.jar:2.3.2] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_91] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_91] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_91] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_91] at org.apache.hadoop.util.RunJar.run(RunJar.java:221) ~[hadoop-common-2.7.4.jar:?] at org.apache.hadoop.util.RunJar.main(RunJar.java:136) ~[hadoop-common-2.7.4.jar:?]}}
{quote}
was (Author: lxlqwo):
It is on Spark..
But i tested on MapReduce, if *transactions* table ** is not *PARTITIONED,* sql3 will return error like this:
{quote}{{ERROR [main] mr.MapredLocalTask: Hive Runtime Error: Map local work failed java.lang.NullPointerException at org.apache.hadoop.hive.ql.exec.ExprNodeColumnEvaluator.initialize(ExprNodeColumnEvaluator.java:57) ~[hive-exec-2.3.2.jar:2.3.2] at org.apache.hadoop.hive.ql.exec.JoinUtil.getObjectInspectorsFromEvaluators(JoinUtil.java:91) ~[hive-exec-2.3.2.jar:2.3.2] at org.apache.hadoop.hive.ql.exec.HashTableSinkOperator.initializeOp(HashTableSinkOperator.java:153) ~[hive-exec-2.3.2.jar:2.3.2] at org.apache.hadoop.hive.ql.exec.Operator.initialize(Operator.java:366) ~[hive-exec-2.3.2.jar:2.3.2] at org.apache.hadoop.hive.ql.exec.Operator.initialize(Operator.java:556) ~[hive-exec-2.3.2.jar:2.3.2] at org.apache.hadoop.hive.ql.exec.Operator.initializeChildren(Operator.java:508) ~[hive-exec-2.3.2.jar:2.3.2] at org.apache.hadoop.hive.ql.exec.Operator.initialize(Operator.java:376) ~[hive-exec-2.3.2.jar:2.3.2] at org.apache.hadoop.hive.ql.exec.mr.MapredLocalTask.initializeOperators(MapredLocalTask.java:508) ~[hive-exec-2.3.2.jar:2.3.2] at org.apache.hadoop.hive.ql.exec.mr.MapredLocalTask.startForward(MapredLocalTask.java:411) ~[hive-exec-2.3.2.jar:2.3.2] at org.apache.hadoop.hive.ql.exec.mr.MapredLocalTask.executeInProcess(MapredLocalTask.java:391) ~[hive-exec-2.3.2.jar:2.3.2] at org.apache.hadoop.hive.ql.exec.mr.ExecDriver.main(ExecDriver.java:764) ~[hive-exec-2.3.2.jar:2.3.2] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_91] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_91] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_91] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_91] at org.apache.hadoop.util.RunJar.run(RunJar.java:221) ~[hadoop-common-2.7.4.jar:?] at org.apache.hadoop.util.RunJar.main(RunJar.java:136) ~[hadoop-common-2.7.4.jar:?]}}
{quote}
> MERGE INTO SQL not work fully
> -----------------------------
>
> Key: HIVE-18801
> URL: https://issues.apache.org/jira/browse/HIVE-18801
> Project: Hive
> Issue Type: Bug
> Components: Clients
> Affects Versions: 2.3.2
> Environment: CREATE TABLE transactions(
> id int,
> name string
> )
> PARTITIONED BY (partition_date string)
> CLUSTERED BY (ID) into 5 buckets
> STORED AS ORC TBLPROPERTIES ('transactional'='true');
> CREATE TABLE merge_source(
> id int,
> name string);
> Reporter: xiaolo
> Priority: Major
>
> *Here is three sql:*
> *1:*
> *MERGE INTO transactions AS T*
> *USING merge_source AS S*
> *ON T.id = S.id*
> *WHEN MATCHED THEN UPDATE SET name='update' ;*
> *2:***
> *MERGE INTO transactions AS T*
> *USING merge_source AS S*
> *ON T.id = S.id*
> *WHEN NOT MATCHED THEN INSERT VALUES (S.ID, S.NAME,'321');*
> *3:***
> *MERGE INTO transactions AS T*
> *USING merge_source AS S*
> *ON T.id = S.id*
> *WHEN MATCHED THEN UPDATE SET name='update'*
> *WHEN NOT MATCHED THEN INSERT VALUES (S.ID, S.NAME,'321');*
>
> *There is no error log , just the table rows is not expected when i run sql3 , it looks like nothing changed.*
> *finally*
> *I need use sql1 and sql2 to replace sql3 , and to make sure the table rows is* *expected .***
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)