Skip to content

Commit

Permalink
update desc of METASTORE_PARTITIONED and update ut
Browse files Browse the repository at this point in the history
dropPartition throw exception when table is nul
  • Loading branch information
jerry-024 committed Dec 30, 2024
1 parent 1dfe8eb commit 427f5a7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,8 @@ public void dropPartition(Identifier identifier, Map<String, String> partitions)
Table table = getTable(identifier);
if (table != null) {
cleanPartitionsInFileSystem(table, partitions);
} else {
throw new TableNotExistException(identifier);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,5 @@ public class RESTCatalogOptions {
ConfigOptions.key("metastore-partitioned")
.booleanType()
.defaultValue(false)
.withDescription("REST Catalog whether support list partitions.");
.withDescription("REST Catalog Server whether support list partitions.");
}
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ public void testDropPartition() throws Exception {
Map<String, String> partitionSpec = new HashMap<>();
GetTableResponse response = MockRESTMessage.getTableResponse();
partitionSpec.put(response.getSchema().primaryKeys().get(0), "1");
mockResponse(mapper.writeValueAsString(new SuccessResponse()), 200);
mockResponse(mapper.writeValueAsString(""), 200);
mockResponse(mapper.writeValueAsString(response), 200);
doNothing().when(mockRestCatalog).cleanPartitionsInFileSystem(any(), any());
assertDoesNotThrow(
Expand All @@ -420,7 +420,7 @@ public void testDropPartitionWhenPartitionNoExist() throws Exception {
Map<String, String> partitionSpec = new HashMap<>();
GetTableResponse response = MockRESTMessage.getTableResponse();
partitionSpec.put(response.getSchema().primaryKeys().get(0), "1");
mockResponse(mapper.writeValueAsString(new SuccessResponse()), 404);
mockResponse(mapper.writeValueAsString(""), 404);
mockResponse(mapper.writeValueAsString(response), 200);
doNothing().when(mockRestCatalog).cleanPartitionsInFileSystem(any(), any());
assertDoesNotThrow(
Expand All @@ -438,7 +438,7 @@ public void testDropPartitionWhenTableNoPermission() throws Exception {
Map<String, String> partitionSpec = new HashMap<>();
GetTableResponse response = MockRESTMessage.getTableResponse();
partitionSpec.put(response.getSchema().primaryKeys().get(0), "1");
mockResponse(mapper.writeValueAsString(new SuccessResponse()), 403);
mockResponse(mapper.writeValueAsString(""), 403);
doNothing().when(mockRestCatalog).cleanPartitionsInFileSystem(any(), any());
assertThrows(
Catalog.TableNoPermissionException.class,
Expand Down

0 comments on commit 427f5a7

Please sign in to comment.