From d68e60dfad5f5d36b83d9332beed5258875482e3 Mon Sep 17 00:00:00 2001 From: v-kkhuang <62878639+v-kkhuang@users.noreply.github.com> Date: Tue, 31 Dec 2024 11:48:36 +0800 Subject: [PATCH] Dev 1.10.0 bug fix (#697) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Code Optimization * Code Optimization * Code Optimization * Code Optimization * fix miss code * New interface: Retrieve data source list based on type name * New interface: Retrieve data source list based on type name * bug fix * bug fix --------- Co-authored-by: “v_kkhuang” <“420895376@qq.com”> --- .../apache/linkis/metadata/service/impl/MdqServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linkis-public-enhancements/linkis-datasource/linkis-metadata/src/main/java/org/apache/linkis/metadata/service/impl/MdqServiceImpl.java b/linkis-public-enhancements/linkis-datasource/linkis-metadata/src/main/java/org/apache/linkis/metadata/service/impl/MdqServiceImpl.java index 25afc1c44a..dea17cca95 100644 --- a/linkis-public-enhancements/linkis-datasource/linkis-metadata/src/main/java/org/apache/linkis/metadata/service/impl/MdqServiceImpl.java +++ b/linkis-public-enhancements/linkis-datasource/linkis-metadata/src/main/java/org/apache/linkis/metadata/service/impl/MdqServiceImpl.java @@ -351,7 +351,7 @@ private MdqTablePartitionStatisticInfoVO create(String path) throws IOException } private Date getTableModificationTime(String tableLocation) throws IOException { - if (StringUtils.isNotBlank(tableLocation)) { + if (StringUtils.isNotBlank(tableLocation) && getRootHdfs().exists(new Path(tableLocation))) { FileStatus tableFile = getFileStatus(tableLocation); return new Date(tableFile.getModificationTime()); } @@ -360,7 +360,7 @@ private Date getTableModificationTime(String tableLocation) throws IOException { private int getPartitionsNum(String tableLocation) throws IOException { int partitionsNum = 0; - if (StringUtils.isNotBlank(tableLocation)) { + if (StringUtils.isNotBlank(tableLocation) && getRootHdfs().exists(new Path(tableLocation))) { FileStatus tableFile = getFileStatus(tableLocation); partitionsNum = getRootHdfs().listStatus(tableFile.getPath()).length; }