Skip to content
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

[#1769] feat(partition): Support listPartitions for Hive catalog #1799

Merged
merged 3 commits into from
Jan 31, 2024

Conversation

mchades
Copy link
Contributor

@mchades mchades commented Jan 30, 2024

What changes were proposed in this pull request?

Support listPartitions for Hive catalog

Why are the changes needed?

Fix: #1769

Does this PR introduce any user-facing change?

no

How was this patch tested?

tests added

@jerryshao
Copy link
Contributor

@mchades can you please fix the conflicts.

@mchades mchades requested a review from jerryshao January 30, 2024 14:46
@mchades mchades self-assigned this Jan 30, 2024
@@ -50,15 +53,21 @@ public Response listPartitionNames(
@PathParam("metalake") String metalake,
@PathParam("catalog") String catalog,
@PathParam("schema") String schema,
@PathParam("table") String table) {
@PathParam("table") String table,
@QueryParam("verbose") @DefaultValue("false") boolean verbose) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest to change the quey parameter to "details".

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

} else {
String[] partitionNames = loadTable.supportPartitions().listPartitionNames();
return Utils.ok(new PartitionNameListResponse((partitionNames)));
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also I think you miss the UTs here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@@ -211,6 +211,46 @@ public void testListPartitionNames() {
Assertions.assertTrue(errorResp2.getMessage().contains("test exception"));
}

@Test
public void testListPartitions() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add a test case returning empty partitions?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added to IT

@mchades mchades requested a review from jerryshao January 31, 2024 03:05
@jerryshao jerryshao merged commit 2a0a388 into apache:main Jan 31, 2024
12 checks passed
@mchades mchades deleted the list-parts branch November 22, 2024 03:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Subtask] Support listPartition for Hive catalog
2 participants