From 27217c1092619ec1aaf06f2c6e655bb3c078293c Mon Sep 17 00:00:00 2001 From: xz m Date: Fri, 7 Jun 2024 17:48:47 +0800 Subject: [PATCH] exception --- .../db/queryengine/plan/analyze/LoadTsfileAnalyzer.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/LoadTsfileAnalyzer.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/LoadTsfileAnalyzer.java index 5506c0d0069ed..91ca66fc0d52d 100644 --- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/LoadTsfileAnalyzer.java +++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/LoadTsfileAnalyzer.java @@ -82,6 +82,7 @@ import java.io.File; import java.io.IOException; +import java.nio.BufferUnderflowException; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; @@ -177,6 +178,13 @@ public Analysis analyzeFileByFile() { String.format("TsFile %s is empty or incomplete.", tsFile.getPath())); } catch (AuthException e) { return createFailAnalysisForAuthException(e); + } catch (BufferUnderflowException e) { + LOGGER.warn( + "The file {} is not a valid tsfile. Please check the input file.", tsFile.getPath(), e); + throw new SemanticException( + String.format( + "The file %s is not a valid tsfile. Please check the input file.", + tsFile.getPath())); } catch (Exception e) { LOGGER.warn("Parse file {} to resource error.", tsFile.getPath(), e); throw new SemanticException(