DanielWang2035 commented on code in PR #13706:
URL: https://github.com/apache/iotdb/pull/13706#discussion_r1799605053
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/sql/parser/AstBuilder.java:
##########
@@ -559,7 +561,40 @@ public Node
visitShowFunctionsStatement(RelationalSqlParser.ShowFunctionsStateme
@Override
public Node
visitLoadTsFileStatement(RelationalSqlParser.LoadTsFileStatementContext ctx) {
- return super.visitLoadTsFileStatement(ctx);
+ final Map<String, String> loadTsFileAttributes = new HashMap<>();
+ if (ctx.loadFileWithAttributeClauses() != null) {
+ for (RelationalSqlParser.LoadFileWithAttributeClauseContext
attributeContext :
+ ctx.loadFileWithAttributeClauses().loadFileWithAttributeClause()) {
+ final String key =
+
parseStringLiteral(attributeContext.loadFileWithKey.getText()).trim().toLowerCase();
+ final String value =
+
parseStringLiteral(attributeContext.loadFileWithValue.getText()).trim().toLowerCase();
+
+ LoadTsFileConfigurator.validateParameters(key, value);
+ loadTsFileAttributes.put(key, value);
+ }
+ }
+
+ return new LoadTsFile(
+ getLocation(ctx), ((StringLiteral) visit(ctx.fileName)).getValue(),
loadTsFileAttributes);
+ }
+
+ public static String parseStringLiteral(String src) {
Review Comment:
TODO: parseExtractorAttributesClause
--
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]