hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From w...@apache.org
Subject hive git commit: HIVE-16810 : Fix an export/import bug due to ACID integration (Wei Zheng)
Date Thu, 01 Jun 2017 23:07:48 GMT
Repository: hive
Updated Branches:
  refs/heads/hive-14535 330215043 -> 76998b91a


HIVE-16810 : Fix an export/import bug due to ACID integration (Wei Zheng)


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/76998b91
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/76998b91
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/76998b91

Branch: refs/heads/hive-14535
Commit: 76998b91aa4795da4f96128e4b4fad4e83bac0e4
Parents: 3302150
Author: Wei Zheng <weiz@apache.org>
Authored: Thu Jun 1 16:07:34 2017 -0700
Committer: Wei Zheng <weiz@apache.org>
Committed: Thu Jun 1 16:07:34 2017 -0700

----------------------------------------------------------------------
 .../hive/ql/parse/ImportSemanticAnalyzer.java   |   6 ++
 ql/src/test/queries/clientpositive/mm_exim.q    |  22 ++--
 .../test/results/clientpositive/mm_exim.q.out   | 100 +++++++++++++++++++
 3 files changed, 117 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/76998b91/ql/src/java/org/apache/hadoop/hive/ql/parse/ImportSemanticAnalyzer.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/parse/ImportSemanticAnalyzer.java b/ql/src/java/org/apache/hadoop/hive/ql/parse/ImportSemanticAnalyzer.java
index a220d1a..ae52d15 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/parse/ImportSemanticAnalyzer.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/parse/ImportSemanticAnalyzer.java
@@ -844,6 +844,12 @@ public class ImportSemanticAnalyzer extends BaseSemanticAnalyzer {
           }
           FileSystem tgtFs = FileSystem.get(tablePath.toUri(), x.getConf());
           checkTargetLocationEmpty(tgtFs, tablePath, replicationSpec,x);
+          if (isSourceMm) { // since target table doesn't exist, it should inherit soruce
table's properties
+            Map<String, String> tblproperties = table.getParameters();
+            tblproperties.put("transactional", "true");
+            tblproperties.put("transactional_properties", "insert_only");
+            table.setParameters(tblproperties);
+          }
           t.addDependentTask(loadTable(fromURI, table, false, tablePath, replicationSpec,
x, txnId, stmtId, isSourceMm));
         }
       }

http://git-wip-us.apache.org/repos/asf/hive/blob/76998b91/ql/src/test/queries/clientpositive/mm_exim.q
----------------------------------------------------------------------
diff --git a/ql/src/test/queries/clientpositive/mm_exim.q b/ql/src/test/queries/clientpositive/mm_exim.q
index 2cdb001..8a03f4d 100644
--- a/ql/src/test/queries/clientpositive/mm_exim.q
+++ b/ql/src/test/queries/clientpositive/mm_exim.q
@@ -55,17 +55,17 @@ drop table import1_mm;
 
 -- MM export into new MM table, non-part and part
 
---drop table import2_mm;
---import table import2_mm from 'ql/test/data/exports/intermmediate_nonpart';
---desc import2_mm;
---select * from import2_mm order by key, p;
---drop table import2_mm;
---
---drop table import3_mm;
---import table import3_mm from 'ql/test/data/exports/intermmediate_part';
---desc import3_mm;
---select * from import3_mm order by key, p;
---drop table import3_mm;
+drop table import2_mm;
+import table import2_mm from 'ql/test/data/exports/intermmediate_nonpart';
+desc import2_mm;
+select * from import2_mm order by key, p;
+drop table import2_mm;
+
+drop table import3_mm;
+import table import3_mm from 'ql/test/data/exports/intermmediate_part';
+desc import3_mm;
+select * from import3_mm order by key, p;
+drop table import3_mm;
 
 -- MM export into existing MM table, non-part and partial part
 

http://git-wip-us.apache.org/repos/asf/hive/blob/76998b91/ql/src/test/results/clientpositive/mm_exim.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/mm_exim.q.out b/ql/src/test/results/clientpositive/mm_exim.q.out
index 6a6e549..910a46d 100644
--- a/ql/src/test/results/clientpositive/mm_exim.q.out
+++ b/ql/src/test/results/clientpositive/mm_exim.q.out
@@ -279,6 +279,106 @@ POSTHOOK: query: drop table import1_mm
 POSTHOOK: type: DROPTABLE
 POSTHOOK: Input: default@import1_mm
 POSTHOOK: Output: default@import1_mm
