@@ -61,7 +61,7 @@ pub async fn ingest(req: HttpRequest, body: Bytes) -> Result<HttpResponse, PostE
61
61
}
62
62
create_stream_if_not_exists ( & stream_name, & StreamType :: UserDefined . to_string ( ) ) . await ?;
63
63
64
- flatten_and_push_logs ( req, body, stream_name) . await ?;
64
+ flatten_and_push_logs ( req, body, & stream_name) . await ?;
65
65
Ok ( HttpResponse :: Ok ( ) . finish ( ) )
66
66
} else {
67
67
Err ( PostError :: Header ( ParseHeaderError :: MissingStreamName ) )
@@ -84,7 +84,7 @@ pub async fn ingest_internal_stream(stream_name: String, body: Bytes) -> Result<
84
84
tags : String :: default ( ) ,
85
85
metadata : String :: default ( ) ,
86
86
} ;
87
- event. into_recordbatch ( schema, None , None ) ?
87
+ event. into_recordbatch ( & schema, None , None ) ?
88
88
} ;
89
89
event:: Event {
90
90
rb,
@@ -114,9 +114,9 @@ pub async fn handle_otel_ingestion(
114
114
. iter ( )
115
115
. find ( |& ( key, _) | key == STREAM_NAME_HEADER_KEY )
116
116
{
117
- let stream_name = stream_name. to_str ( ) . unwrap ( ) . to_owned ( ) ;
118
- create_stream_if_not_exists ( & stream_name, & StreamType :: UserDefined . to_string ( ) ) . await ?;
119
- push_logs ( stream_name. to_string ( ) , req. clone ( ) , body) . await ?;
117
+ let stream_name = stream_name. to_str ( ) . unwrap ( ) ;
118
+ create_stream_if_not_exists ( stream_name, & StreamType :: UserDefined . to_string ( ) ) . await ?;
119
+ push_logs ( stream_name, & req, & body) . await ?;
120
120
} else {
121
121
return Err ( PostError :: Header ( ParseHeaderError :: MissingStreamName ) ) ;
122
122
}
@@ -149,7 +149,7 @@ pub async fn post_event(req: HttpRequest, body: Bytes) -> Result<HttpResponse, P
149
149
}
150
150
}
151
151
152
- flatten_and_push_logs ( req, body, stream_name) . await ?;
152
+ flatten_and_push_logs ( req, body, & stream_name) . await ?;
153
153
Ok ( HttpResponse :: Ok ( ) . finish ( ) )
154
154
}
155
155
@@ -319,7 +319,7 @@ mod tests {
319
319
. append_header ( ( PREFIX_META . to_string ( ) + "C" , "meta1" ) )
320
320
. to_http_request ( ) ;
321
321
322
- let ( rb, _) = into_event_batch ( req, json, HashMap :: default ( ) , None , None ) . unwrap ( ) ;
322
+ let ( rb, _) = into_event_batch ( & req, & json, HashMap :: default ( ) , None , None ) . unwrap ( ) ;
323
323
324
324
assert_eq ! ( rb. num_rows( ) , 1 ) ;
325
325
assert_eq ! ( rb. num_columns( ) , 6 ) ;
@@ -359,7 +359,7 @@ mod tests {
359
359
360
360
let req = TestRequest :: default ( ) . to_http_request ( ) ;
361
361
362
- let ( rb, _) = into_event_batch ( req, json, HashMap :: default ( ) , None , None ) . unwrap ( ) ;
362
+ let ( rb, _) = into_event_batch ( & req, & json, HashMap :: default ( ) , None , None ) . unwrap ( ) ;
363
363
364
364
assert_eq ! ( rb. num_rows( ) , 1 ) ;
365
365
assert_eq ! ( rb. num_columns( ) , 5 ) ;
@@ -391,7 +391,7 @@ mod tests {
391
391
392
392
let req = TestRequest :: default ( ) . to_http_request ( ) ;
393
393
394
- let ( rb, _) = into_event_batch ( req, json, schema, None , None ) . unwrap ( ) ;
394
+ let ( rb, _) = into_event_batch ( & req, & json, schema, None , None ) . unwrap ( ) ;
395
395
396
396
assert_eq ! ( rb. num_rows( ) , 1 ) ;
397
397
assert_eq ! ( rb. num_columns( ) , 5 ) ;
@@ -423,7 +423,7 @@ mod tests {
423
423
424
424
let req = TestRequest :: default ( ) . to_http_request ( ) ;
425
425
426
- assert ! ( into_event_batch( req, json, schema, None , None ) . is_err( ) ) ;
426
+ assert ! ( into_event_batch( & req, & json, schema, None , None ) . is_err( ) ) ;
427
427
}
428
428
429
429
#[ test]
@@ -441,7 +441,7 @@ mod tests {
441
441
442
442
let req = TestRequest :: default ( ) . to_http_request ( ) ;
443
443
444
- let ( rb, _) = into_event_batch ( req, json, schema, None , None ) . unwrap ( ) ;
444
+ let ( rb, _) = into_event_batch ( & req, & json, schema, None , None ) . unwrap ( ) ;
445
445
446
446
assert_eq ! ( rb. num_rows( ) , 1 ) ;
447
447
assert_eq ! ( rb. num_columns( ) , 3 ) ;
@@ -453,7 +453,7 @@ mod tests {
453
453
454
454
let req = TestRequest :: default ( ) . to_http_request ( ) ;
455
455
456
- assert ! ( into_event_batch( req, json, HashMap :: default ( ) , None , None ) . is_err( ) )
456
+ assert ! ( into_event_batch( & req, & json, HashMap :: default ( ) , None , None ) . is_err( ) )
457
457
}
458
458
459
459
#[ test]
@@ -476,7 +476,7 @@ mod tests {
476
476
477
477
let req = TestRequest :: default ( ) . to_http_request ( ) ;
478
478
479
- let ( rb, _) = into_event_batch ( req, json, HashMap :: default ( ) , None , None ) . unwrap ( ) ;
479
+ let ( rb, _) = into_event_batch ( & req, & json, HashMap :: default ( ) , None , None ) . unwrap ( ) ;
480
480
481
481
assert_eq ! ( rb. num_rows( ) , 3 ) ;
482
482
assert_eq ! ( rb. num_columns( ) , 6 ) ;
@@ -524,7 +524,7 @@ mod tests {
524
524
525
525
let req = TestRequest :: default ( ) . to_http_request ( ) ;
526
526
527
- let ( rb, _) = into_event_batch ( req, json, HashMap :: default ( ) , None , None ) . unwrap ( ) ;
527
+ let ( rb, _) = into_event_batch ( & req, & json, HashMap :: default ( ) , None , None ) . unwrap ( ) ;
528
528
529
529
assert_eq ! ( rb. num_rows( ) , 3 ) ;
530
530
assert_eq ! ( rb. num_columns( ) , 6 ) ;
@@ -572,7 +572,7 @@ mod tests {
572
572
) ;
573
573
let req = TestRequest :: default ( ) . to_http_request ( ) ;
574
574
575
- let ( rb, _) = into_event_batch ( req, json, schema, None , None ) . unwrap ( ) ;
575
+ let ( rb, _) = into_event_batch ( & req, & json, schema, None , None ) . unwrap ( ) ;
576
576
577
577
assert_eq ! ( rb. num_rows( ) , 3 ) ;
578
578
assert_eq ! ( rb. num_columns( ) , 6 ) ;
@@ -621,7 +621,7 @@ mod tests {
621
621
. into_iter ( ) ,
622
622
) ;
623
623
624
- assert ! ( into_event_batch( req, json, schema, None , None ) . is_err( ) ) ;
624
+ assert ! ( into_event_batch( & req, & json, schema, None , None ) . is_err( ) ) ;
625
625
}
626
626
627
627
#[ test]
@@ -649,7 +649,7 @@ mod tests {
649
649
650
650
let req = TestRequest :: default ( ) . to_http_request ( ) ;
651
651
652
- let ( rb, _) = into_event_batch ( req, json, HashMap :: default ( ) , None , None ) . unwrap ( ) ;
652
+ let ( rb, _) = into_event_batch ( & req, & json, HashMap :: default ( ) , None , None ) . unwrap ( ) ;
653
653
654
654
assert_eq ! ( rb. num_rows( ) , 4 ) ;
655
655
assert_eq ! ( rb. num_columns( ) , 7 ) ;
0 commit comments