@Override public void close() { coreDriver.close(); }
@Override public void close() throws IOException { try { LOG.info("DriverCleanup for LLAP splits: {}", applicationId); driver.releaseLocksAndCommitOrRollback(true); driver.close(); driver.destroy(); txnManager.closeTxnManager(); } catch (Exception err) { LOG.error("Error closing driver resources", err); throw new IOException(err); } }
SessionState.start(new CliSessionState(hiveConf)); driver.run(hql.toString()); driver.close();
@AfterClass public static void cleanUp() throws Exception { driver.close(); driver.destroy(); }
@After public void tearDown() throws Exception { if (d != null) { d.close(); d.destroy(); d = null; } }
@After public void tearDown() throws Exception { try { if (d != null) { dropTables(); d.close(); d.destroy(); d = null; } } finally { TxnDbUtil.cleanDb(hiveConf); FileUtils.deleteDirectory(new File(getTestDataDir())); } } protected String getWarehouseDir() {
@After public void tearDown() throws Exception { try { if (d != null) { dropTables(); d.close(); d.destroy(); d = null; } TxnDbUtil.cleanDb(hiveConf); } finally { FileUtils.deleteDirectory(new File(TEST_DATA_DIR)); } } @Test
driver.close(); driver.destroy();
@Override public void run() { SessionState ss = SessionState.start(hiveConf); try { ss.applyAuthorizationPolicy(); } catch (HiveException e) { throw new RuntimeException(e); } QueryState qs = new QueryState.Builder().withHiveConf(hiveConf).nonIsolated().build(); Driver d = new Driver(qs, null); try { LOG.info("Ready to run the query: " + query); syncThreadStart(cdlIn, cdlOut); try { CommandProcessorResponse cpr = d.run(query); if(cpr.getResponseCode() != 0) { throw new RuntimeException(query + " failed: " + cpr); } d.getResults(new ArrayList<String>()); } catch (Exception e) { throw new RuntimeException(e); } } finally { d.close(); } } }
@Test public void testInsertOverwriteToAcidWithUnionRemove() throws Exception { hiveConf.setBoolVar(HiveConf.ConfVars.HIVE_OPTIMIZE_UNION_REMOVE, true); hiveConf.setVar(HiveConf.ConfVars.HIVEFETCHTASKCONVERSION, "none"); d.close(); d = new Driver(hiveConf); int[][] values = {{1, 2}, {3, 4}, {5, 6}, {7, 8}, {9, 10}}; runStatementOnDriver("drop table if exists T"); runStatementOnDriver("create table T (a int, b int) stored as ORC TBLPROPERTIES ('transactional'='true')"); CommandProcessorResponse cpr = runStatementOnDriverNegative( "insert overwrite table T select a, b from " + TxnCommandsBaseForTests.Table.ACIDTBL + " where a between 1 and 3 group by a, b union all select a, b from " + TxnCommandsBaseForTests.Table.ACIDTBL + " where a between 5 and 7 union all select a, b from " + TxnCommandsBaseForTests.Table.ACIDTBL + " where a >= 9"); Assert.assertTrue("", cpr.getErrorMessage().contains("not supported due to OVERWRITE and UNION ALL")); } /**
driver.close(); driver.destroy();
driver.close(); driver.destroy();
driver.getResults(result); assertEquals(20, result.size()); driver.close();
hiveConf.setBoolVar(HiveConf.ConfVars.HIVE_OPTIMIZE_UNION_REMOVE, true); hiveConf.setVar(HiveConf.ConfVars.HIVEFETCHTASKCONVERSION, "none"); d.close(); d = new Driver(hiveConf); int[][] values = {{1,2},{3,4},{5,6},{7,8},{9,10}};
private void cleanup(OperationState state) throws HiveSQLException { setState(state); if (shouldRunAsync()) { Future<?> backgroundHandle = getBackgroundHandle(); if (backgroundHandle != null) { backgroundHandle.cancel(true); } } if (driver != null) { driver.close(); driver.destroy(); } driver = null; SessionState ss = SessionState.get(); if (ss.getTmpOutputFile() != null) { ss.getTmpOutputFile().delete(); } }
private void cleanup(OperationState state) throws HiveSQLException { setState(state); if (shouldRunAsync()) { Future<?> backgroundHandle = getBackgroundHandle(); if (backgroundHandle != null) { backgroundHandle.cancel(true); } } if (driver != null) { driver.close(); driver.destroy(); } driver = null; SessionState ss = SessionState.get(); if (ss.getTmpOutputFile() != null) { ss.getTmpOutputFile().delete(); } }
private void cleanup(OperationState state) throws HiveSQLException { setState(state); if (shouldRunAsync()) { Future<?> backgroundHandle = getBackgroundHandle(); if (backgroundHandle != null) { backgroundHandle.cancel(true); } } if (driver != null) { driver.close(); driver.destroy(); } driver = null; SessionState ss = SessionState.get(); if (ss.getTmpOutputFile() != null) { ss.getTmpOutputFile().delete(); } }
private void cleanup(OperationState state) throws HiveSQLException { setState(state); if (shouldRunAsync()) { Future<?> backgroundHandle = getBackgroundHandle(); if (backgroundHandle != null) { backgroundHandle.cancel(true); } } if (driver != null) { driver.close(); driver.destroy(); } driver = null; SessionState ss = SessionState.get(); if (ss.getTmpOutputFile() != null) { ss.getTmpOutputFile().delete(); } }