You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by jc...@apache.org on 2018/07/10 16:03:58 UTC
hive git commit: HIVE-20112: Accumulo-Hive (managed) table creation
fails with strict managed table checks: Table is marked as a managed table
but is not transactional (Jesus Camacho Rodriguez,
reviewed by Ashutosh Chauhan)
Repository: hive
Updated Branches:
refs/heads/master 1105ef397 -> c4c55d2ab
HIVE-20112: Accumulo-Hive (managed) table creation fails with strict managed table checks: Table is marked as a managed table but is not transactional (Jesus Camacho Rodriguez, 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/c4c55d2a
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/c4c55d2a
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/c4c55d2a
Branch: refs/heads/master
Commit: c4c55d2abf2f21d776a7f45559084a838bac42eb
Parents: 1105ef3
Author: Jesus Camacho Rodriguez <jc...@apache.org>
Authored: Tue Jul 10 09:03:49 2018 -0700
Committer: Jesus Camacho Rodriguez <jc...@apache.org>
Committed: Tue Jul 10 09:03:49 2018 -0700
----------------------------------------------------------------------
.../hive/accumulo/AccumuloStorageHandler.java | 19 ++------
.../accumulo/TestAccumuloStorageHandler.java | 44 +++++++++----------
.../test/queries/positive/accumulo_custom_key.q | 5 ++-
.../queries/positive/accumulo_custom_key2.q | 5 ++-
.../src/test/queries/positive/accumulo_index.q | 5 ++-
.../src/test/queries/positive/accumulo_joins.q | 25 ++++++-----
.../positive/accumulo_predicate_pushdown.q | 5 ++-
.../test/queries/positive/accumulo_queries.q | 35 +++++++++------
.../accumulo_single_sourced_multi_insert.q | 5 ++-
.../results/positive/accumulo_custom_key.q.out | 6 ++-
.../results/positive/accumulo_custom_key2.q.out | 6 ++-
.../test/results/positive/accumulo_index.q.out | 6 ++-
.../test/results/positive/accumulo_joins.q.out | 30 ++++++++-----
.../positive/accumulo_predicate_pushdown.q.out | 6 ++-
.../results/positive/accumulo_queries.q.out | 46 +++++++++++++-------
.../accumulo_single_sourced_multi_insert.q.out | 6 ++-
16 files changed, 147 insertions(+), 107 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hive/blob/c4c55d2a/accumulo-handler/src/java/org/apache/hadoop/hive/accumulo/AccumuloStorageHandler.java
----------------------------------------------------------------------
diff --git a/accumulo-handler/src/java/org/apache/hadoop/hive/accumulo/AccumuloStorageHandler.java b/accumulo-handler/src/java/org/apache/hadoop/hive/accumulo/AccumuloStorageHandler.java
index 1a6e728..596eaa9 100644
--- a/accumulo-handler/src/java/org/apache/hadoop/hive/accumulo/AccumuloStorageHandler.java
+++ b/accumulo-handler/src/java/org/apache/hadoop/hive/accumulo/AccumuloStorageHandler.java
@@ -338,7 +338,6 @@ public class AccumuloStorageHandler extends DefaultStorageHandler implements Hiv
@Override
public void preCreateTable(Table table) throws MetaException {
- boolean isExternal = isExternalTable(table);
if (table.getSd().getLocation() != null) {
throw new MetaException("Location can't be specified for Accumulo");
}
@@ -357,17 +356,7 @@ public class AccumuloStorageHandler extends DefaultStorageHandler implements Hiv
// Attempt to create the table, taking EXTERNAL into consideration
if (!tableOpts.exists(tblName)) {
- if (!isExternal) {
- tableOpts.create(tblName);
- } else {
- throw new MetaException("Accumulo table " + tblName
- + " doesn't exist even though declared external");
- }
- } else {
- if (!isExternal) {
- throw new MetaException("Table " + tblName
- + " already exists in Accumulo. Use CREATE EXTERNAL TABLE to register with Hive.");
- }
+ tableOpts.create(tblName);
}
String idxTable = getIndexTableName(table);
@@ -388,8 +377,8 @@ public class AccumuloStorageHandler extends DefaultStorageHandler implements Hiv
}
}
- protected boolean isExternalTable(Table table) {
- return MetaStoreUtils.isExternalTable(table);
+ protected boolean isPurge(Table table) {
+ return !MetaStoreUtils.isExternalTable(table) || MetaStoreUtils.isExternalTablePurge(table);
}
@Override
@@ -406,7 +395,7 @@ public class AccumuloStorageHandler extends DefaultStorageHandler implements Hiv
@Override
public void commitDropTable(Table table, boolean deleteData) throws MetaException {
String tblName = getTableName(table);
- if (!isExternalTable(table)) {
+ if (isPurge(table)) {
try {
if (deleteData) {
TableOperations tblOpts = connectionParams.getConnector().tableOperations();
http://git-wip-us.apache.org/repos/asf/hive/blob/c4c55d2a/accumulo-handler/src/test/org/apache/hadoop/hive/accumulo/TestAccumuloStorageHandler.java
----------------------------------------------------------------------
diff --git a/accumulo-handler/src/test/org/apache/hadoop/hive/accumulo/TestAccumuloStorageHandler.java b/accumulo-handler/src/test/org/apache/hadoop/hive/accumulo/TestAccumuloStorageHandler.java
index 58bf4a6..7b12362 100644
--- a/accumulo-handler/src/test/org/apache/hadoop/hive/accumulo/TestAccumuloStorageHandler.java
+++ b/accumulo-handler/src/test/org/apache/hadoop/hive/accumulo/TestAccumuloStorageHandler.java
@@ -200,8 +200,8 @@ public class TestAccumuloStorageHandler {
// Return our known table name
Mockito.when(storageHandler.getTableName(table)).thenReturn(tableName);
- // Not an EXTERNAL table
- Mockito.when(storageHandler.isExternalTable(table)).thenReturn(false);
+ // Is marked for purge
+ Mockito.when(storageHandler.isPurge(table)).thenReturn(true);
// Return the mocked StorageDescriptor
Mockito.when(table.getSd()).thenReturn(sd);
@@ -248,8 +248,8 @@ public class TestAccumuloStorageHandler {
// Return our known table name
Mockito.when(storageHandler.getTableName(table)).thenReturn(tableName);
- // Not an EXTERNAL table
- Mockito.when(storageHandler.isExternalTable(table)).thenReturn(false);
+ // Is marked for purge
+ Mockito.when(storageHandler.isPurge(table)).thenReturn(true);
// Return the mocked StorageDescriptor
Mockito.when(table.getSd()).thenReturn(sd);
@@ -294,8 +294,8 @@ public class TestAccumuloStorageHandler {
// Return our known table name
Mockito.when(storageHandler.getTableName(table)).thenReturn(tableName);
- // Not an EXTERNAL table
- Mockito.when(storageHandler.isExternalTable(table)).thenReturn(false);
+ // Is marked for purge
+ Mockito.when(storageHandler.isPurge(table)).thenReturn(true);
// Return the mocked StorageDescriptor
Mockito.when(table.getSd()).thenReturn(sd);
@@ -317,8 +317,8 @@ public class TestAccumuloStorageHandler {
storageHandler.preCreateTable(table);
}
- @Test(expected = MetaException.class)
- public void testExternalNonExistentTableFails() throws Exception {
+ @Test
+ public void testExternalNonExistentTable() throws Exception {
MockInstance inst = new MockInstance(test.getMethodName());
Connector conn = inst.getConnector("root", new PasswordToken(""));
String tableName = "table";
@@ -340,8 +340,8 @@ public class TestAccumuloStorageHandler {
// Return our known table name
Mockito.when(storageHandler.getTableName(table)).thenReturn(tableName);
- // Is an EXTERNAL table
- Mockito.when(storageHandler.isExternalTable(table)).thenReturn(true);
+ // Is not marked for purge
+ Mockito.when(storageHandler.isPurge(table)).thenReturn(false);
// Return the mocked StorageDescriptor
Mockito.when(table.getSd()).thenReturn(sd);
@@ -363,8 +363,8 @@ public class TestAccumuloStorageHandler {
storageHandler.preCreateTable(table);
}
- @Test(expected = MetaException.class)
- public void testNonExternalExistentTable() throws Exception {
+ @Test
+ public void testExternalExistentTable() throws Exception {
MockInstance inst = new MockInstance(test.getMethodName());
Connector conn = inst.getConnector("root", new PasswordToken(""));
String tableName = "table";
@@ -389,8 +389,8 @@ public class TestAccumuloStorageHandler {
// Return our known table name
Mockito.when(storageHandler.getTableName(table)).thenReturn(tableName);
- // Is not an EXTERNAL table
- Mockito.when(storageHandler.isExternalTable(table)).thenReturn(false);
+ // Is marked for purge
+ Mockito.when(storageHandler.isPurge(table)).thenReturn(true);
// Return the mocked StorageDescriptor
Mockito.when(table.getSd()).thenReturn(sd);
@@ -429,8 +429,8 @@ public class TestAccumuloStorageHandler {
// Return our known table name
Mockito.when(storageHandler.getTableName(table)).thenReturn(tableName);
- // Is not an EXTERNAL table
- Mockito.when(storageHandler.isExternalTable(table)).thenReturn(false);
+ // Is marked for purge
+ Mockito.when(storageHandler.isPurge(table)).thenReturn(true);
// Return the MockInstance's Connector
Mockito.when(connectionParams.getConnector()).thenReturn(conn);
@@ -461,8 +461,8 @@ public class TestAccumuloStorageHandler {
// Return our known table name
Mockito.when(storageHandler.getTableName(table)).thenReturn(tableName);
- // Is not an EXTERNAL table
- Mockito.when(storageHandler.isExternalTable(table)).thenReturn(false);
+ // Is marked for purge
+ Mockito.when(storageHandler.isPurge(table)).thenReturn(true);
// Return the MockInstance's Connector
Mockito.when(connectionParams.getConnector()).thenReturn(conn);
@@ -495,8 +495,8 @@ public class TestAccumuloStorageHandler {
// Return our known table name
Mockito.when(storageHandler.getTableName(table)).thenReturn(tableName);
- // Is not an EXTERNAL table
- Mockito.when(storageHandler.isExternalTable(table)).thenReturn(true);
+ // Is not marked for purge
+ Mockito.when(storageHandler.isPurge(table)).thenReturn(false);
// Return the MockInstance's Connector
Mockito.when(connectionParams.getConnector()).thenReturn(conn);
@@ -528,8 +528,8 @@ public class TestAccumuloStorageHandler {
// Return our known table name
Mockito.when(storageHandler.getTableName(table)).thenReturn(tableName);
- // Is not an EXTERNAL table
- Mockito.when(storageHandler.isExternalTable(table)).thenReturn(false);
+ // Is marked for purge
+ Mockito.when(storageHandler.isPurge(table)).thenReturn(true);
// Return the MockInstance's Connector
Mockito.when(connectionParams.getConnector()).thenReturn(conn);
http://git-wip-us.apache.org/repos/asf/hive/blob/c4c55d2a/accumulo-handler/src/test/queries/positive/accumulo_custom_key.q
----------------------------------------------------------------------
diff --git a/accumulo-handler/src/test/queries/positive/accumulo_custom_key.q b/accumulo-handler/src/test/queries/positive/accumulo_custom_key.q
index ca7e6c7..d5e18d6 100644
--- a/accumulo-handler/src/test/queries/positive/accumulo_custom_key.q
+++ b/accumulo-handler/src/test/queries/positive/accumulo_custom_key.q
@@ -1,11 +1,12 @@
--! qt:dataset:src
-CREATE TABLE accumulo_ck_1(key struct<col1:string,col2:string,col3:string>, value string)
+CREATE EXTERNAL TABLE accumulo_ck_1(key struct<col1:string,col2:string,col3:string>, value string)
STORED BY 'org.apache.hadoop.hive.accumulo.AccumuloStorageHandler'
WITH SERDEPROPERTIES (
"accumulo.table.name" = "accumulo_custom",
"accumulo.columns.mapping" = ":rowid,cf:string",
"accumulo.composite.rowid.factory"="org.apache.hadoop.hive.accumulo.serde.DelimitedAccumuloRowIdFactory",
- "accumulo.composite.delimiter" = "$");
+ "accumulo.composite.delimiter" = "$")
+TBLPROPERTIES ("external.table.purge" = "true");
CREATE EXTERNAL TABLE accumulo_ck_2(key string, value string)
STORED BY 'org.apache.hadoop.hive.accumulo.AccumuloStorageHandler'
http://git-wip-us.apache.org/repos/asf/hive/blob/c4c55d2a/accumulo-handler/src/test/queries/positive/accumulo_custom_key2.q
----------------------------------------------------------------------
diff --git a/accumulo-handler/src/test/queries/positive/accumulo_custom_key2.q b/accumulo-handler/src/test/queries/positive/accumulo_custom_key2.q
index 615e5f8..104ca16 100644
--- a/accumulo-handler/src/test/queries/positive/accumulo_custom_key2.q
+++ b/accumulo-handler/src/test/queries/positive/accumulo_custom_key2.q
@@ -1,10 +1,11 @@
--! qt:dataset:src
-CREATE TABLE accumulo_ck_3(key struct<col1:string,col2:string,col3:string>, value string)
+CREATE EXTERNAL TABLE accumulo_ck_3(key struct<col1:string,col2:string,col3:string>, value string)
STORED BY 'org.apache.hadoop.hive.accumulo.AccumuloStorageHandler'
WITH SERDEPROPERTIES (
"accumulo.table.name" = "accumulo_custom2",
"accumulo.columns.mapping" = ":rowid,cf:string",
- "accumulo.composite.rowid"="org.apache.hadoop.hive.accumulo.serde.FirstCharAccumuloCompositeRowId");
+ "accumulo.composite.rowid"="org.apache.hadoop.hive.accumulo.serde.FirstCharAccumuloCompositeRowId")
+TBLPROPERTIES ("external.table.purge" = "true");
insert overwrite table accumulo_ck_3 select struct('abcd','mnop','wxyz'),'value'
from src where key = 100;
http://git-wip-us.apache.org/repos/asf/hive/blob/c4c55d2a/accumulo-handler/src/test/queries/positive/accumulo_index.q
----------------------------------------------------------------------
diff --git a/accumulo-handler/src/test/queries/positive/accumulo_index.q b/accumulo-handler/src/test/queries/positive/accumulo_index.q
index 52a33af..445cc74 100644
--- a/accumulo-handler/src/test/queries/positive/accumulo_index.q
+++ b/accumulo-handler/src/test/queries/positive/accumulo_index.q
@@ -1,6 +1,6 @@
DROP TABLE accumulo_index_test;
-CREATE TABLE accumulo_index_test (
+CREATE EXTERNAL TABLE accumulo_index_test (
rowid string,
active boolean,
num_offices tinyint,
@@ -21,7 +21,8 @@ WITH SERDEPROPERTIES (
"accumulo.table.name"="accumulo_index_test",
"accumulo.indexed.columns"="*",
"accumulo.indextable.name"="accumulo_index_idx"
- );
+ )
+TBLPROPERTIES ("external.table.purge" = "true");
insert into accumulo_index_test values( "row1", true, 55, 107, 555555, 1223232332,
http://git-wip-us.apache.org/repos/asf/hive/blob/c4c55d2a/accumulo-handler/src/test/queries/positive/accumulo_joins.q
----------------------------------------------------------------------
diff --git a/accumulo-handler/src/test/queries/positive/accumulo_joins.q b/accumulo-handler/src/test/queries/positive/accumulo_joins.q
index a6b09ab..9d93029 100644
--- a/accumulo-handler/src/test/queries/positive/accumulo_joins.q
+++ b/accumulo-handler/src/test/queries/positive/accumulo_joins.q
@@ -6,23 +6,26 @@ DROP TABLE users_level;
-- From HIVE-1257
-CREATE TABLE users(key string, state string, country string, country_id int)
+CREATE EXTERNAL TABLE users(key string, state string, country string, country_id int)
STORED BY 'org.apache.hadoop.hive.accumulo.AccumuloStorageHandler'
WITH SERDEPROPERTIES (
"accumulo.columns.mapping" = ":rowID,info:state,info:country,info:country_id"
-);
+)
+TBLPROPERTIES ("external.table.purge" = "true");
-CREATE TABLE states(key string, name string)
+CREATE EXTERNAL TABLE states(key string, name string)
STORED BY 'org.apache.hadoop.hive.accumulo.AccumuloStorageHandler'
WITH SERDEPROPERTIES (
"accumulo.columns.mapping" = ":rowID,state:name"
-);
+)
+TBLPROPERTIES ("external.table.purge" = "true");
-CREATE TABLE countries(key string, name string, country string, country_id int)
+CREATE EXTERNAL TABLE countries(key string, name string, country string, country_id int)
STORED BY 'org.apache.hadoop.hive.accumulo.AccumuloStorageHandler'
WITH SERDEPROPERTIES (
"accumulo.columns.mapping" = ":rowID,info:name,info:country,info:country_id"
-);
+)
+TBLPROPERTIES ("external.table.purge" = "true");
INSERT OVERWRITE TABLE users SELECT 'user1', 'IA', 'USA', 0
FROM src WHERE key=100;
@@ -65,13 +68,15 @@ DROP TABLE users;
DROP TABLE states;
DROP TABLE countries;
-CREATE TABLE users(key int, userid int, username string, created int)
+CREATE EXTERNAL TABLE users(key int, userid int, username string, created int)
STORED BY 'org.apache.hadoop.hive.accumulo.AccumuloStorageHandler'
-WITH SERDEPROPERTIES ("accumulo.columns.mapping" = ":rowID,f:userid,f:nickname,f:created");
+WITH SERDEPROPERTIES ("accumulo.columns.mapping" = ":rowID,f:userid,f:nickname,f:created")
+TBLPROPERTIES ("external.table.purge" = "true");
-CREATE TABLE users_level(key int, userid int, level int)
+CREATE EXTERNAL TABLE users_level(key int, userid int, level int)
STORED BY 'org.apache.hadoop.hive.accumulo.AccumuloStorageHandler'
-WITH SERDEPROPERTIES ("accumulo.columns.mapping" = ":rowID,f:userid,f:level");
+WITH SERDEPROPERTIES ("accumulo.columns.mapping" = ":rowID,f:userid,f:level")
+TBLPROPERTIES ("external.table.purge" = "true");
-- HIVE-1903: the problem fixed here showed up even without any data,
-- so no need to load any to test it
http://git-wip-us.apache.org/repos/asf/hive/blob/c4c55d2a/accumulo-handler/src/test/queries/positive/accumulo_predicate_pushdown.q
----------------------------------------------------------------------
diff --git a/accumulo-handler/src/test/queries/positive/accumulo_predicate_pushdown.q b/accumulo-handler/src/test/queries/positive/accumulo_predicate_pushdown.q
index 4cb93b5..60a2869 100644
--- a/accumulo-handler/src/test/queries/positive/accumulo_predicate_pushdown.q
+++ b/accumulo-handler/src/test/queries/positive/accumulo_predicate_pushdown.q
@@ -1,8 +1,9 @@
--! qt:dataset:src
--! qt:dataset:part
-CREATE TABLE accumulo_pushdown(key string, value string)
+CREATE EXTERNAL TABLE accumulo_pushdown(key string, value string)
STORED BY 'org.apache.hadoop.hive.accumulo.AccumuloStorageHandler'
-WITH SERDEPROPERTIES ("accumulo.columns.mapping" = ":rowid,cf:string");
+WITH SERDEPROPERTIES ("accumulo.columns.mapping" = ":rowid,cf:string")
+TBLPROPERTIES ("external.table.purge" = "true");
INSERT OVERWRITE TABLE accumulo_pushdown
SELECT cast(key as string), value
http://git-wip-us.apache.org/repos/asf/hive/blob/c4c55d2a/accumulo-handler/src/test/queries/positive/accumulo_queries.q
----------------------------------------------------------------------
diff --git a/accumulo-handler/src/test/queries/positive/accumulo_queries.q b/accumulo-handler/src/test/queries/positive/accumulo_queries.q
index bc93d8a..ed2fce3 100644
--- a/accumulo-handler/src/test/queries/positive/accumulo_queries.q
+++ b/accumulo-handler/src/test/queries/positive/accumulo_queries.q
@@ -6,10 +6,11 @@ set hive.optimize.ppd=false;
DROP TABLE accumulo_table_1;
-CREATE TABLE accumulo_table_1(key int, value string)
+CREATE EXTERNAL TABLE accumulo_table_1(key int, value string)
STORED BY 'org.apache.hadoop.hive.accumulo.AccumuloStorageHandler'
WITH SERDEPROPERTIES ("accumulo.columns.mapping" = ":rowID,cf:string")
-TBLPROPERTIES ("accumulo.table.name" = "accumulo_table_0");
+TBLPROPERTIES ("accumulo.table.name" = "accumulo_table_0",
+ "external.table.purge" = "true");
DESCRIBE EXTENDED accumulo_table_1;
@@ -59,9 +60,10 @@ ON (x.key = Y.key)
ORDER BY key,value;
DROP TABLE empty_accumulo_table;
-CREATE TABLE empty_accumulo_table(key int, value string)
+CREATE EXTERNAL TABLE empty_accumulo_table(key int, value string)
STORED BY 'org.apache.hadoop.hive.accumulo.AccumuloStorageHandler'
-WITH SERDEPROPERTIES ("accumulo.columns.mapping" = ":rowID,cf:string");
+WITH SERDEPROPERTIES ("accumulo.columns.mapping" = ":rowID,cf:string")
+TBLPROPERTIES ("external.table.purge" = "true");
DROP TABLE empty_normal_table;
CREATE TABLE empty_normal_table(key int, value string);
@@ -71,11 +73,12 @@ select * from (select count(1) c from empty_normal_table union all select count(
select * from (select count(1) c from src union all select count(1) as c from empty_accumulo_table) x order by c;
select * from (select count(1) c from src union all select count(1) as c from accumulo_table_1) x order by c;
-CREATE TABLE accumulo_table_3(key int, value string, count int)
+CREATE EXTERNAL TABLE accumulo_table_3(key int, value string, count int)
STORED BY 'org.apache.hadoop.hive.accumulo.AccumuloStorageHandler'
WITH SERDEPROPERTIES (
"accumulo.columns.mapping" = ":rowID,cf:val,cf2:count"
-);
+)
+TBLPROPERTIES ("external.table.purge" = "true");
EXPLAIN
INSERT OVERWRITE TABLE accumulo_table_3
@@ -99,11 +102,12 @@ select * from accumulo_table_3 order by key, value limit 5;
select key, count from accumulo_table_3 order by key, count desc limit 5;
DROP TABLE accumulo_table_4;
-CREATE TABLE accumulo_table_4(key int, value1 string, value2 int, value3 int)
+CREATE EXTERNAL TABLE accumulo_table_4(key int, value1 string, value2 int, value3 int)
STORED BY 'org.apache.hadoop.hive.accumulo.AccumuloStorageHandler'
WITH SERDEPROPERTIES (
"accumulo.columns.mapping" = ":rowID,a:b,a:c,d:e"
-);
+)
+TBLPROPERTIES ("external.table.purge" = "true");
INSERT OVERWRITE TABLE accumulo_table_4 SELECT key, value, key+1, key+2
FROM src WHERE key=98 OR key=100;
@@ -119,22 +123,24 @@ TBLPROPERTIES ("accumulo.table.name" = "accumulo_table_4");
SELECT * FROM accumulo_table_5 ORDER BY key;
DROP TABLE accumulo_table_6;
-CREATE TABLE accumulo_table_6(key int, value map<string,string>)
+CREATE EXTERNAL TABLE accumulo_table_6(key int, value map<string,string>)
STORED BY 'org.apache.hadoop.hive.accumulo.AccumuloStorageHandler'
WITH SERDEPROPERTIES (
"accumulo.columns.mapping" = ":rowID,cf:*"
-);
+)
+TBLPROPERTIES ("external.table.purge" = "true");
INSERT OVERWRITE TABLE accumulo_table_6 SELECT key, map(value, key) FROM src
WHERE key=98 OR key=100;
SELECT * FROM accumulo_table_6 ORDER BY key;
DROP TABLE accumulo_table_7;
-CREATE TABLE accumulo_table_7(value map<string,string>, key int)
+CREATE EXTERNAL TABLE accumulo_table_7(value map<string,string>, key int)
STORED BY 'org.apache.hadoop.hive.accumulo.AccumuloStorageHandler'
WITH SERDEPROPERTIES (
"accumulo.columns.mapping" = "cf:*,:rowID"
-);
+)
+TBLPROPERTIES ("external.table.purge" = "true");
INSERT OVERWRITE TABLE accumulo_table_7
SELECT map(value, key, upper(value), key+1), key FROM src
WHERE key=98 OR key=100;
@@ -142,11 +148,12 @@ WHERE key=98 OR key=100;
SELECT * FROM accumulo_table_7 ORDER BY key;
DROP TABLE accumulo_table_8;
-CREATE TABLE accumulo_table_8(key int, value1 string, value2 int, value3 int)
+CREATE EXTERNAL TABLE accumulo_table_8(key int, value1 string, value2 int, value3 int)
STORED BY 'org.apache.hadoop.hive.accumulo.AccumuloStorageHandler'
WITH SERDEPROPERTIES (
"accumulo.columns.mapping" = ":rowID,a:b,a:c,d:e"
-);
+)
+TBLPROPERTIES ("external.table.purge" = "true");
INSERT OVERWRITE TABLE accumulo_table_8 SELECT key, value, key+1, key+2
FROM src WHERE key=98 OR key=100;
http://git-wip-us.apache.org/repos/asf/hive/blob/c4c55d2a/accumulo-handler/src/test/queries/positive/accumulo_single_sourced_multi_insert.q
----------------------------------------------------------------------
diff --git a/accumulo-handler/src/test/queries/positive/accumulo_single_sourced_multi_insert.q b/accumulo-handler/src/test/queries/positive/accumulo_single_sourced_multi_insert.q
index c12f962..56468a1 100644
--- a/accumulo-handler/src/test/queries/positive/accumulo_single_sourced_multi_insert.q
+++ b/accumulo-handler/src/test/queries/positive/accumulo_single_sourced_multi_insert.q
@@ -1,9 +1,10 @@
--! qt:dataset:src
-- HIVE-4375 Single sourced multi insert consists of native and non-native table mixed throws NPE
CREATE TABLE src_x1(key string, value string);
-CREATE TABLE src_x2(key string, value string)
+CREATE EXTERNAL TABLE src_x2(key string, value string)
STORED BY 'org.apache.hadoop.hive.accumulo.AccumuloStorageHandler'
-WITH SERDEPROPERTIES ("accumulo.columns.mapping" = ":rowid, cf:value");
+WITH SERDEPROPERTIES ("accumulo.columns.mapping" = ":rowid, cf:value")
+TBLPROPERTIES ("external.table.purge" = "true");
explain
from src a
http://git-wip-us.apache.org/repos/asf/hive/blob/c4c55d2a/accumulo-handler/src/test/results/positive/accumulo_custom_key.q.out
----------------------------------------------------------------------
diff --git a/accumulo-handler/src/test/results/positive/accumulo_custom_key.q.out b/accumulo-handler/src/test/results/positive/accumulo_custom_key.q.out
index ca5f37b..328ac7d 100644
--- a/accumulo-handler/src/test/results/positive/accumulo_custom_key.q.out
+++ b/accumulo-handler/src/test/results/positive/accumulo_custom_key.q.out
@@ -1,20 +1,22 @@
-PREHOOK: query: CREATE TABLE accumulo_ck_1(key struct<col1:string,col2:string,col3:string>, value string)
+PREHOOK: query: CREATE EXTERNAL TABLE accumulo_ck_1(key struct<col1:string,col2:string,col3:string>, value string)
STORED BY 'org.apache.hadoop.hive.accumulo.AccumuloStorageHandler'
WITH SERDEPROPERTIES (
"accumulo.table.name" = "accumulo_custom",
"accumulo.columns.mapping" = ":rowid,cf:string",
"accumulo.composite.rowid.factory"="org.apache.hadoop.hive.accumulo.serde.DelimitedAccumuloRowIdFactory",
"accumulo.composite.delimiter" = "$")
+TBLPROPERTIES ("external.table.purge" = "true")
PREHOOK: type: CREATETABLE
PREHOOK: Output: database:default
PREHOOK: Output: default@accumulo_ck_1
-POSTHOOK: query: CREATE TABLE accumulo_ck_1(key struct<col1:string,col2:string,col3:string>, value string)
+POSTHOOK: query: CREATE EXTERNAL TABLE accumulo_ck_1(key struct<col1:string,col2:string,col3:string>, value string)
STORED BY 'org.apache.hadoop.hive.accumulo.AccumuloStorageHandler'
WITH SERDEPROPERTIES (
"accumulo.table.name" = "accumulo_custom",
"accumulo.columns.mapping" = ":rowid,cf:string",
"accumulo.composite.rowid.factory"="org.apache.hadoop.hive.accumulo.serde.DelimitedAccumuloRowIdFactory",
"accumulo.composite.delimiter" = "$")
+TBLPROPERTIES ("external.table.purge" = "true")
POSTHOOK: type: CREATETABLE
POSTHOOK: Output: database:default
POSTHOOK: Output: default@accumulo_ck_1
http://git-wip-us.apache.org/repos/asf/hive/blob/c4c55d2a/accumulo-handler/src/test/results/positive/accumulo_custom_key2.q.out
----------------------------------------------------------------------
diff --git a/accumulo-handler/src/test/results/positive/accumulo_custom_key2.q.out b/accumulo-handler/src/test/results/positive/accumulo_custom_key2.q.out
index b9e1009..29d89df 100644
--- a/accumulo-handler/src/test/results/positive/accumulo_custom_key2.q.out
+++ b/accumulo-handler/src/test/results/positive/accumulo_custom_key2.q.out
@@ -1,18 +1,20 @@
-PREHOOK: query: CREATE TABLE accumulo_ck_3(key struct<col1:string,col2:string,col3:string>, value string)
+PREHOOK: query: CREATE EXTERNAL TABLE accumulo_ck_3(key struct<col1:string,col2:string,col3:string>, value string)
STORED BY 'org.apache.hadoop.hive.accumulo.AccumuloStorageHandler'
WITH SERDEPROPERTIES (
"accumulo.table.name" = "accumulo_custom2",
"accumulo.columns.mapping" = ":rowid,cf:string",
"accumulo.composite.rowid"="org.apache.hadoop.hive.accumulo.serde.FirstCharAccumuloCompositeRowId")
+TBLPROPERTIES ("external.table.purge" = "true")
PREHOOK: type: CREATETABLE
PREHOOK: Output: database:default
PREHOOK: Output: default@accumulo_ck_3
-POSTHOOK: query: CREATE TABLE accumulo_ck_3(key struct<col1:string,col2:string,col3:string>, value string)
+POSTHOOK: query: CREATE EXTERNAL TABLE accumulo_ck_3(key struct<col1:string,col2:string,col3:string>, value string)
STORED BY 'org.apache.hadoop.hive.accumulo.AccumuloStorageHandler'
WITH SERDEPROPERTIES (
"accumulo.table.name" = "accumulo_custom2",
"accumulo.columns.mapping" = ":rowid,cf:string",
"accumulo.composite.rowid"="org.apache.hadoop.hive.accumulo.serde.FirstCharAccumuloCompositeRowId")
+TBLPROPERTIES ("external.table.purge" = "true")
POSTHOOK: type: CREATETABLE
POSTHOOK: Output: database:default
POSTHOOK: Output: default@accumulo_ck_3
http://git-wip-us.apache.org/repos/asf/hive/blob/c4c55d2a/accumulo-handler/src/test/results/positive/accumulo_index.q.out
----------------------------------------------------------------------
diff --git a/accumulo-handler/src/test/results/positive/accumulo_index.q.out b/accumulo-handler/src/test/results/positive/accumulo_index.q.out
index a7c66a7..65328e2 100644
--- a/accumulo-handler/src/test/results/positive/accumulo_index.q.out
+++ b/accumulo-handler/src/test/results/positive/accumulo_index.q.out
@@ -2,7 +2,7 @@ PREHOOK: query: DROP TABLE accumulo_index_test
PREHOOK: type: DROPTABLE
POSTHOOK: query: DROP TABLE accumulo_index_test
POSTHOOK: type: DROPTABLE
-PREHOOK: query: CREATE TABLE accumulo_index_test (
+PREHOOK: query: CREATE EXTERNAL TABLE accumulo_index_test (
rowid string,
active boolean,
num_offices tinyint,
@@ -24,10 +24,11 @@ WITH SERDEPROPERTIES (
"accumulo.indexed.columns"="*",
"accumulo.indextable.name"="accumulo_index_idx"
)
+TBLPROPERTIES ("external.table.purge" = "true")
PREHOOK: type: CREATETABLE
PREHOOK: Output: database:default
PREHOOK: Output: default@accumulo_index_test
-POSTHOOK: query: CREATE TABLE accumulo_index_test (
+POSTHOOK: query: CREATE EXTERNAL TABLE accumulo_index_test (
rowid string,
active boolean,
num_offices tinyint,
@@ -49,6 +50,7 @@ WITH SERDEPROPERTIES (
"accumulo.indexed.columns"="*",
"accumulo.indextable.name"="accumulo_index_idx"
)
+TBLPROPERTIES ("external.table.purge" = "true")
POSTHOOK: type: CREATETABLE
POSTHOOK: Output: database:default
POSTHOOK: Output: default@accumulo_index_test
http://git-wip-us.apache.org/repos/asf/hive/blob/c4c55d2a/accumulo-handler/src/test/results/positive/accumulo_joins.q.out
----------------------------------------------------------------------
diff --git a/accumulo-handler/src/test/results/positive/accumulo_joins.q.out b/accumulo-handler/src/test/results/positive/accumulo_joins.q.out
index 5f11f94..ed65e08 100644
--- a/accumulo-handler/src/test/results/positive/accumulo_joins.q.out
+++ b/accumulo-handler/src/test/results/positive/accumulo_joins.q.out
@@ -14,51 +14,57 @@ PREHOOK: query: DROP TABLE users_level
PREHOOK: type: DROPTABLE
POSTHOOK: query: DROP TABLE users_level
POSTHOOK: type: DROPTABLE
-PREHOOK: query: CREATE TABLE users(key string, state string, country string, country_id int)
+PREHOOK: query: CREATE EXTERNAL TABLE users(key string, state string, country string, country_id int)
STORED BY 'org.apache.hadoop.hive.accumulo.AccumuloStorageHandler'
WITH SERDEPROPERTIES (
"accumulo.columns.mapping" = ":rowID,info:state,info:country,info:country_id"
)
+TBLPROPERTIES ("external.table.purge" = "true")
PREHOOK: type: CREATETABLE
PREHOOK: Output: database:default
PREHOOK: Output: default@users
-POSTHOOK: query: CREATE TABLE users(key string, state string, country string, country_id int)
+POSTHOOK: query: CREATE EXTERNAL TABLE users(key string, state string, country string, country_id int)
STORED BY 'org.apache.hadoop.hive.accumulo.AccumuloStorageHandler'
WITH SERDEPROPERTIES (
"accumulo.columns.mapping" = ":rowID,info:state,info:country,info:country_id"
)
+TBLPROPERTIES ("external.table.purge" = "true")
POSTHOOK: type: CREATETABLE
POSTHOOK: Output: database:default
POSTHOOK: Output: default@users
-PREHOOK: query: CREATE TABLE states(key string, name string)
+PREHOOK: query: CREATE EXTERNAL TABLE states(key string, name string)
STORED BY 'org.apache.hadoop.hive.accumulo.AccumuloStorageHandler'
WITH SERDEPROPERTIES (
"accumulo.columns.mapping" = ":rowID,state:name"
)
+TBLPROPERTIES ("external.table.purge" = "true")
PREHOOK: type: CREATETABLE
PREHOOK: Output: database:default
PREHOOK: Output: default@states
-POSTHOOK: query: CREATE TABLE states(key string, name string)
+POSTHOOK: query: CREATE EXTERNAL TABLE states(key string, name string)
STORED BY 'org.apache.hadoop.hive.accumulo.AccumuloStorageHandler'
WITH SERDEPROPERTIES (
"accumulo.columns.mapping" = ":rowID,state:name"
)
+TBLPROPERTIES ("external.table.purge" = "true")
POSTHOOK: type: CREATETABLE
POSTHOOK: Output: database:default
POSTHOOK: Output: default@states
-PREHOOK: query: CREATE TABLE countries(key string, name string, country string, country_id int)
+PREHOOK: query: CREATE EXTERNAL TABLE countries(key string, name string, country string, country_id int)
STORED BY 'org.apache.hadoop.hive.accumulo.AccumuloStorageHandler'
WITH SERDEPROPERTIES (
"accumulo.columns.mapping" = ":rowID,info:name,info:country,info:country_id"
)
+TBLPROPERTIES ("external.table.purge" = "true")
PREHOOK: type: CREATETABLE
PREHOOK: Output: database:default
PREHOOK: Output: default@countries
-POSTHOOK: query: CREATE TABLE countries(key string, name string, country string, country_id int)
+POSTHOOK: query: CREATE EXTERNAL TABLE countries(key string, name string, country string, country_id int)
STORED BY 'org.apache.hadoop.hive.accumulo.AccumuloStorageHandler'
WITH SERDEPROPERTIES (
"accumulo.columns.mapping" = ":rowID,info:name,info:country,info:country_id"
)
+TBLPROPERTIES ("external.table.purge" = "true")
POSTHOOK: type: CREATETABLE
POSTHOOK: Output: database:default
POSTHOOK: Output: default@countries
@@ -218,27 +224,31 @@ POSTHOOK: query: DROP TABLE countries
POSTHOOK: type: DROPTABLE
POSTHOOK: Input: default@countries
POSTHOOK: Output: default@countries
-PREHOOK: query: CREATE TABLE users(key int, userid int, username string, created int)
+PREHOOK: query: CREATE EXTERNAL TABLE users(key int, userid int, username string, created int)
STORED BY 'org.apache.hadoop.hive.accumulo.AccumuloStorageHandler'
WITH SERDEPROPERTIES ("accumulo.columns.mapping" = ":rowID,f:userid,f:nickname,f:created")
+TBLPROPERTIES ("external.table.purge" = "true")
PREHOOK: type: CREATETABLE
PREHOOK: Output: database:default
PREHOOK: Output: default@users
-POSTHOOK: query: CREATE TABLE users(key int, userid int, username string, created int)
+POSTHOOK: query: CREATE EXTERNAL TABLE users(key int, userid int, username string, created int)
STORED BY 'org.apache.hadoop.hive.accumulo.AccumuloStorageHandler'
WITH SERDEPROPERTIES ("accumulo.columns.mapping" = ":rowID,f:userid,f:nickname,f:created")
+TBLPROPERTIES ("external.table.purge" = "true")
POSTHOOK: type: CREATETABLE
POSTHOOK: Output: database:default
POSTHOOK: Output: default@users
-PREHOOK: query: CREATE TABLE users_level(key int, userid int, level int)
+PREHOOK: query: CREATE EXTERNAL TABLE users_level(key int, userid int, level int)
STORED BY 'org.apache.hadoop.hive.accumulo.AccumuloStorageHandler'
WITH SERDEPROPERTIES ("accumulo.columns.mapping" = ":rowID,f:userid,f:level")
+TBLPROPERTIES ("external.table.purge" = "true")
PREHOOK: type: CREATETABLE
PREHOOK: Output: database:default
PREHOOK: Output: default@users_level
-POSTHOOK: query: CREATE TABLE users_level(key int, userid int, level int)
+POSTHOOK: query: CREATE EXTERNAL TABLE users_level(key int, userid int, level int)
STORED BY 'org.apache.hadoop.hive.accumulo.AccumuloStorageHandler'
WITH SERDEPROPERTIES ("accumulo.columns.mapping" = ":rowID,f:userid,f:level")
+TBLPROPERTIES ("external.table.purge" = "true")
POSTHOOK: type: CREATETABLE
POSTHOOK: Output: database:default
POSTHOOK: Output: default@users_level
http://git-wip-us.apache.org/repos/asf/hive/blob/c4c55d2a/accumulo-handler/src/test/results/positive/accumulo_predicate_pushdown.q.out
----------------------------------------------------------------------
diff --git a/accumulo-handler/src/test/results/positive/accumulo_predicate_pushdown.q.out b/accumulo-handler/src/test/results/positive/accumulo_predicate_pushdown.q.out
index 6db7f5a..0389362 100644
--- a/accumulo-handler/src/test/results/positive/accumulo_predicate_pushdown.q.out
+++ b/accumulo-handler/src/test/results/positive/accumulo_predicate_pushdown.q.out
@@ -1,12 +1,14 @@
-PREHOOK: query: CREATE TABLE accumulo_pushdown(key string, value string)
+PREHOOK: query: CREATE EXTERNAL TABLE accumulo_pushdown(key string, value string)
STORED BY 'org.apache.hadoop.hive.accumulo.AccumuloStorageHandler'
WITH SERDEPROPERTIES ("accumulo.columns.mapping" = ":rowid,cf:string")
+TBLPROPERTIES ("external.table.purge" = "true")
PREHOOK: type: CREATETABLE
PREHOOK: Output: database:default
PREHOOK: Output: default@accumulo_pushdown
-POSTHOOK: query: CREATE TABLE accumulo_pushdown(key string, value string)
+POSTHOOK: query: CREATE EXTERNAL TABLE accumulo_pushdown(key string, value string)
STORED BY 'org.apache.hadoop.hive.accumulo.AccumuloStorageHandler'
WITH SERDEPROPERTIES ("accumulo.columns.mapping" = ":rowid,cf:string")
+TBLPROPERTIES ("external.table.purge" = "true")
POSTHOOK: type: CREATETABLE
POSTHOOK: Output: database:default
POSTHOOK: Output: default@accumulo_pushdown
http://git-wip-us.apache.org/repos/asf/hive/blob/c4c55d2a/accumulo-handler/src/test/results/positive/accumulo_queries.q.out
----------------------------------------------------------------------
diff --git a/accumulo-handler/src/test/results/positive/accumulo_queries.q.out b/accumulo-handler/src/test/results/positive/accumulo_queries.q.out
index f7e7699..d0fdae4 100644
--- a/accumulo-handler/src/test/results/positive/accumulo_queries.q.out
+++ b/accumulo-handler/src/test/results/positive/accumulo_queries.q.out
@@ -2,17 +2,19 @@ PREHOOK: query: DROP TABLE accumulo_table_1
PREHOOK: type: DROPTABLE
POSTHOOK: query: DROP TABLE accumulo_table_1
POSTHOOK: type: DROPTABLE
-PREHOOK: query: CREATE TABLE accumulo_table_1(key int, value string)
+PREHOOK: query: CREATE EXTERNAL TABLE accumulo_table_1(key int, value string)
STORED BY 'org.apache.hadoop.hive.accumulo.AccumuloStorageHandler'
WITH SERDEPROPERTIES ("accumulo.columns.mapping" = ":rowID,cf:string")
-TBLPROPERTIES ("accumulo.table.name" = "accumulo_table_0")
+TBLPROPERTIES ("accumulo.table.name" = "accumulo_table_0",
+ "external.table.purge" = "true")
PREHOOK: type: CREATETABLE
PREHOOK: Output: database:default
PREHOOK: Output: default@accumulo_table_1
-POSTHOOK: query: CREATE TABLE accumulo_table_1(key int, value string)
+POSTHOOK: query: CREATE EXTERNAL TABLE accumulo_table_1(key int, value string)
STORED BY 'org.apache.hadoop.hive.accumulo.AccumuloStorageHandler'
WITH SERDEPROPERTIES ("accumulo.columns.mapping" = ":rowID,cf:string")
-TBLPROPERTIES ("accumulo.table.name" = "accumulo_table_0")
+TBLPROPERTIES ("accumulo.table.name" = "accumulo_table_0",
+ "external.table.purge" = "true")
POSTHOOK: type: CREATETABLE
POSTHOOK: Output: database:default
POSTHOOK: Output: default@accumulo_table_1
@@ -393,15 +395,17 @@ PREHOOK: query: DROP TABLE empty_accumulo_table
PREHOOK: type: DROPTABLE
POSTHOOK: query: DROP TABLE empty_accumulo_table
POSTHOOK: type: DROPTABLE
-PREHOOK: query: CREATE TABLE empty_accumulo_table(key int, value string)
+PREHOOK: query: CREATE EXTERNAL TABLE empty_accumulo_table(key int, value string)
STORED BY 'org.apache.hadoop.hive.accumulo.AccumuloStorageHandler'
WITH SERDEPROPERTIES ("accumulo.columns.mapping" = ":rowID,cf:string")
+TBLPROPERTIES ("external.table.purge" = "true")
PREHOOK: type: CREATETABLE
PREHOOK: Output: database:default
PREHOOK: Output: default@empty_accumulo_table
-POSTHOOK: query: CREATE TABLE empty_accumulo_table(key int, value string)
+POSTHOOK: query: CREATE EXTERNAL TABLE empty_accumulo_table(key int, value string)
STORED BY 'org.apache.hadoop.hive.accumulo.AccumuloStorageHandler'
WITH SERDEPROPERTIES ("accumulo.columns.mapping" = ":rowID,cf:string")
+TBLPROPERTIES ("external.table.purge" = "true")
POSTHOOK: type: CREATETABLE
POSTHOOK: Output: database:default
POSTHOOK: Output: default@empty_accumulo_table
@@ -465,19 +469,21 @@ POSTHOOK: Input: default@src
#### A masked pattern was here ####
155
500
-PREHOOK: query: CREATE TABLE accumulo_table_3(key int, value string, count int)
+PREHOOK: query: CREATE EXTERNAL TABLE accumulo_table_3(key int, value string, count int)
STORED BY 'org.apache.hadoop.hive.accumulo.AccumuloStorageHandler'
WITH SERDEPROPERTIES (
"accumulo.columns.mapping" = ":rowID,cf:val,cf2:count"
)
+TBLPROPERTIES ("external.table.purge" = "true")
PREHOOK: type: CREATETABLE
PREHOOK: Output: database:default
PREHOOK: Output: default@accumulo_table_3
-POSTHOOK: query: CREATE TABLE accumulo_table_3(key int, value string, count int)
+POSTHOOK: query: CREATE EXTERNAL TABLE accumulo_table_3(key int, value string, count int)
STORED BY 'org.apache.hadoop.hive.accumulo.AccumuloStorageHandler'
WITH SERDEPROPERTIES (
"accumulo.columns.mapping" = ":rowID,cf:val,cf2:count"
)
+TBLPROPERTIES ("external.table.purge" = "true")
POSTHOOK: type: CREATETABLE
POSTHOOK: Output: database:default
POSTHOOK: Output: default@accumulo_table_3
@@ -663,19 +669,21 @@ PREHOOK: query: DROP TABLE accumulo_table_4
PREHOOK: type: DROPTABLE
POSTHOOK: query: DROP TABLE accumulo_table_4
POSTHOOK: type: DROPTABLE
-PREHOOK: query: CREATE TABLE accumulo_table_4(key int, value1 string, value2 int, value3 int)
+PREHOOK: query: CREATE EXTERNAL TABLE accumulo_table_4(key int, value1 string, value2 int, value3 int)
STORED BY 'org.apache.hadoop.hive.accumulo.AccumuloStorageHandler'
WITH SERDEPROPERTIES (
"accumulo.columns.mapping" = ":rowID,a:b,a:c,d:e"
)
+TBLPROPERTIES ("external.table.purge" = "true")
PREHOOK: type: CREATETABLE
PREHOOK: Output: database:default
PREHOOK: Output: default@accumulo_table_4
-POSTHOOK: query: CREATE TABLE accumulo_table_4(key int, value1 string, value2 int, value3 int)
+POSTHOOK: query: CREATE EXTERNAL TABLE accumulo_table_4(key int, value1 string, value2 int, value3 int)
STORED BY 'org.apache.hadoop.hive.accumulo.AccumuloStorageHandler'
WITH SERDEPROPERTIES (
"accumulo.columns.mapping" = ":rowID,a:b,a:c,d:e"
)
+TBLPROPERTIES ("external.table.purge" = "true")
POSTHOOK: type: CREATETABLE
POSTHOOK: Output: database:default
POSTHOOK: Output: default@accumulo_table_4
@@ -731,19 +739,21 @@ PREHOOK: query: DROP TABLE accumulo_table_6
PREHOOK: type: DROPTABLE
POSTHOOK: query: DROP TABLE accumulo_table_6
POSTHOOK: type: DROPTABLE
-PREHOOK: query: CREATE TABLE accumulo_table_6(key int, value map<string,string>)
+PREHOOK: query: CREATE EXTERNAL TABLE accumulo_table_6(key int, value map<string,string>)
STORED BY 'org.apache.hadoop.hive.accumulo.AccumuloStorageHandler'
WITH SERDEPROPERTIES (
"accumulo.columns.mapping" = ":rowID,cf:*"
)
+TBLPROPERTIES ("external.table.purge" = "true")
PREHOOK: type: CREATETABLE
PREHOOK: Output: database:default
PREHOOK: Output: default@accumulo_table_6
-POSTHOOK: query: CREATE TABLE accumulo_table_6(key int, value map<string,string>)
+POSTHOOK: query: CREATE EXTERNAL TABLE accumulo_table_6(key int, value map<string,string>)
STORED BY 'org.apache.hadoop.hive.accumulo.AccumuloStorageHandler'
WITH SERDEPROPERTIES (
"accumulo.columns.mapping" = ":rowID,cf:*"
)
+TBLPROPERTIES ("external.table.purge" = "true")
POSTHOOK: type: CREATETABLE
POSTHOOK: Output: database:default
POSTHOOK: Output: default@accumulo_table_6
@@ -771,19 +781,21 @@ PREHOOK: query: DROP TABLE accumulo_table_7
PREHOOK: type: DROPTABLE
POSTHOOK: query: DROP TABLE accumulo_table_7
POSTHOOK: type: DROPTABLE
-PREHOOK: query: CREATE TABLE accumulo_table_7(value map<string,string>, key int)
+PREHOOK: query: CREATE EXTERNAL TABLE accumulo_table_7(value map<string,string>, key int)
STORED BY 'org.apache.hadoop.hive.accumulo.AccumuloStorageHandler'
WITH SERDEPROPERTIES (
"accumulo.columns.mapping" = "cf:*,:rowID"
)
+TBLPROPERTIES ("external.table.purge" = "true")
PREHOOK: type: CREATETABLE
PREHOOK: Output: database:default
PREHOOK: Output: default@accumulo_table_7
-POSTHOOK: query: CREATE TABLE accumulo_table_7(value map<string,string>, key int)
+POSTHOOK: query: CREATE EXTERNAL TABLE accumulo_table_7(value map<string,string>, key int)
STORED BY 'org.apache.hadoop.hive.accumulo.AccumuloStorageHandler'
WITH SERDEPROPERTIES (
"accumulo.columns.mapping" = "cf:*,:rowID"
)
+TBLPROPERTIES ("external.table.purge" = "true")
POSTHOOK: type: CREATETABLE
POSTHOOK: Output: database:default
POSTHOOK: Output: default@accumulo_table_7
@@ -813,19 +825,21 @@ PREHOOK: query: DROP TABLE accumulo_table_8
PREHOOK: type: DROPTABLE
POSTHOOK: query: DROP TABLE accumulo_table_8
POSTHOOK: type: DROPTABLE
-PREHOOK: query: CREATE TABLE accumulo_table_8(key int, value1 string, value2 int, value3 int)
+PREHOOK: query: CREATE EXTERNAL TABLE accumulo_table_8(key int, value1 string, value2 int, value3 int)
STORED BY 'org.apache.hadoop.hive.accumulo.AccumuloStorageHandler'
WITH SERDEPROPERTIES (
"accumulo.columns.mapping" = ":rowID,a:b,a:c,d:e"
)
+TBLPROPERTIES ("external.table.purge" = "true")
PREHOOK: type: CREATETABLE
PREHOOK: Output: database:default
PREHOOK: Output: default@accumulo_table_8
-POSTHOOK: query: CREATE TABLE accumulo_table_8(key int, value1 string, value2 int, value3 int)
+POSTHOOK: query: CREATE EXTERNAL TABLE accumulo_table_8(key int, value1 string, value2 int, value3 int)
STORED BY 'org.apache.hadoop.hive.accumulo.AccumuloStorageHandler'
WITH SERDEPROPERTIES (
"accumulo.columns.mapping" = ":rowID,a:b,a:c,d:e"
)
+TBLPROPERTIES ("external.table.purge" = "true")
POSTHOOK: type: CREATETABLE
POSTHOOK: Output: database:default
POSTHOOK: Output: default@accumulo_table_8
http://git-wip-us.apache.org/repos/asf/hive/blob/c4c55d2a/accumulo-handler/src/test/results/positive/accumulo_single_sourced_multi_insert.q.out
----------------------------------------------------------------------
diff --git a/accumulo-handler/src/test/results/positive/accumulo_single_sourced_multi_insert.q.out b/accumulo-handler/src/test/results/positive/accumulo_single_sourced_multi_insert.q.out
index 5905ecd..7e36206 100644
--- a/accumulo-handler/src/test/results/positive/accumulo_single_sourced_multi_insert.q.out
+++ b/accumulo-handler/src/test/results/positive/accumulo_single_sourced_multi_insert.q.out
@@ -6,15 +6,17 @@ POSTHOOK: query: CREATE TABLE src_x1(key string, value string)
POSTHOOK: type: CREATETABLE
POSTHOOK: Output: database:default
POSTHOOK: Output: default@src_x1
-PREHOOK: query: CREATE TABLE src_x2(key string, value string)
+PREHOOK: query: CREATE EXTERNAL TABLE src_x2(key string, value string)
STORED BY 'org.apache.hadoop.hive.accumulo.AccumuloStorageHandler'
WITH SERDEPROPERTIES ("accumulo.columns.mapping" = ":rowid, cf:value")
+TBLPROPERTIES ("external.table.purge" = "true")
PREHOOK: type: CREATETABLE
PREHOOK: Output: database:default
PREHOOK: Output: default@src_x2
-POSTHOOK: query: CREATE TABLE src_x2(key string, value string)
+POSTHOOK: query: CREATE EXTERNAL TABLE src_x2(key string, value string)
STORED BY 'org.apache.hadoop.hive.accumulo.AccumuloStorageHandler'
WITH SERDEPROPERTIES ("accumulo.columns.mapping" = ":rowid, cf:value")
+TBLPROPERTIES ("external.table.purge" = "true")
POSTHOOK: type: CREATETABLE
POSTHOOK: Output: database:default
POSTHOOK: Output: default@src_x2