yuqi1129 commented on code in PR #9201:
URL: https://github.com/apache/gravitino/pull/9201#discussion_r2554977279
##########
lance/lance-rest-server/src/main/java/org/apache/gravitino/lance/service/rest/LanceTableOperations.java:
##########
@@ -191,6 +193,45 @@ public Response deregisterTable(
}
}
+ @POST
+ @Path("/exists")
+ @Timed(name = "table-exists." + MetricNames.HTTP_PROCESS_DURATION, absolute
= true)
+ @ResponseMetered(name = "table-exists", absolute = true)
+ public Response tableExists(
+ @PathParam("id") String tableId,
+ @QueryParam("delimiter") @DefaultValue("$") String delimiter,
+ @Context HttpHeaders headers,
+ TableExistsRequest tableExistsRequest) {
+ try {
+ // True if exists, false no found and other errors
+ boolean exists = lanceNamespace.asTableOps().tableExists(tableId,
delimiter);
+ if (exists) {
+ return Response.status(Response.Status.OK).build();
+ }
+ return Response.status(Response.Status.NOT_FOUND).build();
Review Comment:
In the Lance REST spec, dropping a non-existent table will throw an
exception, which is different from that in the Gravitino server.
--
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]