1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
macro_rules! segmented_table_schema_methods {
() => {
// =========================================================================
// Metadata
// =========================================================================
fn name(&self) -> &str {
self.hot.name()
}
fn schema(&self) -> &Schema {
self.hot.schema()
}
fn txn_id(&self) -> i64 {
self.hot.txn_id()
}
// =========================================================================
// DDL — delegate to hot buffer
// =========================================================================
fn create_column(
&mut self,
name: &str,
column_type: DataType,
nullable: bool,
) -> Result<()> {
self.hot.create_column(name, column_type, nullable)
}
fn create_column_with_default(
&mut self,
name: &str,
column_type: DataType,
nullable: bool,
default_expr: Option<String>,
) -> Result<()> {
self.hot
.create_column_with_default(name, column_type, nullable, default_expr)
}
fn create_column_with_default_value(
&mut self,
name: &str,
column_type: DataType,
nullable: bool,
default_expr: Option<String>,
default_value: Option<Value>,
) -> Result<()> {
self.hot.create_column_with_default_value(
name,
column_type,
nullable,
default_expr,
default_value,
)
}
fn drop_column(&mut self, name: &str) -> Result<()> {
self.hot.drop_column(name)
}
fn materialize_insert_values(&mut self, row: &mut Row) -> Result<()> {
self.hot.materialize_insert_values(row)
}
};
}
pub(super) use segmented_table_schema_methods;