tests_fuzz/ir/
repartition_expr.rs1use partition::expr::PartitionExpr;
16use serde::{Deserialize, Serialize};
17
18use crate::ir::Ident;
19use crate::ir::create_expr::PartitionDef;
20
21#[derive(Debug, Clone, Serialize, Deserialize)]
22pub struct SplitPartitionExpr {
23 pub table_name: Ident,
24 pub target: PartitionExpr,
25 pub into: Vec<PartitionExpr>,
26 #[serde(default = "default_wait")]
27 pub wait: bool,
28}
29
30#[derive(Debug, Clone, Serialize, Deserialize)]
31pub struct MergePartitionExpr {
32 pub table_name: Ident,
33 pub targets: Vec<PartitionExpr>,
34 #[serde(default = "default_wait")]
35 pub wait: bool,
36}
37
38#[derive(Debug, Clone, Serialize, Deserialize)]
39pub struct AlterTablePartitionsExpr {
40 pub table_name: Ident,
41 pub partition: PartitionDef,
42 #[serde(default = "default_wait")]
43 pub wait: bool,
44}
45
46#[derive(Debug, Clone, Serialize, Deserialize)]
47pub enum RepartitionExpr {
48 Split(SplitPartitionExpr),
49 Merge(MergePartitionExpr),
50 AlterPartitions(AlterTablePartitionsExpr),
51}
52
53const fn default_wait() -> bool {
54 true
55}