mchades commented on code in PR #9016:
URL: https://github.com/apache/gravitino/pull/9016#discussion_r2493692799


##########
lance/lance-rest-server/src/main/java/org/apache/gravitino/lance/service/rest/LanceTableOperations.java:
##########
@@ -116,24 +126,33 @@ public Response createTable(
   @ResponseMetered(name = "create-empty-table", absolute = true)
   public Response createEmptyTable(
       @PathParam("id") String tableId,
-      @QueryParam("mode") @DefaultValue("create") String mode, // create, 
exist_ok, overwrite
       @QueryParam("delimiter") @DefaultValue(NAMESPACE_DELIMITER_DEFAULT) 
String delimiter,
+      CreateEmptyTableRequest request,
       @Context HttpHeaders headers) {
     try {
-      // Extract table properties from header
-      MultivaluedMap<String, String> headersMap = headers.getRequestHeaders();
-      String tableLocation = headersMap.getFirst(LANCE_TABLE_LOCATION_HEADER);
-      String tableProperties = 
headersMap.getFirst(LANCE_TABLE_PROPERTIES_PREFIX_HEADER);
+      validateCreateEmptyTableRequest(request);
 
+      String tableLocation = request.getLocation();
       Map<String, String> props =
-          StringUtils.isBlank(tableProperties)
-              ? Map.of()
-              : JsonUtil.mapper().readValue(tableProperties, new 
TypeReference<>() {});
+          request.getProperties() == null
+              ? Maps.newHashMap()
+              : Maps.newHashMap(request.getProperties());
+
       CreateTableResponse response =
           lanceNamespace
               .asTableOps()
-              .createTable(tableId, mode, delimiter, tableLocation, props, 
null);
-      return Response.ok(response).build();
+              .createTable(

Review Comment:
   I would suggest you add a `createEmptyTable` API in 
`lance/lance-common/src/main/java/org/apache/gravitino/lance/common/ops/LanceTableOperations.java`
 to align with the Lance REST operation



-- 
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]

Reply via email to