@@ -33,13 +33,13 @@ pub enum StaticSchemaError {
3333 #[ error(
3434 "custom partition field {0} does not exist in the schema for the static schema logstream"
3535 ) ]
36- MissingCustomPartition ( String ) ,
36+ MissingCustom ( String ) ,
3737 #[ error(
3838 "time partition field {0} does not exist in the schema for the static schema logstream"
3939 ) ]
40- MissingTimePartition ( String ) ,
40+ MissingTime ( String ) ,
4141 #[ error( "field {DEFAULT_TIMESTAMP_KEY} is a reserved field" ) ]
42- MissingDefaultTimePartition ,
42+ DefaultTime ,
4343}
4444
4545impl StaticSchema {
@@ -54,9 +54,7 @@ impl StaticSchema {
5454 if let Some ( custom_partition) = custom_partition {
5555 for partition in custom_partition. split ( ',' ) {
5656 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 ( ) ) ) ;
6058 }
6159 }
6260 }
@@ -101,9 +99,7 @@ impl StaticSchema {
10199 }
102100
103101 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 ( ) ) ) ;
107103 }
108104
109105 let mut schema: Vec < Arc < Field > > = Vec :: new ( ) ;
@@ -113,7 +109,7 @@ impl StaticSchema {
113109 }
114110
115111 if get_field ( & schema, DEFAULT_TIMESTAMP_KEY ) . is_some ( ) {
116- return Err ( StaticSchemaError :: MissingDefaultTimePartition ) ;
112+ return Err ( StaticSchemaError :: DefaultTime ) ;
117113 } ;
118114
119115 // add the p_timestamp field to the event schema to the 0th index
0 commit comments