yunchipang commented on code in PR #7626:
URL: https://github.com/apache/gravitino/pull/7626#discussion_r2198332909
##########
iceberg/iceberg-rest-server/src/main/java/org/apache/gravitino/iceberg/service/rest/IcebergTableOperations.java:
##########
@@ -89,13 +90,26 @@ public IcebergTableOperations(
@Timed(name = "list-table." + MetricNames.HTTP_PROCESS_DURATION, absolute =
true)
@ResponseMetered(name = "list-table", absolute = true)
public Response listTable(
- @PathParam("prefix") String prefix, @Encoded() @PathParam("namespace")
String namespace) {
+ @PathParam("prefix") String prefix, @Encoded() @PathParam("namespace")
String namespace)
+ throws Exception {
String catalogName = IcebergRestUtils.getCatalogName(prefix);
Namespace icebergNS = RESTUtil.decodeNamespace(namespace);
- LOG.info("List Iceberg tables, catalog: {}, namespace: {}", catalogName,
icebergNS);
- IcebergRequestContext context = new
IcebergRequestContext(httpServletRequest(), catalogName);
- ListTablesResponse listTablesResponse =
tableOperationDispatcher.listTable(context, icebergNS);
- return IcebergRestUtils.ok(listTablesResponse);
+ LOG.info(
+ "Received list Iceberg tables request, catalog: {}, namespace: {}",
catalogName, icebergNS);
+ return Utils.doAs(
+ httpRequest,
+ () -> {
+ IcebergRequestContext context =
+ new IcebergRequestContext(httpServletRequest(), catalogName);
+ ListTablesResponse listTablesResponse =
+ tableOperationDispatcher.listTable(context, icebergNS);
+ LOG.info(
Review Comment:
ok, fixed!
--
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]