@@ -33,13 +33,13 @@ pub enum StaticSchemaError {
33
33
#[ error(
34
34
"custom partition field {0} does not exist in the schema for the static schema logstream"
35
35
) ]
36
- MissingCustomPartition ( String ) ,
36
+ MissingCustom ( String ) ,
37
37
#[ error(
38
38
"time partition field {0} does not exist in the schema for the static schema logstream"
39
39
) ]
40
- MissingTimePartition ( String ) ,
40
+ MissingTime ( String ) ,
41
41
#[ error( "field {DEFAULT_TIMESTAMP_KEY} is a reserved field" ) ]
42
- MissingDefaultTimePartition ,
42
+ DefaultTime ,
43
43
}
44
44
45
45
impl StaticSchema {
@@ -54,9 +54,7 @@ impl StaticSchema {
54
54
if let Some ( custom_partition) = custom_partition {
55
55
for partition in custom_partition. split ( ',' ) {
56
56
if !self . fields . iter ( ) . any ( |field| field. name == partition) {
57
- return Err ( StaticSchemaError :: MissingCustomPartition (
58
- partition. to_owned ( ) ,
59
- ) ) ;
57
+ return Err ( StaticSchemaError :: MissingCustom ( partition. to_owned ( ) ) ) ;
60
58
}
61
59
}
62
60
}
@@ -101,9 +99,7 @@ impl StaticSchema {
101
99
}
102
100
103
101
if !time_partition. is_empty ( ) && !time_partition_exists {
104
- return Err ( StaticSchemaError :: MissingTimePartition (
105
- time_partition. to_owned ( ) ,
106
- ) ) ;
102
+ return Err ( StaticSchemaError :: MissingTime ( time_partition. to_owned ( ) ) ) ;
107
103
}
108
104
109
105
let mut schema: Vec < Arc < Field > > = Vec :: new ( ) ;
@@ -113,7 +109,7 @@ impl StaticSchema {
113
109
}
114
110
115
111
if get_field ( & schema, DEFAULT_TIMESTAMP_KEY ) . is_some ( ) {
116
- return Err ( StaticSchemaError :: MissingDefaultTimePartition ) ;
112
+ return Err ( StaticSchemaError :: DefaultTime ) ;
117
113
} ;
118
114
119
115
// add the p_timestamp field to the event schema to the 0th index
0 commit comments