You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by br...@apache.org on 2015/01/09 06:02:15 UTC

svn commit: r1650440 - in /hive/branches/HIVE-8065: itests/util/src/main/java/org/apache/hadoop/hive/ql/ ql/src/test/queries/clientpositive/ ql/src/test/results/clientpositive/encrypted/

Author: brock
Date: Fri Jan  9 05:02:14 2015
New Revision: 1650440

URL: http://svn.apache.org/r1650440
Log:
HIVE-9307 - Use metastore warehouse dir variable from conf instead of hard coded dir in encryption test (Dong Chen via Brock)

Modified:
    hive/branches/HIVE-8065/itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java
    hive/branches/HIVE-8065/ql/src/test/queries/clientpositive/encryption_insert_partition_dynamic.q
    hive/branches/HIVE-8065/ql/src/test/queries/clientpositive/encryption_insert_partition_static.q
    hive/branches/HIVE-8065/ql/src/test/queries/clientpositive/encryption_join_unencrypted_tbl.q
    hive/branches/HIVE-8065/ql/src/test/queries/clientpositive/encryption_join_with_different_encryption_keys.q
    hive/branches/HIVE-8065/ql/src/test/queries/clientpositive/encryption_load_data_to_encrypted_tables.q
    hive/branches/HIVE-8065/ql/src/test/queries/clientpositive/encryption_select_read_only_encrypted_tbl.q
    hive/branches/HIVE-8065/ql/src/test/queries/clientpositive/encryption_select_read_only_unencrypted_tbl.q
    hive/branches/HIVE-8065/ql/src/test/results/clientpositive/encrypted/encryption_insert_partition_dynamic.q.out
    hive/branches/HIVE-8065/ql/src/test/results/clientpositive/encrypted/encryption_insert_partition_static.q.out

Modified: hive/branches/HIVE-8065/itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-8065/itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java?rev=1650440&r1=1650439&r2=1650440&view=diff
==============================================================================
--- hive/branches/HIVE-8065/itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java (original)
+++ hive/branches/HIVE-8065/itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java Fri Jan  9 05:02:14 2015
@@ -949,6 +949,13 @@ public class QTestUtil {
       commandArgs = StringUtils.chop(commandArgs);
     }
 
