2828import org .apache .hadoop .hive .conf .HiveConf ;
2929import org .apache .hadoop .hive .ql .DriverFactory ;
3030import org .apache .hadoop .hive .ql .IDriver ;
31- import org .apache .hadoop .hive .ql .processors .CommandProcessorResponse ;
31+ import org .apache .hadoop .hive .ql .processors .CommandProcessorException ;
3232import org .apache .hadoop .hive .ql .session .SessionState ;
3333
3434/**
@@ -58,11 +58,11 @@ public EmbeddedMetastoreService(String baseDirPath) throws IOException {
5858 String testWarehouseDirPath = makePathASafeFileName (testDataDirPath + "/warehouse" );
5959
6060 hiveConf = new HiveConf (getClass ());
61- hiveConf .setVar (HiveConf .ConfVars .PREEXECHOOKS , "" );
62- hiveConf .setVar (HiveConf .ConfVars .POSTEXECHOOKS , "" );
61+ hiveConf .setVar (HiveConf .ConfVars .PRE_EXEC_HOOKS , "" );
62+ hiveConf .setVar (HiveConf .ConfVars .POST_EXEC_HOOKS , "" );
6363 hiveConf .setBoolVar (HiveConf .ConfVars .HIVE_SUPPORT_CONCURRENCY , false );
64- hiveConf .setVar (HiveConf .ConfVars .METASTOREWAREHOUSE , testWarehouseDirPath );
65- hiveConf .setBoolVar (HiveConf .ConfVars .HIVEOPTIMIZEMETADATAQUERIES , true );
64+ hiveConf .setVar (HiveConf .ConfVars .METASTORE_WAREHOUSE , testWarehouseDirPath );
65+ hiveConf .setBoolVar (HiveConf .ConfVars .HIVE_OPTIMIZE_METADATA_QUERIES , true );
6666 hiveConf .setVar (
6767 HiveConf .ConfVars .HIVE_AUTHORIZATION_MANAGER ,
6868 "org.apache.hadoop.hive.ql.security.authorization.DefaultHiveAuthorizationProvider" );
@@ -75,9 +75,10 @@ public EmbeddedMetastoreService(String baseDirPath) throws IOException {
7575
7676 /** Executes the passed query on the embedded metastore service. */
7777 public void executeQuery (String query ) {
78- CommandProcessorResponse response = driver .run (query );
79- if (response .failed ()) {
80- throw new RuntimeException (response .getException ());
78+ try {
79+ driver .run (query );
80+ } catch (CommandProcessorException e ) {
81+ throw new RuntimeException (e );
8182 }
8283 }
8384
0 commit comments