@@ -82,7 +82,8 @@ bool ParserAlterCommand::parseImpl(Pos & pos, ASTPtr & node, Expected & expected
8282 ParserKeyword s_forget_partition (Keyword::FORGET_PARTITION);
8383 ParserKeyword s_move_partition (Keyword::MOVE_PARTITION);
8484 ParserKeyword s_move_part (Keyword::MOVE_PART);
85- ParserKeyword s_export_part (Keyword::EXPORT_PARTITION);
85+ ParserKeyword s_export_part (Keyword::EXPORT_PART);
86+ ParserKeyword s_export_partition (Keyword::EXPORT_PARTITION);
8687 ParserKeyword s_drop_detached_partition (Keyword::DROP_DETACHED_PARTITION);
8788 ParserKeyword s_drop_detached_part (Keyword::DROP_DETACHED_PART);
8889 ParserKeyword s_fetch_partition (Keyword::FETCH_PARTITION);
@@ -565,13 +566,29 @@ bool ParserAlterCommand::parseImpl(Pos & pos, ASTPtr & node, Expected & expected
565566 command->move_destination_name = ast_space_name->as <ASTLiteral &>().value .safeGet <String>();
566567 }
567568 }
569+ else if (s_export_partition.ignore (pos, expected))
570+ {
571+ if (!parser_partition.parse (pos, command_partition, expected))
572+ return false ;
573+
574+ command->type = ASTAlterCommand::EXPORT_PARTITION;
575+
576+ if (!s_to_table.ignore (pos, expected))
577+ {
578+ return false ;
579+ }
580+
581+ if (!parseDatabaseAndTableName (pos, expected, command->to_database , command->to_table ))
582+ return false ;
583+ command->move_destination_type = DataDestinationType::TABLE;
584+ }
568585 else if (s_export_part.ignore (pos, expected))
569586 {
570587 if (!parser_partition.parse (pos, command_partition, expected))
571588 return false ;
572589
573- command->type = ASTAlterCommand::EXPORT_PART ;
574- // command->part = true;
590+ command->type = ASTAlterCommand::EXPORT_PARTITION ;
591+ command->part = true ;
575592
576593 if (!s_to_table.ignore (pos, expected))
577594 {
0 commit comments