+PREHOOK: query: drop table import2_mm
+PREHOOK: type: DROPTABLE
+POSTHOOK: query: drop table import2_mm
+POSTHOOK: type: DROPTABLE
+PREHOOK: query: import table import2_mm from 'ql/test/data/exports/intermmediate_nonpart'
+PREHOOK: type: IMPORT
+#### A masked pattern was here ####
+PREHOOK: Output: database:default
+POSTHOOK: query: import table import2_mm from 'ql/test/data/exports/intermmediate_nonpart'
+POSTHOOK: type: IMPORT
+#### A masked pattern was here ####
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@import2_mm
+PREHOOK: query: desc import2_mm
+PREHOOK: type: DESCTABLE
+PREHOOK: Input: default@import2_mm
+POSTHOOK: query: desc import2_mm
+POSTHOOK: type: DESCTABLE
+POSTHOOK: Input: default@import2_mm
+key                 	int                 	                    
+p                   	int                 	                    
+PREHOOK: query: select * from import2_mm order by key, p
+PREHOOK: type: QUERY
+PREHOOK: Input: default@import2_mm
+#### A masked pattern was here ####
+POSTHOOK: query: select * from import2_mm order by key, p
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@import2_mm
+#### A masked pattern was here ####
+0	456
+10	456
+97	455
+98	455
+100	457
+103	457
+PREHOOK: query: drop table import2_mm
+PREHOOK: type: DROPTABLE
+PREHOOK: Input: default@import2_mm
+PREHOOK: Output: default@import2_mm
+POSTHOOK: query: drop table import2_mm
+POSTHOOK: type: DROPTABLE
+POSTHOOK: Input: default@import2_mm
+POSTHOOK: Output: default@import2_mm
+PREHOOK: query: drop table import3_mm
+PREHOOK: type: DROPTABLE
+POSTHOOK: query: drop table import3_mm
+POSTHOOK: type: DROPTABLE
+PREHOOK: query: import table import3_mm from 'ql/test/data/exports/intermmediate_part'
+PREHOOK: type: IMPORT
+#### A masked pattern was here ####
+PREHOOK: Output: database:default
+POSTHOOK: query: import table import3_mm from 'ql/test/data/exports/intermmediate_part'
+POSTHOOK: type: IMPORT
+#### A masked pattern was here ####
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@import3_mm
+POSTHOOK: Output: default@import3_mm@p=455
+POSTHOOK: Output: default@import3_mm@p=456
+POSTHOOK: Output: default@import3_mm@p=457
+PREHOOK: query: desc import3_mm
+PREHOOK: type: DESCTABLE
+PREHOOK: Input: default@import3_mm
+POSTHOOK: query: desc import3_mm
+POSTHOOK: type: DESCTABLE
+POSTHOOK: Input: default@import3_mm
+key                 	int                 	                    
+p                   	int                 	                    
+	 	 
+# Partition Information	 	 
+# col_name            	data_type           	comment             
+	 	 
+p                   	int                 	                    
+PREHOOK: query: select * from import3_mm order by key, p
+PREHOOK: type: QUERY
+PREHOOK: Input: default@import3_mm
+PREHOOK: Input: default@import3_mm@p=455
+PREHOOK: Input: default@import3_mm@p=456
+PREHOOK: Input: default@import3_mm@p=457
+#### A masked pattern was here ####
+POSTHOOK: query: select * from import3_mm order by key, p
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@import3_mm
+POSTHOOK: Input: default@import3_mm@p=455
+POSTHOOK: Input: default@import3_mm@p=456
+POSTHOOK: Input: default@import3_mm@p=457
+#### A masked pattern was here ####
+0	456
+10	456
+97	455
+98	455
+100	457
+103	457
+PREHOOK: query: drop table import3_mm
+PREHOOK: type: DROPTABLE
+PREHOOK: Input: default@import3_mm
+PREHOOK: Output: default@import3_mm
+POSTHOOK: query: drop table import3_mm
+POSTHOOK: type: DROPTABLE
+POSTHOOK: Input: default@import3_mm
+POSTHOOK: Output: default@import3_mm
 PREHOOK: query: drop table import4_mm
 PREHOOK: type: DROPTABLE
 POSTHOOK: query: drop table import4_mm


Mime
View raw message