@@ -43,7 +43,7 @@ use crate::{
4343 kinesis:: { flatten_kinesis_logs, Message } ,
4444 metadata:: SchemaVersion ,
4545 otel:: { logs:: flatten_otel_logs, metrics:: flatten_otel_metrics, traces:: flatten_otel_traces} ,
46- storage :: StreamType ,
46+ parseable :: Stream ,
4747 utils:: {
4848 arrow:: get_field,
4949 json:: { flatten_json_body, Json } ,
@@ -224,23 +224,24 @@ impl EventFormat for Event {
224224 /// Converts a JSON event into a Parseable Event
225225 fn into_event (
226226 self ,
227- stream_name : String ,
228227 origin_size : u64 ,
229- storage_schema : & HashMap < String , Arc < Field > > ,
230- static_schema_flag : bool ,
231- custom_partitions : Option < & String > ,
232- time_partition : Option < & String > ,
233- time_partition_limit : Option < NonZeroU32 > ,
234- schema_version : SchemaVersion ,
228+ stream : & Stream ,
235229 log_source : & LogSource ,
236- stream_type : StreamType ,
237230 ) -> anyhow:: Result < super :: Event > {
231+ let time_partition = stream. get_time_partition ( ) ;
232+ let time_partition_limit = stream. get_time_partition_limit ( ) ;
233+ let static_schema_flag = stream. get_static_schema_flag ( ) ;
234+ let custom_partitions = stream. get_custom_partition ( ) ;
235+ let schema_version = stream. get_schema_version ( ) ;
236+ let storage_schema = stream. get_schema_raw ( ) ;
237+ let stream_type = stream. get_stream_type ( ) ;
238+
238239 let p_timestamp = self . p_timestamp ;
239240 let ( data, schema, is_first_event) = self . to_data (
240- storage_schema,
241- time_partition,
241+ & storage_schema,
242+ time_partition. as_ref ( ) ,
242243 time_partition_limit,
243- custom_partitions,
244+ custom_partitions. as_ref ( ) ,
244245 schema_version,
245246 log_source,
246247 ) ?;
@@ -255,18 +256,18 @@ impl EventFormat for Event {
255256 None => HashMap :: new ( ) ,
256257 } ;
257258
258- let parsed_timestamp = match time_partition {
259- Some ( time_partition) => extract_and_parse_time ( & json, time_partition) ?,
259+ let parsed_timestamp = match time_partition. as_ref ( ) {
260+ Some ( time_partition) => extract_and_parse_time ( & json, time_partition. as_ref ( ) ) ?,
260261 _ => p_timestamp. naive_utc ( ) ,
261262 } ;
262263
263264 let rb = Self :: into_recordbatch (
264265 p_timestamp,
265266 vec ! [ json] ,
266267 schema. clone ( ) ,
267- storage_schema,
268+ & storage_schema,
268269 static_schema_flag,
269- time_partition,
270+ time_partition. as_ref ( ) ,
270271 schema_version,
271272 ) ?;
272273
@@ -278,7 +279,6 @@ impl EventFormat for Event {
278279 }
279280
280281 Ok ( super :: Event {
281- stream_name,
282282 origin_format : "json" ,
283283 origin_size,
284284 is_first_event,
0 commit comments