Repository: hive
Updated Branches:
  refs/heads/master a6091c32b -> 9925eb108


HIVE-21015: HCatLoader can't provide statistics for tables not in default DB 
(Adam Szita, reviewed by Peter Vary)


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

Branch: refs/heads/master
Commit: 9925eb1087fd8f09e93a444bfb79471680b80c64
Parents: a6091c3
Author: Adam Szita <sz...@cloudera.com>
Authored: Tue Dec 11 11:31:12 2018 +0100
Committer: Adam Szita <sz...@cloudera.com>
Committed: Tue Dec 11 11:32:25 2018 +0100

----------------------------------------------------------------------
 .../apache/hive/hcatalog/pig/HCatLoader.java    |  9 ++-
 .../hcatalog/pig/AbstractHCatLoaderTest.java    | 67 ++++++++++++++------
 .../hcatalog/pig/AbstractHCatStorerTest.java    | 40 ++++++------
 .../hive/hcatalog/pig/TestE2EScenarios.java     |  3 +-
 .../pig/TestHCatLoaderComplexSchema.java        |  2 +-
 .../hive/hcatalog/pig/TestHCatLoaderStorer.java |  4 +-
 .../hive/hcatalog/pig/TestHCatStorerMulti.java  |  2 +-
 7 files changed, 83 insertions(+), 44 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/9925eb10/hcatalog/hcatalog-pig-adapter/src/main/java/org/apache/hive/hcatalog/pig/HCatLoader.java
----------------------------------------------------------------------
diff --git 
a/hcatalog/hcatalog-pig-adapter/src/main/java/org/apache/hive/hcatalog/pig/HCatLoader.java
 
