From commits-return-31623-archive-asf-public=cust-asf.ponee.io@hive.apache.org Mon Feb 12 19:42:13 2018 Return-Path: X-Original-To: archive-asf-public@eu.ponee.io Delivered-To: archive-asf-public@eu.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by mx-eu-01.ponee.io (Postfix) with ESMTP id 28701180652 for ; Mon, 12 Feb 2018 19:42:13 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 188A0160C63; Mon, 12 Feb 2018 18:42:13 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 371A9160C30 for ; Mon, 12 Feb 2018 19:42:12 +0100 (CET) Received: (qmail 97621 invoked by uid 500); 12 Feb 2018 18:42:11 -0000 Mailing-List: contact commits-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hive-dev@hive.apache.org Delivered-To: mailing list commits@hive.apache.org Received: (qmail 97600 invoked by uid 99); 12 Feb 2018 18:42:11 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Feb 2018 18:42:11 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 3A6CFE178C; Mon, 12 Feb 2018 18:42:11 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: gates@apache.org To: commits@hive.apache.org Date: Mon, 12 Feb 2018 18:42:12 -0000 Message-Id: In-Reply-To: <916f99b7fcca4119828cdffc86687f7a@git.apache.org> References: <916f99b7fcca4119828cdffc86687f7a@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [02/50] [abbrv] hive git commit: HIVE-18607 : HBase HFile write does strange things (Sergey Shelukhin, reviewed by Ashutosh Chauhan) HIVE-18607 : HBase HFile write does strange things (Sergey Shelukhin, reviewed by Ashutosh Chauhan) Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/717ef18d Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/717ef18d Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/717ef18d Branch: refs/heads/standalone-metastore Commit: 717ef18d96bd86cbe4448350c22c3766cd90e184 Parents: 58bbfc7 Author: sergey Authored: Fri Feb 9 14:31:26 2018 -0800 Committer: sergey Committed: Fri Feb 9 14:37:03 2018 -0800 ---------------------------------------------------------------------- .../hive/hbase/HiveHFileOutputFormat.java | 4 -- .../test/queries/positive/hbase_handler_bulk.q | 21 ++++++++++ .../results/positive/hbase_handler_bulk.q.out | 40 ++++++++++++++++++++ 3 files changed, 61 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hive/blob/717ef18d/hbase-handler/src/java/org/apache/hadoop/hive/hbase/HiveHFileOutputFormat.java ---------------------------------------------------------------------- diff --git a/hbase-handler/src/java/org/apache/hadoop/hive/hbase/HiveHFileOutputFormat.java b/hbase-handler/src/java/org/apache/hadoop/hive/hbase/HiveHFileOutputFormat.java index 81318be..d8dad06 100644 --- a/hbase-handler/src/java/org/apache/hadoop/hive/hbase/HiveHFileOutputFormat.java +++ b/hbase-handler/src/java/org/apache/hadoop/hive/hbase/HiveHFileOutputFormat.java @@ -176,10 +176,6 @@ public class HiveHFileOutputFormat extends columnFamilyPath, regionFile.getPath().getName())); } - // Hive actually wants a file as task output (not a directory), so - // replace the empty directory with an empty file to keep it happy. - fs.delete(taskAttemptOutputdir, true); - fs.createNewFile(taskAttemptOutputdir); } catch (InterruptedException ex) { throw new IOException(ex); } http://git-wip-us.apache.org/repos/asf/hive/blob/717ef18d/hbase-handler/src/test/queries/positive/hbase_handler_bulk.q ---------------------------------------------------------------------- diff --git a/hbase-handler/src/test/queries/positive/hbase_handler_bulk.q b/hbase-handler/src/test/queries/positive/hbase_handler_bulk.q index ac2fdfa..5ac4dc8 100644 --- a/hbase-handler/src/test/queries/positive/hbase_handler_bulk.q +++ b/hbase-handler/src/test/queries/positive/hbase_handler_bulk.q @@ -14,6 +14,7 @@ set mapreduce.input.fileinputformat.split.maxsize=200; set mapreduce.input.fileinputformat.split.minsize=200; set mapred.reduce.tasks=2; + -- this should produce three files in /tmp/hb_target/cf insert overwrite table hb_target select distinct key, value from src cluster by key; @@ -24,3 +25,23 @@ insert overwrite table hb_target select distinct key, value from src cluster by drop table hb_target; dfs -rmr /tmp/hb_target/cf; + + +create table hb_target(key int, val string) +stored by 'org.apache.hadoop.hive.hbase.HBaseStorageHandler' +with serdeproperties ('hbase.columns.mapping' = ':key,cf:val') +tblproperties ('hbase.mapreduce.hfileoutputformat.table.name' = 'positive_hbase_handler_bulk'); + +-- do it twice - regression test for HIVE-18607 + +insert overwrite table hb_target select distinct key, value from src cluster by key; + +dfs -rmr /tmp/hb_target/cf; + +insert overwrite table hb_target select distinct key, value from src cluster by key; + +drop table hb_target; +dfs -rmr /tmp/hb_target/cf; + + + http://git-wip-us.apache.org/repos/asf/hive/blob/717ef18d/hbase-handler/src/test/results/positive/hbase_handler_bulk.q.out ---------------------------------------------------------------------- diff --git a/hbase-handler/src/test/results/positive/hbase_handler_bulk.q.out b/hbase-handler/src/test/results/positive/hbase_handler_bulk.q.out index 10e1c0a..cd8930f 100644 --- a/hbase-handler/src/test/results/positive/hbase_handler_bulk.q.out +++ b/hbase-handler/src/test/results/positive/hbase_handler_bulk.q.out @@ -33,3 +33,43 @@ POSTHOOK: type: DROPTABLE POSTHOOK: Input: default@hb_target POSTHOOK: Output: default@hb_target #### A masked pattern was here #### +PREHOOK: query: create table hb_target(key int, val string) +stored by 'org.apache.hadoop.hive.hbase.HBaseStorageHandler' +with serdeproperties ('hbase.columns.mapping' = ':key,cf:val') +tblproperties ('hbase.mapreduce.hfileoutputformat.table.name' = 'positive_hbase_handler_bulk') +PREHOOK: type: CREATETABLE +PREHOOK: Output: database:default +PREHOOK: Output: default@hb_target +POSTHOOK: query: create table hb_target(key int, val string) +stored by 'org.apache.hadoop.hive.hbase.HBaseStorageHandler' +with serdeproperties ('hbase.columns.mapping' = ':key,cf:val') +tblproperties ('hbase.mapreduce.hfileoutputformat.table.name' = 'positive_hbase_handler_bulk') +POSTHOOK: type: CREATETABLE +POSTHOOK: Output: database:default +POSTHOOK: Output: default@hb_target +PREHOOK: query: insert overwrite table hb_target select distinct key, value from src cluster by key +PREHOOK: type: QUERY +PREHOOK: Input: default@src +PREHOOK: Output: default@hb_target +POSTHOOK: query: insert overwrite table hb_target select distinct key, value from src cluster by key +POSTHOOK: type: QUERY +POSTHOOK: Input: default@src +POSTHOOK: Output: default@hb_target +#### A masked pattern was here #### +PREHOOK: query: insert overwrite table hb_target select distinct key, value from src cluster by key +PREHOOK: type: QUERY +PREHOOK: Input: default@src +PREHOOK: Output: default@hb_target +POSTHOOK: query: insert overwrite table hb_target select distinct key, value from src cluster by key +POSTHOOK: type: QUERY +POSTHOOK: Input: default@src +POSTHOOK: Output: default@hb_target +PREHOOK: query: drop table hb_target +PREHOOK: type: DROPTABLE +PREHOOK: Input: default@hb_target +PREHOOK: Output: default@hb_target +POSTHOOK: query: drop table hb_target +POSTHOOK: type: DROPTABLE +POSTHOOK: Input: default@hb_target +POSTHOOK: Output: default@hb_target +#### A masked pattern was here ####