Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -440,8 +440,16 @@ public void testDropPartition() {
.ok(
"ALTER TABLE `TBL`\n"
+ "DROP\n"
+ "PARTITION (`P1` = 'a', `P2` = 1)\n"
+ "PARTITION (`P1` = 'a', `P2` = 1),\n"
+ "PARTITION (`P1` = 'b', `P2` = 2)");
sql("alter table tbl drop partition (p1='a',p2=1), "
+ "partition(p1='b',p2=2), partition(p1='c',p2=3)")
.ok(
"ALTER TABLE `TBL`\n"
+ "DROP\n"
+ "PARTITION (`P1` = 'a', `P2` = 1),\n"
+ "PARTITION (`P1` = 'b', `P2` = 2),\n"
+ "PARTITION (`P1` = 'c', `P2` = 3)");
// TODO: support IGNORE PROTECTION, PURGE
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,14 @@ public void unparse(SqlWriter writer, int leftPrec, int rightPrec) {
}
int opLeftPrec = getOperator().getLeftPrec();
int opRightPrec = getOperator().getRightPrec();
final SqlWriter.Frame frame = writer.startList("", "");
for (SqlNodeList partSpec : partSpecs) {
writer.sep(",");
writer.newlineAndIndent();
writer.keyword("PARTITION");
partSpec.unparse(writer, opLeftPrec, opRightPrec);
}
writer.endList(frame);
}

@Nonnull
Expand Down