} catch (HiveException e) { System.err.println(StringUtils.stringifyException(e)); assertTrue("Unable to drop table: " + tableName, false); } catch (HiveException e) { System.err.println(StringUtils.stringifyException(e)); assertTrue("Unable to create table: " + tableName, false); } catch (HiveException e) { System.err.println(StringUtils.stringifyException(e)); assertTrue("Unable to fetch table: " + tableName, false); } catch (HiveException e) { System.err.println(StringUtils.stringifyException(e)); assertTrue("Unable to create parition for table: " + tableName, false);
/** * Test basic Hive class interaction, that: * - We can have different Hive objects throughout the lifetime of this thread. */ public void testHiveCloseCurrent() throws Throwable { Hive hive1 = Hive.get(); Hive.closeCurrent(); Hive hive2 = Hive.get(); Hive.closeCurrent(); assertTrue(hive1 != hive2); }
public void testHiveRefreshOnConfChange() throws Throwable{ Hive prevHiveObj = Hive.get(); prevHiveObj.getDatabaseCurrent(); Hive newHiveObj; //if HiveConf has not changed, same object should be returned HiveConf newHconf = new HiveConf(hiveConf); newHiveObj = Hive.get(newHconf); assertTrue(prevHiveObj == newHiveObj); //if needs refresh param is passed, it should return new object newHiveObj = Hive.get(newHconf, true); assertTrue(prevHiveObj != newHiveObj); //if HiveConf has changed, new object should be returned prevHiveObj = Hive.get(); prevHiveObj.getDatabaseCurrent(); //change value of a metavar config param in new hive conf newHconf = new HiveConf(hiveConf); newHconf.setIntVar(ConfVars.METASTORETHRIFTCONNECTIONRETRIES, newHconf.getIntVar(ConfVars.METASTORETHRIFTCONNECTIONRETRIES) + 1); newHiveObj = Hive.get(newHconf); assertTrue(prevHiveObj != newHiveObj); }
} catch (HiveException e1) { System.err.println(StringUtils.stringifyException(e1)); assertTrue("Unable to drop table", false); } catch (HiveException e) { System.err.println(StringUtils.stringifyException(e)); assertTrue("Unable to create table: " + tableName, false);
Path path1 = table1.getPath(); FileSystem fs = path1.getFileSystem(hiveConf); assertTrue(fs.exists(path1)); assertFalse(fs.exists(path1)); FileStatus after[] = fs.globStatus(pathglob); assertTrue("trash dir before and after DROP TABLE noPURGE are not different", before.length != after.length); assertEquals(ts.get(1), table2.getTableName()); Path path2 = table2.getPath(); assertTrue(fs.exists(path2)); Path trash2 = mergePaths(trashDir, path2); System.out.println("trashDir2 is " + trash2); assertEquals("trash dir before and after DROP TABLE PURGE are different", before.length, after.length); assertTrue("trash dir before and after DROP TABLE PURGE are different", Arrays.equals(before, after));
assertTrue(fs.exists(table1.getPath()));
} catch (HiveException e1) { e1.printStackTrace(); assertTrue("Unable to drop table", false); } catch (HiveException e) { e.printStackTrace(); assertTrue("Unable to set bucket column for table: " + tableName, false); } catch (HiveException e) { e.printStackTrace(); assertTrue("Unable to create table: " + tableName, false); assertNull("Unable to drop table ", ft2); } catch (HiveException e) { assertTrue("Unable to drop table: " + tableName, false);
assertTrue("Tables doesn't match: " + tableName + " (" + ft.getTTable() + "; " + tbl.getTTable() + ")", ft.getTTable().equals(tbl.getTTable())); assertEquals("SerializationLib is not set correctly", tbl } catch (HiveException e) { System.err.println(StringUtils.stringifyException(e)); assertTrue("Unable to fetch table correctly: " + tableName, false);