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


##########
lance/lance-rest-server/src/main/java/org/apache/gravitino/lance/service/rest/LanceTableOperations.java:
##########
@@ -97,13 +104,28 @@ public Response createTable(
       MultivaluedMap<String, String> headersMap = headers.getRequestHeaders();
       String tableLocation = headersMap.getFirst(LANCE_TABLE_LOCATION_HEADER);
       String tableProperties = 
headersMap.getFirst(LANCE_TABLE_PROPERTIES_PREFIX_HEADER);
+      CreateTableRequest.ModeEnum modeEnum = 
CreateTableRequest.ModeEnum.fromValue(mode);
 
       Map<String, String> props =
-          JsonUtil.mapper().readValue(tableProperties, new TypeReference<>() 
{});
+          StringUtils.isBlank(tableProperties)
+              ? ImmutableMap.of()
+              : JsonUtil.parse(
+                  tableProperties,
+                  jsonNode -> {
+                    Map<String, String> map = new HashMap<>();
+                    jsonNode
+                        .fields()
+                        .forEachRemaining(
+                            entry -> {
+                              map.put(entry.getKey(), 
entry.getValue().asText());
+                            });
+                    return map;

Review Comment:
   You'd better define a helper function for this, and clearly describe why do 
you implement like this (not leave the comment here).



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