b/hcatalog/hcatalog-pig-adapter/src/main/java/org/apache/hive/hcatalog/pig/HCatLoader.java
index 696e081..dd957be 100644
--- 
a/hcatalog/hcatalog-pig-adapter/src/main/java/org/apache/hive/hcatalog/pig/HCatLoader.java
+++ 
b/hcatalog/hcatalog-pig-adapter/src/main/java/org/apache/hive/hcatalog/pig/HCatLoader.java
@@ -260,6 +260,10 @@ public class HCatLoader extends HCatBaseLoader {
   @Override
   public ResourceStatistics getStatistics(String location, Job job) throws 
IOException {
     try {
+      if (dbName == null || tableName == null) {
+        throw new IOException("DB or table name unset. setLocation() must be 
invoked on this " +
+                "loader to set them");
+      }
       ResourceStatistics stats = new ResourceStatistics();
       long inputSize = -1;
 
@@ -267,14 +271,15 @@ public class HCatLoader extends HCatBaseLoader {
               job.getConfiguration());
 
       for (InputJobInfo inputJobInfo : inputJobInfos) {
-        if (location.equals(inputJobInfo.getTableName())) {
+        if (dbName.equals(inputJobInfo.getDatabaseName()) && 
tableName.equals(inputJobInfo.getTableName())){
           inputSize = getSizeInBytes(inputJobInfo);
           break;
         }
       }
 
       if (inputSize == -1) {
-        throw new IOException("Could not calculate input size for location 
(table) " + location);
+        throw new IOException("Could not calculate input size for database: " 
+ dbName + ", " +
+                "table: " + tableName + ". Requested location:" + location);
       }
       stats.setSizeInBytes(inputSize);
       return stats;

http://git-wip-us.apache.org/repos/asf/hive/blob/9925eb10/hcatalog/hcatalog-pig-adapter/src/test/java/org/apache/hive/hcatalog/pig/AbstractHCatLoaderTest.java
----------------------------------------------------------------------
diff --git 
a/hcatalog/hcatalog-pig-adapter/src/test/java/org/apache/hive/hcatalog/pig/AbstractHCatLoaderTest.java
 
b/hcatalog/hcatalog-pig-adapter/src/test/java/org/apache/hive/hcatalog/pig/AbstractHCatLoaderTest.java
index 8d17608..4c4551c 100644
--- 
a/hcatalog/hcatalog-pig-adapter/src/test/java/org/apache/hive/hcatalog/pig/AbstractHCatLoaderTest.java
+++ 
b/hcatalog/hcatalog-pig-adapter/src/test/java/org/apache/hive/hcatalog/pig/AbstractHCatLoaderTest.java
@@ -78,6 +78,7 @@ public abstract class AbstractHCatLoaderTest extends 
HCatBaseTest {
   private static final String COMPLEX_TABLE = "junit_unparted_complex";
   private static final String PARTITIONED_TABLE = "junit_parted_basic";
   private static final String SPECIFIC_SIZE_TABLE = "junit_specific_size";
+  private static final String SPECIFIC_DATABASE = "junit_specific_db";
   private static final String SPECIFIC_SIZE_TABLE_2 = "junit_specific_size2";
   private static final String PARTITIONED_DATE_TABLE = "junit_parted_date";
 
@@ -99,11 +100,23 @@ public abstract class AbstractHCatLoaderTest extends 
HCatBaseTest {
     driver.run("drop table if exists " + tablename);
   }
 
-  private void createTable(String tablename, String schema, String 
partitionedBy) throws Exception {
-    createTable(tablename, schema, partitionedBy, driver, storageFormat);
+  private void createTable(String db, String tablename, String schema, String 
partitionedBy) throws
+          Exception {
+    createTable(db, tablename, schema, partitionedBy, driver, storageFormat);
   }
 
-  static void createTable(String tablename, String schema, String 
partitionedBy, IDriver driver, String storageFormat)
+  private void createTableDefaultDB(String tablename, String schema, String 
partitionedBy) throws
+          Exception {
+    createTable(null, tablename, schema, partitionedBy, driver, storageFormat);
+  }
+
+  static void createTableDefaultDB(String tablename, String schema, String 
partitionedBy, IDriver
+          driver, String storageFormat) throws Exception {
+    createTable(null, tablename, schema, partitionedBy, driver, storageFormat);
+  }
+
+  static void createTable(String db, String tablename, String schema, String 
partitionedBy, IDriver
+          driver, String storageFormat)
       throws Exception {
     String createTable;
     createTable = "create table " + tablename + "(" + schema + ") ";
@@ -113,11 +126,21 @@ public abstract class AbstractHCatLoaderTest extends 
HCatBaseTest {
     createTable = createTable + "stored as " +storageFormat;
     //HCat doesn't support transactional tables
     createTable += " TBLPROPERTIES ('transactional'='false')";
+    if (db != null) {
+      executeStatementOnDriver("create database if not exists " + db, driver);
+      executeStatementOnDriver("use " + db + "", driver);
+    } else {
+      executeStatementOnDriver("use default", driver);
+    }
     executeStatementOnDriver(createTable, driver);
   }
 
-  private void createTable(String tablename, String schema) throws Exception {
-    createTable(tablename, schema, null);
+  private void createTable(String db, String tablename, String schema) throws 
Exception {
+    createTable(db, tablename, schema, null);
+  }
+
+  private void createTableDefaultDB(String tablename, String schema) throws 
Exception {
+    createTable(null, tablename, schema, null);
   }
 
   /**
@@ -140,18 +163,18 @@ public abstract class AbstractHCatLoaderTest extends 
HCatBaseTest {
 
   @Before
   public void setUpTest() throws Exception {
-    createTable(BASIC_TABLE, "a int, b string");
-    createTable(COMPLEX_TABLE,
+    createTableDefaultDB(BASIC_TABLE, "a int, b string");
+    createTableDefaultDB(COMPLEX_TABLE,
       "name string, studentid int, "
         + "contact struct<phno:string,email:string>, "
         + "currently_registered_courses array<string>, "
         + "current_grades map<string,string>, "
         + "phnos array<struct<phno:string,type:string>>");
 
-    createTable(PARTITIONED_TABLE, "a int, b string", "bkt string");
-    createTable(SPECIFIC_SIZE_TABLE, "a int, b string");
-    createTable(SPECIFIC_SIZE_TABLE_2, "a int, b string");
-    createTable(PARTITIONED_DATE_TABLE, "b string", "dt date");
+    createTableDefaultDB(PARTITIONED_TABLE, "a int, b string", "bkt string");
+    createTableDefaultDB(SPECIFIC_SIZE_TABLE, "a int, b string");
+    createTable(SPECIFIC_DATABASE, SPECIFIC_SIZE_TABLE_2, "a int, b string");
+    createTableDefaultDB(PARTITIONED_DATE_TABLE, "b string", "dt date");
     AllTypesTable.setupAllTypesTable(driver);
 
     int LOOP_SIZE = 3;
@@ -187,6 +210,8 @@ public abstract class AbstractHCatLoaderTest extends 
HCatBaseTest {
 
     server.registerQuery("store A into '" + BASIC_TABLE + "' using 
org.apache.hive.hcatalog.pig.HCatStorer();", ++i);
     server.registerQuery("store A into '" + SPECIFIC_SIZE_TABLE + "' using 
org.apache.hive.hcatalog.pig.HCatStorer();", ++i);
+    server.registerQuery("store A into '" + SPECIFIC_DATABASE + "." 
+SPECIFIC_SIZE_TABLE_2 + "' " +
+            "using org.apache.hive" +".hcatalog.pig.HCatStorer();", ++i);
     server.registerQuery("B = foreach A generate a,b;", ++i);
     server.registerQuery("B2 = filter B by a < 2;", ++i);
     server.registerQuery("store B2 into '" + PARTITIONED_TABLE + "' using 
org.apache.hive.hcatalog.pig.HCatStorer('bkt=0');", ++i);
@@ -213,9 +238,10 @@ public abstract class AbstractHCatLoaderTest extends 
HCatBaseTest {
         dropTable(COMPLEX_TABLE);
         dropTable(PARTITIONED_TABLE);
         dropTable(SPECIFIC_SIZE_TABLE);
-        dropTable(SPECIFIC_SIZE_TABLE_2);
         dropTable(PARTITIONED_DATE_TABLE);
         dropTable(AllTypesTable.ALL_PRIMITIVE_TYPES_TABLE);
+        executeStatementOnDriver("drop database if exists " + 
SPECIFIC_DATABASE + " cascade",
+                driver);
       }
     } finally {
       FileUtils.deleteDirectory(new File(TEST_DATA_DIR));
@@ -578,7 +604,8 @@ public abstract class AbstractHCatLoaderTest extends 
HCatBaseTest {
     RandomAccessFile randomAccessFile = new RandomAccessFile(file, "rw");
     randomAccessFile.setLength(987654321L);
     randomAccessFile.close();
-    file = new File(TEST_WAREHOUSE_DIR + "/" + SPECIFIC_SIZE_TABLE_2 + 
"/part-m-00000");
+    file = new File(TEST_WAREHOUSE_DIR + "/" + SPECIFIC_DATABASE + ".db/" +
+            SPECIFIC_SIZE_TABLE_2 + "/part-m-00000");
     file.deleteOnExit();
     randomAccessFile = new RandomAccessFile(file, "rw");
     randomAccessFile.setLength(12345678L);
@@ -590,11 +617,13 @@ public abstract class AbstractHCatLoaderTest extends 
HCatBaseTest {
     hCatLoader.setUDFContextSignature("testGetInputBytesMultipleTables" + 
SPECIFIC_SIZE_TABLE);
     hCatLoader.setLocation(SPECIFIC_SIZE_TABLE, job);
 
-    hCatLoader.setUDFContextSignature("testGetInputBytesMultipleTables" + 
SPECIFIC_SIZE_TABLE_2);
-    hCatLoader.setLocation(SPECIFIC_SIZE_TABLE_2, job);
+    HCatLoader hCatLoader2 = new HCatLoader();
+    hCatLoader2.setUDFContextSignature("testGetInputBytesMultipleTables" + 
SPECIFIC_SIZE_TABLE_2);
+    hCatLoader2.setLocation(SPECIFIC_DATABASE + "." + SPECIFIC_SIZE_TABLE_2, 
job);
 
-    hCatLoader.setUDFContextSignature("testGetInputBytesMultipleTables" + 
PARTITIONED_TABLE);
-    hCatLoader.setLocation(PARTITIONED_TABLE, job);
+    HCatLoader hCatLoader3 = new HCatLoader();
+    hCatLoader3.setUDFContextSignature("testGetInputBytesMultipleTables" + 
PARTITIONED_TABLE);
+    hCatLoader3.setLocation(PARTITIONED_TABLE, job);
 
     long specificTableSize = -1;
     long specificTableSize2 = -1;
@@ -604,11 +633,11 @@ public abstract class AbstractHCatLoaderTest extends 
HCatBaseTest {
     specificTableSize=statistics.getSizeInBytes();
     assertEquals(987654321, specificTableSize);
 
-    statistics = hCatLoader.getStatistics(SPECIFIC_SIZE_TABLE_2, job);
+    statistics = hCatLoader2.getStatistics(SPECIFIC_SIZE_TABLE_2, job);
     specificTableSize2=statistics.getSizeInBytes();
     assertEquals(12345678, specificTableSize2);
 
-    statistics = hCatLoader.getStatistics(PARTITIONED_TABLE, job);
+    statistics = hCatLoader3.getStatistics(PARTITIONED_TABLE, job);
     partitionedTableSize=statistics.getSizeInBytes();
     //Partitioned table size here is dependent on underlying storage format, 
it's ~ 20<x<2000
     assertTrue(20 < partitionedTableSize && partitionedTableSize < 2000);

http://git-wip-us.apache.org/repos/asf/hive/blob/9925eb10/hcatalog/hcatalog-pig-adapter/src/test/java/org/apache/hive/hcatalog/pig/AbstractHCatStorerTest.java
----------------------------------------------------------------------
diff --git 
a/hcatalog/hcatalog-pig-adapter/src/test/java/org/apache/hive/hcatalog/pig/AbstractHCatStorerTest.java
 
b/hcatalog/hcatalog-pig-adapter/src/test/java/org/apache/hive/hcatalog/pig/AbstractHCatStorerTest.java
index 19c30b0..99e5da4 100644
--- 
a/hcatalog/hcatalog-pig-adapter/src/test/java/org/apache/hive/hcatalog/pig/AbstractHCatStorerTest.java
+++ 
b/hcatalog/hcatalog-pig-adapter/src/test/java/org/apache/hive/hcatalog/pig/AbstractHCatStorerTest.java
@@ -265,7 +265,8 @@ public abstract class AbstractHCatStorerTest extends 
HCatBaseTest {
       String format) throws Exception {
     AbstractHCatLoaderTest.dropTable(tblName, driver);
     final String field = "f1";
-    AbstractHCatLoaderTest.createTable(tblName, field + " " + hiveType, null, 
driver, storageFormat);
+    AbstractHCatLoaderTest.createTableDefaultDB(tblName, field + " " + 
hiveType, null, driver,
+            storageFormat);
     HcatTestUtils.createTestDataFile(INPUT_FILE_NAME, new String[] { 
inputValue });
     LOG.debug("File=" + INPUT_FILE_NAME);
     dumpFile(INPUT_FILE_NAME);
@@ -344,7 +345,7 @@ public abstract class AbstractHCatStorerTest extends 
HCatBaseTest {
   public void testDateCharTypes() throws Exception {
     final String tblName = "junit_date_char";
     AbstractHCatLoaderTest.dropTable(tblName, driver);
-    AbstractHCatLoaderTest.createTable(tblName,
+    AbstractHCatLoaderTest.createTableDefaultDB(tblName,
         "id int, char5 char(5), varchar10 varchar(10), dec52 decimal(5,2)", 
null, driver,
         storageFormat);
     int NUM_ROWS = 5;
@@ -410,7 +411,8 @@ public abstract class AbstractHCatStorerTest extends 
HCatBaseTest {
   @Test
   public void testPartColsInData() throws Exception {
     AbstractHCatLoaderTest.dropTable("junit_unparted", driver);
-    AbstractHCatLoaderTest.createTable("junit_unparted","a int", "b string", 
driver, storageFormat);
+    AbstractHCatLoaderTest.createTableDefaultDB("junit_unparted", "a int", "b 
string", driver,
+            storageFormat);
 
     int LOOP_SIZE = 11;
     String[] input = new String[LOOP_SIZE];
@@ -444,7 +446,7 @@ public abstract class AbstractHCatStorerTest extends 
HCatBaseTest {
   public void testMultiPartColsInData() throws Exception {
 
     AbstractHCatLoaderTest.dropTable("employee", driver);
-    AbstractHCatLoaderTest.createTable("employee",
+    AbstractHCatLoaderTest.createTableDefaultDB("employee",
         "emp_id INT, emp_name STRING, emp_start_date STRING , emp_gender 
STRING",
         "emp_country STRING , emp_state STRING", driver, storageFormat);
 
@@ -495,7 +497,7 @@ public abstract class AbstractHCatStorerTest extends 
HCatBaseTest {
   public void testStoreInPartiitonedTbl() throws Exception {
 
     AbstractHCatLoaderTest.dropTable("junit_unparted", driver);
-    AbstractHCatLoaderTest.createTable("junit_unparted","a int", "b string",
+    AbstractHCatLoaderTest.createTableDefaultDB("junit_unparted", "a int", "b 
string",
         driver, storageFormat);
 
     int LOOP_SIZE = 11;
@@ -533,7 +535,8 @@ public abstract class AbstractHCatStorerTest extends 
HCatBaseTest {
   @Test
   public void testNoAlias() throws Exception {
     AbstractHCatLoaderTest.dropTable("junit_parted", driver);
-    AbstractHCatLoaderTest.createTable("junit_parted","a int, b string", "ds 
string", driver, storageFormat);
+    AbstractHCatLoaderTest.createTableDefaultDB("junit_parted", "a int, b 
string", "ds " +
+            "string", driver, storageFormat);
     PigServer server = createPigServer(false);
     boolean errCaught = false;
     try {
@@ -577,11 +580,11 @@ public abstract class AbstractHCatStorerTest extends 
HCatBaseTest {
   @Test
   public void testStoreMultiTables() throws Exception {
     AbstractHCatLoaderTest.dropTable("junit_unparted", driver);
-    AbstractHCatLoaderTest.createTable("junit_unparted","a int, b string", 
null,
+    AbstractHCatLoaderTest.createTableDefaultDB("junit_unparted", "a int, b 
string", null,
         driver, storageFormat);
 
     AbstractHCatLoaderTest.dropTable("junit_unparted2", driver);
-    AbstractHCatLoaderTest.createTable("junit_unparted2","a int, b string", 
null,
+    AbstractHCatLoaderTest.createTableDefaultDB("junit_unparted2", "a int, b 
string", null,
         driver, "RCFILE");
 
     int LOOP_SIZE = 3;
@@ -628,7 +631,7 @@ public abstract class AbstractHCatStorerTest extends 
HCatBaseTest {
   @Test
   public void testStoreWithNoSchema() throws Exception {
     AbstractHCatLoaderTest.dropTable("junit_unparted", driver);
-    AbstractHCatLoaderTest.createTable("junit_unparted","a int, b string", 
null,
+    AbstractHCatLoaderTest.createTableDefaultDB("junit_unparted", "a int, b 
string", null,
         driver, storageFormat);
 
     int LOOP_SIZE = 3;
@@ -664,7 +667,7 @@ public abstract class AbstractHCatStorerTest extends 
HCatBaseTest {
   @Test
   public void testStoreWithNoCtorArgs() throws Exception {
     AbstractHCatLoaderTest.dropTable("junit_unparted", driver);
-    AbstractHCatLoaderTest.createTable("junit_unparted","a int, b string", 
null,
+    AbstractHCatLoaderTest.createTableDefaultDB("junit_unparted", "a int, b 
string", null,
         driver, storageFormat);
 
     int LOOP_SIZE = 3;
@@ -701,7 +704,8 @@ public abstract class AbstractHCatStorerTest extends 
HCatBaseTest {
   public void testEmptyStore() throws Exception {
 
     AbstractHCatLoaderTest.dropTable("junit_unparted", driver);
-    AbstractHCatLoaderTest.createTable("junit_unparted","a int, b string", 
null, driver, storageFormat);
+    AbstractHCatLoaderTest.createTableDefaultDB("junit_unparted", "a int, b 
string", null,
+            driver, storageFormat);
 
     int LOOP_SIZE = 3;
     String[] input = new String[LOOP_SIZE * LOOP_SIZE];
@@ -733,7 +737,7 @@ public abstract class AbstractHCatStorerTest extends 
HCatBaseTest {
   @Test
   public void testBagNStruct() throws Exception {
     AbstractHCatLoaderTest.dropTable("junit_unparted", driver);
-    AbstractHCatLoaderTest.createTable("junit_unparted",
+    AbstractHCatLoaderTest.createTableDefaultDB("junit_unparted",
         "b string,a struct<a1:int>,  arr_of_struct array<string>, " +
             "arr_of_struct2 array<struct<s1:string,s2:string>>,  
arr_of_struct3 array<struct<s3:string>>",
         null, driver, storageFormat);
@@ -775,7 +779,7 @@ public abstract class AbstractHCatStorerTest extends 
HCatBaseTest {
   @Test
   public void testStoreFuncAllSimpleTypes() throws Exception {
     AbstractHCatLoaderTest.dropTable("junit_unparted", driver);
-    AbstractHCatLoaderTest.createTable("junit_unparted",
+    AbstractHCatLoaderTest.createTableDefaultDB("junit_unparted",
         "a int, b float, c double, d bigint, e string, h boolean, f binary, g 
binary", null,
         driver, storageFormat);
 
@@ -834,7 +838,7 @@ public abstract class AbstractHCatStorerTest extends 
HCatBaseTest {
   @Test
   public void testStoreFuncSimple() throws Exception {
     AbstractHCatLoaderTest.dropTable("junit_unparted", driver);
-    AbstractHCatLoaderTest.createTable("junit_unparted","a int, b string", 
null,
+    AbstractHCatLoaderTest.createTableDefaultDB("junit_unparted", "a int, b 
string", null,
         driver, storageFormat);
 
     int LOOP_SIZE = 3;
@@ -872,7 +876,7 @@ public abstract class AbstractHCatStorerTest extends 
HCatBaseTest {
   @Test
   public void testDynamicPartitioningMultiPartColsInDataPartialSpec() throws 
Exception {
     AbstractHCatLoaderTest.dropTable("employee", driver);
-    AbstractHCatLoaderTest.createTable("employee",
+    AbstractHCatLoaderTest.createTableDefaultDB("employee",
         "emp_id INT, emp_name STRING, emp_start_date STRING , emp_gender 
STRING",
         "emp_country STRING , emp_state STRING", driver, storageFormat);
 
@@ -905,7 +909,7 @@ public abstract class AbstractHCatStorerTest extends 
HCatBaseTest {
   @Test
   public void testDynamicPartitioningMultiPartColsInDataNoSpec() throws 
Exception {
     AbstractHCatLoaderTest.dropTable("employee", driver);
-    AbstractHCatLoaderTest.createTable("employee",
+    AbstractHCatLoaderTest.createTableDefaultDB("employee",
         "emp_id INT, emp_name STRING, emp_start_date STRING , emp_gender 
STRING",
         "emp_country STRING , emp_state STRING", driver, storageFormat);
 
@@ -937,7 +941,7 @@ public abstract class AbstractHCatStorerTest extends 
HCatBaseTest {
   @Test
   public void testDynamicPartitioningMultiPartColsNoDataInDataNoSpec() throws 
Exception {
     AbstractHCatLoaderTest.dropTable("employee", driver);
-    AbstractHCatLoaderTest.createTable("employee",
+    AbstractHCatLoaderTest.createTableDefaultDB("employee",
         "emp_id INT, emp_name STRING, emp_start_date STRING , emp_gender 
STRING",
         "emp_country STRING , emp_state STRING", driver, storageFormat);
 
@@ -963,7 +967,7 @@ public abstract class AbstractHCatStorerTest extends 
HCatBaseTest {
   @Test
   public void testPartitionPublish() throws Exception {
     AbstractHCatLoaderTest.dropTable("ptn_fail", driver);
-    AbstractHCatLoaderTest.createTable("ptn_fail","a int, c string", "b 
string",
+    AbstractHCatLoaderTest.createTableDefaultDB("ptn_fail", "a int, c string", 
"b string",
         driver, storageFormat);
 
     int LOOP_SIZE = 11;

http://git-wip-us.apache.org/repos/asf/hive/blob/9925eb10/hcatalog/hcatalog-pig-adapter/src/test/java/org/apache/hive/hcatalog/pig/TestE2EScenarios.java
----------------------------------------------------------------------
diff --git 
a/hcatalog/hcatalog-pig-adapter/src/test/java/org/apache/hive/hcatalog/pig/TestE2EScenarios.java
 
b/hcatalog/hcatalog-pig-adapter/src/test/java/org/apache/hive/hcatalog/pig/TestE2EScenarios.java
index 19246e6..e373f19 100644
--- 
a/hcatalog/hcatalog-pig-adapter/src/test/java/org/apache/hive/hcatalog/pig/TestE2EScenarios.java
+++ 
b/hcatalog/hcatalog-pig-adapter/src/test/java/org/apache/hive/hcatalog/pig/TestE2EScenarios.java
@@ -113,7 +113,8 @@ public class TestE2EScenarios {
 
   private void createTable(String tablename, String schema, String 
partitionedBy, String storageFormat)
       throws Exception {
-   AbstractHCatLoaderTest.createTable(tablename, schema, partitionedBy, 
driver, storageFormat);
+    AbstractHCatLoaderTest.createTableDefaultDB(tablename, schema, 
partitionedBy, driver,
+            storageFormat);
   }
 
   private void driverRun(String cmd) throws Exception {

http://git-wip-us.apache.org/repos/asf/hive/blob/9925eb10/hcatalog/hcatalog-pig-adapter/src/test/java/org/apache/hive/hcatalog/pig/TestHCatLoaderComplexSchema.java
----------------------------------------------------------------------
diff --git 
a/hcatalog/hcatalog-pig-adapter/src/test/java/org/apache/hive/hcatalog/pig/TestHCatLoaderComplexSchema.java
 
b/hcatalog/hcatalog-pig-adapter/src/test/java/org/apache/hive/hcatalog/pig/TestHCatLoaderComplexSchema.java
index 37e670c..b96479b 100644
--- 
a/hcatalog/hcatalog-pig-adapter/src/test/java/org/apache/hive/hcatalog/pig/TestHCatLoaderComplexSchema.java
+++ 
b/hcatalog/hcatalog-pig-adapter/src/test/java/org/apache/hive/hcatalog/pig/TestHCatLoaderComplexSchema.java
@@ -96,7 +96,7 @@ public class TestHCatLoaderComplexSchema {
   }
 
   private void createTable(String tablename, String schema, String 
partitionedBy) throws Exception {
-    AbstractHCatLoaderTest.createTable(tablename, schema, partitionedBy, 
driver, storageFormat);
+    AbstractHCatLoaderTest.createTableDefaultDB(tablename, schema, 
partitionedBy, driver, storageFormat);
   }
 
   private void createTable(String tablename, String schema) throws Exception {

http://git-wip-us.apache.org/repos/asf/hive/blob/9925eb10/hcatalog/hcatalog-pig-adapter/src/test/java/org/apache/hive/hcatalog/pig/TestHCatLoaderStorer.java
----------------------------------------------------------------------
diff --git 
a/hcatalog/hcatalog-pig-adapter/src/test/java/org/apache/hive/hcatalog/pig/TestHCatLoaderStorer.java
 
b/hcatalog/hcatalog-pig-adapter/src/test/java/org/apache/hive/hcatalog/pig/TestHCatLoaderStorer.java
index c7f2606..38e1e7e 100644
--- 
a/hcatalog/hcatalog-pig-adapter/src/test/java/org/apache/hive/hcatalog/pig/TestHCatLoaderStorer.java
+++ 
b/hcatalog/hcatalog-pig-adapter/src/test/java/org/apache/hive/hcatalog/pig/TestHCatLoaderStorer.java
@@ -65,8 +65,8 @@ public class TestHCatLoaderStorer extends HCatBaseTest {
       " row format delimited fields terminated by '\t' stored as textfile 
location '" +
       dataDir.toURI().getPath() + "'", driver);
     AbstractHCatLoaderTest.dropTable(tblName2, driver);
-    AbstractHCatLoaderTest.createTable(tblName2, "my_small_int smallint, 
my_tiny_int tinyint", null, driver,
-      "textfile");
+    AbstractHCatLoaderTest.createTableDefaultDB(tblName2, "my_small_int 
smallint, " +
+            "my_tiny_int " + "tinyint", null, driver, "textfile");
 
     LOG.debug("File=" + INPUT_FILE_NAME);
     TestHCatStorer.dumpFile(INPUT_FILE_NAME);

http://git-wip-us.apache.org/repos/asf/hive/blob/9925eb10/hcatalog/hcatalog-pig-adapter/src/test/java/org/apache/hive/hcatalog/pig/TestHCatStorerMulti.java
----------------------------------------------------------------------
diff --git 
a/hcatalog/hcatalog-pig-adapter/src/test/java/org/apache/hive/hcatalog/pig/TestHCatStorerMulti.java
 
b/hcatalog/hcatalog-pig-adapter/src/test/java/org/apache/hive/hcatalog/pig/TestHCatStorerMulti.java
index 65ad6ec..a0c5ce9 100644
--- 
a/hcatalog/hcatalog-pig-adapter/src/test/java/org/apache/hive/hcatalog/pig/TestHCatStorerMulti.java
+++ 
b/hcatalog/hcatalog-pig-adapter/src/test/java/org/apache/hive/hcatalog/pig/TestHCatStorerMulti.java
@@ -82,7 +82,7 @@ public class TestHCatStorerMulti {
   }
 
   private void createTable(String tablename, String schema, String 
partitionedBy) throws Exception {
-    AbstractHCatLoaderTest.createTable(tablename, schema, partitionedBy, 
driver, storageFormat);
+    AbstractHCatLoaderTest.createTableDefaultDB(tablename, schema, 
partitionedBy, driver, storageFormat);
   }
 
   private void createTable(String tablename, String schema) throws Exception {

Reply via email to