This is an automated email from the ASF dual-hosted git repository.

rong pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/master by this push:
     new c2f3640431a Load: Add check for BufferUnderflowException (#12690)
c2f3640431a is described below

commit c2f3640431a28bc2cb8753f9b2378e0adeb70896
Author: ppppoooo <[email protected]>
AuthorDate: Tue Jun 11 10:22:17 2024 +0800

    Load: Add check for BufferUnderflowException (#12690)
    
    Co-authored-by: xz m <[email protected]>
---
 .../iotdb/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 5506c0d0069..91ca66fc0d5 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 org.slf4j.LoggerFactory;
 
 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 class LoadTsfileAnalyzer {
             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(

Reply via email to