FANNG1 commented on code in PR #8592:
URL: https://github.com/apache/gravitino/pull/8592#discussion_r2362332714
##########
iceberg/iceberg-rest-server/src/main/java/org/apache/gravitino/iceberg/service/rest/IcebergTableOperations.java:
##########
@@ -332,6 +333,45 @@ private String
SerializeUpdateTableRequest(UpdateTableRequest updateTableRequest
}
}
+ @GET
+ @Path("{table}/credentials")
+ @Produces(MediaType.APPLICATION_JSON)
+ @Timed(name = "get-table-credentials." + MetricNames.HTTP_PROCESS_DURATION,
absolute = true)
+ @ResponseMetered(name = "get-table-credentials", absolute = true)
+ public Response getTableCredentials(
+ @PathParam("prefix") String prefix,
+ @Encoded() @PathParam("namespace") String namespace,
+ @PathParam("table") String table) {
+ String catalogName = IcebergRestUtils.getCatalogName(prefix);
+ Namespace icebergNS = RESTUtil.decodeNamespace(namespace);
+ LOG.info(
+ "Get Iceberg table credentials, catalog: {}, namespace: {}, table: {}",
+ catalogName,
+ icebergNS,
+ table);
+ try {
+ return Utils.doAs(
+ httpRequest,
+ () -> {
+ // Convert Iceberg table identifier to Gravitino NameIdentifier
+ TableIdentifier tableIdentifier = TableIdentifier.of(icebergNS,
table);
+ // First check if the table exists
+ IcebergRequestContext context =
+ new IcebergRequestContext(httpServletRequest(), catalogName);
+ boolean exists = tableOperationDispatcher.tableExists(context,
tableIdentifier);
Review Comment:
How about removing the table exists check since the load table will throw
table not found exception
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]