+    //replace ${hiveconf:hive.metastore.warehouse.dir} with actual dir if existed.
+    //we only want the absolute path, so remove the header, such as hdfs://localhost:57145
+    String wareHouseDir = SessionState.get().getConf().getVar(ConfVars.METASTOREWAREHOUSE)
+        .replaceAll("^[a-zA-Z]+://.*?:\\d+", "");
+    commandArgs = commandArgs.replaceAll("\\$\\{hiveconf:hive\\.metastore\\.warehouse\\.dir\\}",
+        wareHouseDir);
+
     try {
       CommandProcessor proc = getTestCommand(commandName);
       if (proc != null) {

Modified: hive/branches/HIVE-8065/ql/src/test/queries/clientpositive/encryption_insert_partition_dynamic.q
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-8065/ql/src/test/queries/clientpositive/encryption_insert_partition_dynamic.q?rev=1650440&r1=1650439&r2=1650440&view=diff
==============================================================================
--- hive/branches/HIVE-8065/ql/src/test/queries/clientpositive/encryption_insert_partition_dynamic.q (original)
+++ hive/branches/HIVE-8065/ql/src/test/queries/clientpositive/encryption_insert_partition_dynamic.q Fri Jan  9 05:02:14 2015
@@ -11,9 +11,9 @@ drop table IF EXISTS unencryptedTable;
 
 create table encryptedTable(value string)
     partitioned by (key string) clustered by (value) into 2 buckets stored as orc
-    location '/build/ql/test/data/warehouse/encryptedTable' TBLPROPERTIES ('transactional'='true');
+    LOCATION '${hiveconf:hive.metastore.warehouse.dir}/encryptedTable' TBLPROPERTIES ('transactional'='true');
 CRYPTO CREATE_KEY --keyName key_1 --bitLength 128;
-CRYPTO CREATE_ZONE --keyName key_1 --path /build/ql/test/data/warehouse/encryptedTable;
+CRYPTO CREATE_ZONE --keyName key_1 --path ${hiveconf:hive.metastore.warehouse.dir}/encryptedTable;
 
 create table unencryptedTable(value string)
     partitioned by (key string) clustered by (value) into 2 buckets stored as orc TBLPROPERTIES ('transactional'='true');

Modified: hive/branches/HIVE-8065/ql/src/test/queries/clientpositive/encryption_insert_partition_static.q
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-8065/ql/src/test/queries/clientpositive/encryption_insert_partition_static.q?rev=1650440&r1=1650439&r2=1650440&view=diff
==============================================================================
--- hive/branches/HIVE-8065/ql/src/test/queries/clientpositive/encryption_insert_partition_static.q (original)
+++ hive/branches/HIVE-8065/ql/src/test/queries/clientpositive/encryption_insert_partition_static.q Fri Jan  9 05:02:14 2015
@@ -10,9 +10,9 @@ drop table IF EXISTS unencryptedTable;
 
 create table encryptedTable(key string,
     value string) partitioned by (ds string) clustered by (key) into 2 buckets stored as orc
-    location '/build/ql/test/data/warehouse/encryptedTable' TBLPROPERTIES ('transactional'='true');
+    LOCATION '${hiveconf:hive.metastore.warehouse.dir}/encryptedTable' TBLPROPERTIES ('transactional'='true');
 CRYPTO CREATE_KEY --keyName key_1 --bitLength 128;
-CRYPTO CREATE_ZONE --keyName key_1 --path /build/ql/test/data/warehouse/encryptedTable;
+CRYPTO CREATE_ZONE --keyName key_1 --path ${hiveconf:hive.metastore.warehouse.dir}/encryptedTable;
 
 create table unencryptedTable(key string,
     value string) partitioned by (ds string) clustered by (key) into 2 buckets stored as orc TBLPROPERTIES ('transactional'='true');

Modified: hive/branches/HIVE-8065/ql/src/test/queries/clientpositive/encryption_join_unencrypted_tbl.q
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-8065/ql/src/test/queries/clientpositive/encryption_join_unencrypted_tbl.q?rev=1650440&r1=1650439&r2=1650440&view=diff
==============================================================================
--- hive/branches/HIVE-8065/ql/src/test/queries/clientpositive/encryption_join_unencrypted_tbl.q (original)
+++ hive/branches/HIVE-8065/ql/src/test/queries/clientpositive/encryption_join_unencrypted_tbl.q Fri Jan  9 05:02:14 2015
@@ -1,9 +1,9 @@
 --SORT_QUERY_RESULTS
 
 DROP TABLE IF EXISTS encrypted_table;
-CREATE TABLE encrypted_table (key INT, value STRING) LOCATION '/build/ql/test/data/warehouse/default/encrypted_table';
+CREATE TABLE encrypted_table (key INT, value STRING) LOCATION '${hiveconf:hive.metastore.warehouse.dir}/default/encrypted_table';
 CRYPTO CREATE_KEY --keyName key_128 --bitLength 128;
-CRYPTO CREATE_ZONE --keyName key_128 --path /build/ql/test/data/warehouse/default/encrypted_table;
+CRYPTO CREATE_ZONE --keyName key_128 --path ${hiveconf:hive.metastore.warehouse.dir}/default/encrypted_table;
 
 INSERT OVERWRITE TABLE encrypted_table SELECT * FROM src;
 

Modified: hive/branches/HIVE-8065/ql/src/test/queries/clientpositive/encryption_join_with_different_encryption_keys.q
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-8065/ql/src/test/queries/clientpositive/encryption_join_with_different_encryption_keys.q?rev=1650440&r1=1650439&r2=1650440&view=diff
==============================================================================
--- hive/branches/HIVE-8065/ql/src/test/queries/clientpositive/encryption_join_with_different_encryption_keys.q (original)
+++ hive/branches/HIVE-8065/ql/src/test/queries/clientpositive/encryption_join_with_different_encryption_keys.q Fri Jan  9 05:02:14 2015
@@ -2,14 +2,14 @@
 
 -- Java JCE must be installed in order to hava a key length of 256 bits
 DROP TABLE IF EXISTS table_key_1;
-CREATE TABLE table_key_1 (key INT, value STRING) LOCATION '/build/ql/test/data/warehouse/table_key_1';
+CREATE TABLE table_key_1 (key INT, value STRING) LOCATION '${hiveconf:hive.metastore.warehouse.dir}/table_key_1';
 CRYPTO CREATE_KEY --keyName key_1 --bitLength 128;
-CRYPTO CREATE_ZONE --keyName key_1 --path /build/ql/test/data/warehouse/table_key_1;
+CRYPTO CREATE_ZONE --keyName key_1 --path ${hiveconf:hive.metastore.warehouse.dir}/table_key_1;
 
 DROP TABLE IF EXISTS table_key_2;
-CREATE TABLE table_key_2 (key INT, value STRING) LOCATION '/build/ql/test/data/warehouse/table_key_2';
+CREATE TABLE table_key_2 (key INT, value STRING) LOCATION '${hiveconf:hive.metastore.warehouse.dir}/table_key_2';
 CRYPTO CREATE_KEY --keyName key_2 --bitLength 256;
-CRYPTO CREATE_ZONE --keyName key_2 --path /build/ql/test/data/warehouse/table_key_2;
+CRYPTO CREATE_ZONE --keyName key_2 --path ${hiveconf:hive.metastore.warehouse.dir}/table_key_2;
 
 INSERT OVERWRITE TABLE table_key_1 SELECT * FROM src;
 INSERT OVERWRITE TABLE table_key_2 SELECT * FROM src;

Modified: hive/branches/HIVE-8065/ql/src/test/queries/clientpositive/encryption_load_data_to_encrypted_tables.q
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-8065/ql/src/test/queries/clientpositive/encryption_load_data_to_encrypted_tables.q?rev=1650440&r1=1650439&r2=1650440&view=diff
==============================================================================
--- hive/branches/HIVE-8065/ql/src/test/queries/clientpositive/encryption_load_data_to_encrypted_tables.q (original)
+++ hive/branches/HIVE-8065/ql/src/test/queries/clientpositive/encryption_load_data_to_encrypted_tables.q Fri Jan  9 05:02:14 2015
@@ -1,9 +1,9 @@
 DROP TABLE IF EXISTS encrypted_table;
 
-CREATE TABLE encrypted_table (key STRING, value STRING) LOCATION '/build/ql/test/data/warehouse/encrypted_table';
+CREATE TABLE encrypted_table (key STRING, value STRING) LOCATION '${hiveconf:hive.metastore.warehouse.dir}/encrypted_table';
 
 crypto create_key --keyName key1;
-crypto create_zone --keyName key1 --path /build/ql/test/data/warehouse/encrypted_table;
+crypto create_zone --keyName key1 --path ${hiveconf:hive.metastore.warehouse.dir}/encrypted_table;
 
 -- Test loading data from the local filesystem;
 LOAD DATA LOCAL INPATH '../../data/files/kv1.txt' OVERWRITE INTO TABLE encrypted_table;

Modified: hive/branches/HIVE-8065/ql/src/test/queries/clientpositive/encryption_select_read_only_encrypted_tbl.q
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-8065/ql/src/test/queries/clientpositive/encryption_select_read_only_encrypted_tbl.q?rev=1650440&r1=1650439&r2=1650440&view=diff
==============================================================================
--- hive/branches/HIVE-8065/ql/src/test/queries/clientpositive/encryption_select_read_only_encrypted_tbl.q (original)
+++ hive/branches/HIVE-8065/ql/src/test/queries/clientpositive/encryption_select_read_only_encrypted_tbl.q Fri Jan  9 05:02:14 2015
@@ -1,14 +1,14 @@
 -- SORT_QUERY_RESULTS
 
 DROP TABLE IF EXISTS encrypted_table;
-CREATE TABLE encrypted_table (key INT, value STRING) LOCATION '/build/ql/test/data/warehouse/default/encrypted_table';
+CREATE TABLE encrypted_table (key INT, value STRING) LOCATION '${hiveconf:hive.metastore.warehouse.dir}/default/encrypted_table';
 
 CRYPTO CREATE_KEY --keyName key_128 --bitLength 128;
-CRYPTO CREATE_ZONE --keyName key_128 --path /build/ql/test/data/warehouse/default/encrypted_table;
+CRYPTO CREATE_ZONE --keyName key_128 --path ${hiveconf:hive.metastore.warehouse.dir}/default/encrypted_table;
 
 LOAD DATA LOCAL INPATH '../../data/files/kv1.txt' INTO TABLE encrypted_table;
 
-dfs -chmod -R 555 /build/ql/test/data/warehouse/default/encrypted_table;
+dfs -chmod -R 555 ${hiveconf:hive.metastore.warehouse.dir}/default/encrypted_table;
 
 SELECT count(*) FROM encrypted_table;
 

Modified: hive/branches/HIVE-8065/ql/src/test/queries/clientpositive/encryption_select_read_only_unencrypted_tbl.q
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-8065/ql/src/test/queries/clientpositive/encryption_select_read_only_unencrypted_tbl.q?rev=1650440&r1=1650439&r2=1650440&view=diff
==============================================================================
--- hive/branches/HIVE-8065/ql/src/test/queries/clientpositive/encryption_select_read_only_unencrypted_tbl.q (original)
+++ hive/branches/HIVE-8065/ql/src/test/queries/clientpositive/encryption_select_read_only_unencrypted_tbl.q Fri Jan  9 05:02:14 2015
@@ -1,11 +1,11 @@
 -- SORT_QUERY_RESULTS
 
 DROP TABLE IF EXISTS unencrypted_table;
-CREATE TABLE unencrypted_table(key INT, value STRING) LOCATION '/build/ql/test/data/warehouse/default/unencrypted_table';
+CREATE TABLE unencrypted_table(key INT, value STRING) LOCATION '${hiveconf:hive.metastore.warehouse.dir}/default/unencrypted_table';
 
 LOAD DATA LOCAL INPATH '../../data/files/kv1.txt' INTO TABLE unencrypted_table;
 
-dfs -chmod -R 555 /build/ql/test/data/warehouse/default/unencrypted_table;
+dfs -chmod -R 555 ${hiveconf:hive.metastore.warehouse.dir}/default/unencrypted_table;
 
 SELECT count(*) FROM unencrypted_table;
 

Modified: hive/branches/HIVE-8065/ql/src/test/results/clientpositive/encrypted/encryption_insert_partition_dynamic.q.out
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-8065/ql/src/test/results/clientpositive/encrypted/encryption_insert_partition_dynamic.q.out?rev=1650440&r1=1650439&r2=1650440&view=diff
==============================================================================
--- hive/branches/HIVE-8065/ql/src/test/results/clientpositive/encrypted/encryption_insert_partition_dynamic.q.out (original)
+++ hive/branches/HIVE-8065/ql/src/test/results/clientpositive/encrypted/encryption_insert_partition_dynamic.q.out Fri Jan  9 05:02:14 2015
@@ -14,14 +14,14 @@ POSTHOOK: query: drop table IF EXISTS un
 POSTHOOK: type: DROPTABLE
 PREHOOK: query: create table encryptedTable(value string)
     partitioned by (key string) clustered by (value) into 2 buckets stored as orc
-    location '/build/ql/test/data/warehouse/encryptedTable' TBLPROPERTIES ('transactional'='true')
+#### A masked pattern was here ####
 PREHOOK: type: CREATETABLE
 #### A masked pattern was here ####
 PREHOOK: Output: database:default
 PREHOOK: Output: default@encryptedTable
 POSTHOOK: query: create table encryptedTable(value string)
     partitioned by (key string) clustered by (value) into 2 buckets stored as orc
-    location '/build/ql/test/data/warehouse/encryptedTable' TBLPROPERTIES ('transactional'='true')
+#### A masked pattern was here ####
 POSTHOOK: type: CREATETABLE
 #### A masked pattern was here ####
 POSTHOOK: Output: database:default

Modified: hive/branches/HIVE-8065/ql/src/test/results/clientpositive/encrypted/encryption_insert_partition_static.q.out
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-8065/ql/src/test/results/clientpositive/encrypted/encryption_insert_partition_static.q.out?rev=1650440&r1=1650439&r2=1650440&view=diff
==============================================================================
--- hive/branches/HIVE-8065/ql/src/test/results/clientpositive/encrypted/encryption_insert_partition_static.q.out (original)
+++ hive/branches/HIVE-8065/ql/src/test/results/clientpositive/encrypted/encryption_insert_partition_static.q.out Fri Jan  9 05:02:14 2015
@@ -14,14 +14,14 @@ POSTHOOK: query: drop table IF EXISTS un
 POSTHOOK: type: DROPTABLE
 PREHOOK: query: create table encryptedTable(key string,
     value string) partitioned by (ds string) clustered by (key) into 2 buckets stored as orc
-    location '/build/ql/test/data/warehouse/encryptedTable' TBLPROPERTIES ('transactional'='true')
+#### A masked pattern was here ####
 PREHOOK: type: CREATETABLE
 #### A masked pattern was here ####
 PREHOOK: Output: database:default
 PREHOOK: Output: default@encryptedTable
 POSTHOOK: query: create table encryptedTable(key string,
     value string) partitioned by (ds string) clustered by (key) into 2 buckets stored as orc
-    location '/build/ql/test/data/warehouse/encryptedTable' TBLPROPERTIES ('transactional'='true')
+#### A masked pattern was here ####
 POSTHOOK: type: CREATETABLE
 #### A masked pattern was here ####
 POSTHOOK: Output: database:default