-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[core] Support partition API #4786
Conversation
dropPartition throw exception when table is nul
bcc4ef1
to
427f5a7
Compare
private final Map<String, String> spec; | ||
|
||
@JsonProperty(FIELD_PARTITION_TYPE) | ||
private final RowType partitionType; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not add type in this class.
af813a6
to
4ec183c
Compare
checkNotSystemTable(identifier, "dropPartition"); | ||
dropPartitionMetadata(identifier, partitions); | ||
Table table = getTable(identifier); | ||
if (table != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is null? I think maybe getTable will throw TableNotExistsException.
@@ -71,4 +71,10 @@ public class RESTCatalogOptions { | |||
.stringType() | |||
.noDefaultValue() | |||
.withDescription("REST Catalog auth token provider path."); | |||
|
|||
public static final ConfigOption<Boolean> METASTORE_PARTITIONED = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use CoreOptions.metastore.partitioned-table
.
resourcePaths.partitions( | ||
identifier.getDatabaseName(), identifier.getTableName()), | ||
request, | ||
SuccessResponse.class, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here should return Partition?
request, | ||
headers()); | ||
} catch (NoSuchResourceException ignore) { | ||
return new SuccessResponse(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think here should throw table not exist exception?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when the partition's metadata doesn't exist in metadata, there may still be data in the filesystem. So we ignore this exception when dropping the partition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should return false instead of NoSuchResourceException?
throws TableNoPermissionException { | ||
try { | ||
DropPartitionRequest request = new DropPartitionRequest(partitions); | ||
return client.delete( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should return Partition?
@@ -434,6 +524,23 @@ protected GetTableResponse getTableResponse(Identifier identifier) | |||
} | |||
} | |||
|
|||
protected boolean dropPartitionMetadata(Identifier identifier, Map<String, String> partitions) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why need these tests invoking this method? Why not invoking catalog methods?
+1 |
Purpose
Support partition API
Linked issue: #4540
Tests
API and Format
Documentation