You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@linkis.apache.org by GitBox <gi...@apache.org> on 2023/01/03 02:10:09 UTC

[GitHub] [linkis] casionone commented on a diff in pull request #4072: [feat:4012] add partition examine api

casionone commented on code in PR #4072:
URL: https://github.com/apache/linkis/pull/4072#discussion_r1060233823


##########
linkis-public-enhancements/linkis-datasource/linkis-metadata/src/main/java/org/apache/linkis/metadata/restful/api/DataSourceRestfulApi.java:
##########
@@ -70,6 +70,45 @@ public Message queryDatabaseInfo(HttpServletRequest req) {
     }
   }
 
+  @ApiOperation(
+      value = "queryPartitionExists",
+      notes = "query partition exists",
+      response = Message.class)
+  @ApiImplicitParams({
+    @ApiImplicitParam(name = "database", dataType = "String", value = "database"),
+    @ApiImplicitParam(name = "table", dataType = "String", value = "table"),
+    @ApiImplicitParam(name = "partition", dataType = "String", value = "table")
+  })
+  @RequestMapping(path = "partitionExists", method = RequestMethod.GET)
+  public Message partitionExists(
+      @RequestParam(value = "database") String database,
+      @RequestParam(value = "table") String table,
+      @RequestParam(value = "partition") String partition,
+      HttpServletRequest req) {
+    String userName = ModuleUserUtils.getOperationUser(req, "query partition exists");
+    try {
+      if (StringUtils.isEmpty(database)) {
+        return Message.error("'database' is missing[缺少数据库]");

Review Comment:
   Batter to use `StringUtils.isBlank`



-- 
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: notifications-unsubscribe@linkis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@linkis.apache.org
For additional commands, e-mail: notifications-help@linkis.apache.org