Skip to content

Commit

Permalink
Added parsing logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Caideyipi committed Jan 21, 2025
1 parent 221bc1b commit e5684a0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import org.apache.iotdb.confignode.consensus.request.write.table.CommitDeleteTablePlan;
import org.apache.iotdb.confignode.consensus.request.write.table.RenameTableColumnPlan;
import org.apache.iotdb.confignode.consensus.request.write.table.SetTableColumnCommentPlan;
import org.apache.iotdb.confignode.consensus.request.write.table.SetTableCommentPlan;
import org.apache.iotdb.confignode.consensus.request.write.table.SetTablePropertiesPlan;

import java.util.Optional;
Expand Down Expand Up @@ -128,6 +129,15 @@ public Optional<ConfigPhysicalPlan> visitCommitDeleteTable(
: Optional.empty();
}

@Override
public Optional<ConfigPhysicalPlan> visitSetTableComment(
final SetTableCommentPlan setTableCommentPlan, final TablePattern pattern) {
return matchDatabaseAndTableName(
setTableCommentPlan.getDatabase(), setTableCommentPlan.getTableName(), pattern)
? Optional.of(setTableCommentPlan)
: Optional.empty();
}

@Override
public Optional<ConfigPhysicalPlan> visitSetTableColumnComment(
final SetTableColumnCommentPlan setTableColumnCommentPlan, final TablePattern pattern) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import org.apache.iotdb.confignode.consensus.request.write.table.CommitDeleteTablePlan;
import org.apache.iotdb.confignode.consensus.request.write.table.RenameTableColumnPlan;
import org.apache.iotdb.confignode.consensus.request.write.table.SetTableColumnCommentPlan;
import org.apache.iotdb.confignode.consensus.request.write.table.SetTableCommentPlan;
import org.apache.iotdb.confignode.consensus.request.write.table.SetTablePropertiesPlan;
import org.apache.iotdb.confignode.rpc.thrift.TDatabaseSchema;

Expand Down Expand Up @@ -113,6 +114,14 @@ public void testCommitDeleteTable() {
new CommitDeleteTablePlan("da", "ac"));
}

@Test
public void testSetTableComment() {
testInput(
new SetTableCommentPlan("db1", "ab", "a"),
new SetTableCommentPlan("db1", "ac", "a"),
new SetTableCommentPlan("da", "ac", "a"));
}

@Test
public void testSetTableColumnComment() {
testInput(
Expand Down

0 comments on commit e5684a0

Please sign in to comment.