Caideyipi commented on code in PR #18417:
URL: https://github.com/apache/iotdb/pull/18417#discussion_r3733897669
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/statement/crud/LoadTsFileStatement.java:
##########
@@ -94,6 +94,10 @@ public static LoadTsFileStatement createForPipe(String
filePath) throws FileNotF
private LoadTsFileStatement(
String filePath, boolean validateSourcePath, boolean
validateInternalDataDir)
throws FileNotFoundException {
+ if (filePath == null || filePath.isEmpty()) {
Review Comment:
[P1] Table Model 的 `LOAD` 路径没有经过这里的空路径校验。
关系型解析器 `AstBuilder.visitLoadTsFileStatement()` 会直接构造 `LoadTsFile`;该类的构造函数只检查
`null`,随后执行 `processTsFile(new File(filePath), ...)`。因此关系型语法 `LOAD ''`
仍会把空字符串解析成进程当前工作目录,可能递归扫描并加载其中的 `.tsfile`(至少也不会返回本 PR 新增的“LOAD TSFILE path
cannot be empty”错误)。`RelationalSql.g4` 的 `STRING` 规则允许空字符串。
请把校验抽成字符串级 helper,在 `LoadTsFileStatement` 和 `LoadTsFile` 两个入口复用,并补充
Tree/Table 两种 dialect 的 `LOAD ''` 回归测试。
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]