You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ha...@apache.org on 2023/01/14 01:28:44 UTC
[iotdb] branch master updated: [IOTDB-5412]Print Help Message when loading empty tsfile (#8877)
This is an automated email from the ASF dual-hosted git repository.
haonan 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 ac726021a9 [IOTDB-5412]Print Help Message when loading empty tsfile (#8877)
ac726021a9 is described below
commit ac726021a948ec9b865317f41fcc3a5a53931ac7
Author: yschengzi <87...@users.noreply.github.com>
AuthorDate: Sat Jan 14 09:28:37 2023 +0800
[IOTDB-5412]Print Help Message when loading empty tsfile (#8877)
---
.../apache/iotdb/db/mpp/plan/analyze/AnalyzeVisitor.java | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/AnalyzeVisitor.java b/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/AnalyzeVisitor.java
index f7b3fa75d3..e0adf47a8c 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/AnalyzeVisitor.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/AnalyzeVisitor.java
@@ -1768,6 +1768,13 @@ public class AnalyzeVisitor extends StatementVisitor<Analysis, MPPQueryContext>
// analyze tsfile metadata
for (File tsFile : loadTsFileStatement.getTsFiles()) {
+ if (tsFile.length() == 0) {
+ logger.warn(String.format("TsFile %s is empty.", tsFile.getPath()));
+ throw new SemanticException(
+ String.format(
+ "TsFile %s is empty, please check it be flushed to disk correctly.",
+ tsFile.getPath()));
+ }
try {
TsFileResource resource =
analyzeTsFile(
@@ -1778,6 +1785,13 @@ public class AnalyzeVisitor extends StatementVisitor<Analysis, MPPQueryContext>
device2Schemas,
device2IsAligned);
loadTsFileStatement.addTsFileResource(resource);
+ } catch (IllegalArgumentException e) {
+ logger.warn(
+ String.format(
+ "Parse file %s to resource error, this TsFile maybe empty.", tsFile.getPath()),
+ e);
+ throw new SemanticException(
+ String.format("TsFile %s is empty or incomplete.", tsFile.getPath()));
} catch (Exception e) {
logger.warn(String.format("Parse file %s to resource error.", tsFile.getPath()), e);
throw new SemanticException(