3838import org .apache .hadoop .fs .FileStatus ;
3939import org .apache .hadoop .fs .FileSystem ;
4040import org .apache .hadoop .fs .Path ;
41+ import org .apache .hadoop .hive .common .TableName ;
4142import org .apache .hadoop .hive .conf .HiveConf ;
4243import org .apache .hadoop .hive .conf .HiveConf .ConfVars ;
4344import org .apache .hadoop .hive .metastore .MetaStoreEventListener ;
@@ -747,9 +748,10 @@ public void testDropPartitionsWithPurge() throws Exception {
747748 public void testDropPartitionsByNames () throws Throwable {
748749 String catName = Warehouse .DEFAULT_CATALOG_NAME ;
749750 String dbName = Warehouse .DEFAULT_DATABASE_NAME ;
750- String tableName = "table_for_testDropPartitionsByNames" ;
751+ String tblName = "table_for_testDropPartitionsByNames" ;
752+ TableName tableName = new TableName (catName , dbName , tblName );
751753
752- Table table = createPartitionedTable (dbName , tableName );
754+ Table table = createPartitionedTable (dbName , tblName );
753755 for (int i = 10 ; i <= 12 ; i ++) {
754756 Map <String , String > partitionSpec = new ImmutableMap .Builder <String , String >()
755757 .put ("ds" , "20231129" )
@@ -763,13 +765,13 @@ public void testDropPartitionsByNames() throws Throwable {
763765
764766 RequestPartsSpec partsSpec = new RequestPartsSpec ();
765767 partsSpec .setNames (Arrays .asList ("ds=20231129/hr=10" ));
766- hm .dropPartitions (catName , dbName , tableName , partsSpec , PartitionDropOptions .instance ());
768+ hm .dropPartitions (tableName , partsSpec , PartitionDropOptions .instance ());
767769 assertEquals (2 , hm .getPartitions (table ).size ());
768770
769771 try {
770772 // drop missing partition name
771773 partsSpec .setNames (Arrays .asList ("ds=20231129/hr=10" , "ds=20231129/hr=11" ));
772- hm .dropPartitions (catName , dbName , tableName , partsSpec , PartitionDropOptions .instance ());
774+ hm .dropPartitions (tableName , partsSpec , PartitionDropOptions .instance ());
773775 fail ("Expected exception" );
774776 } catch (HiveException e ) {
775777 // expected
@@ -778,7 +780,7 @@ public void testDropPartitionsByNames() throws Throwable {
778780 }
779781
780782 partsSpec .setNames (Arrays .asList ("ds=20231129/hr=12" , "ds=20231129/hr=11" ));
781- hm .dropPartitions (catName , dbName , tableName , partsSpec , PartitionDropOptions .instance ());
783+ hm .dropPartitions (tableName , partsSpec , PartitionDropOptions .instance ());
782784 assertEquals (0 , hm .getPartitions (table ).size ());
783785 }
784786
0 commit comments