From c3c77790137bc3e7a725918d2be49cfd0e59155a Mon Sep 17 00:00:00 2001 From: v-kkhuang <62878639+v-kkhuang@users.noreply.github.com> Date: Tue, 10 Dec 2024 14:36:49 +0800 Subject: [PATCH] fix datasource error (#655) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: “v_kkhuang” <“420895376@qq.com”> --- .../org/apache/linkis/metadata/service/impl/MdqServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 4fa9f49175..25afc1c44a 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 @@ -376,7 +376,7 @@ public String getTableLocation(MetadataQueryParam queryParam) { private int getTableFileNum(String tableLocation) throws IOException { int tableFileNum = 0; - if (StringUtils.isNotBlank(tableLocation)) { + if (StringUtils.isNotBlank(tableLocation) && getRootHdfs().exists(new Path(tableLocation))) { FileStatus tableFile = getFileStatus(tableLocation); tableFileNum = (int) getRootHdfs().getContentSummary(tableFile.getPath()).getFileCount(); }