Replies: 1 comment
-
Hi. Nice to hear that you're looking into this. On a high level, processing a statement involves a couple of steps:
For the parser:For crate/libs/sql-parser/src/main/antlr/SqlBase.g4 Lines 87 to 88 in af5bb5a Adjust the logic that creates the crate/libs/sql-parser/src/main/java/io/crate/sql/parser/AstBuilder.java Lines 569 to 572 in af5bb5a You could consider to adjust the existing node to hold multiple And extend the tests: For the analyzer:The analyzer usually turns a For the drop table case, the entry point is here: crate/server/src/main/java/io/crate/analyze/Analyzer.java Lines 446 to 449 in af5bb5a Currently the result of the Planner / OptimizerThis currently doesn't do much for drop table and can probably be left unchanged. See crate/server/src/main/java/io/crate/planner/Planner.java Lines 314 to 317 in af5bb5a It just wraps the analyzed result into a plan ExecutionA simple implementation would change the current execution logic to loop over the tables, and execute the same logic we have per table: crate/server/src/main/java/io/crate/planner/node/ddl/DropTablePlan.java Lines 74 to 116 in af5bb5a I think that may be good enough for In case of a failure it may happen that one table got deleted, but another didn't. To avoid that we'd also have to adjust the underlying cluster state change operation, but that could also be a follow up task. |
Beta Was this translation helpful? Give feedback.
-
Hi,
I am starting to learn about crate db and to dive in the code.
I would like to work on #2036 as an exercise and looking from some info/documentation on how to get started.
I couldn't find an example to follow on how to deal with multi arguments so I started by adding another class :
Then changed the DropTableAnalyzer to loop through the table list :
I am not sure how to edit the planner to reflect these changes.
Can you tell me if this is the expected change or is there a more sophisticated approach?
Thanks,
Beta Was this translation helpful? Give feedback.
All reactions