From c2f3640431a28bc2cb8753f9b2378e0adeb70896 Mon Sep 17 00:00:00 2001 From: ppppoooo <1214343862@qq.com> Date: Tue, 11 Jun 2024 10:22:17 +0800 Subject: [PATCH] Load: Add check for BufferUnderflowException (#12690) Co-authored-by: xz m --- .../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 5506c0d0069e..91ca66fc0d52 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(