mirror of
https://github.com/openobserve/openobserve.git
synced 2026-11-04 16:09:05 +00:00
fix: if record is null in pipeline, ignore it (#12825)
Currently in pipeline execution, if any null record is encountered, it results in errors. Instead it should just ignore the null records and continue. It is very common in pipeline vrls to use -`. = null` when certain condition matches.
This commit is contained in:
@@ -792,6 +792,14 @@ async fn process_node(
|
||||
};
|
||||
}
|
||||
|
||||
// A null / non-object record means an upstream function filtered it
|
||||
// out (e.g. VRL `. = null`). Drop it instead of forwarding to the
|
||||
// destination, where it would fail at handle_timestamp with
|
||||
// "Value is not an object" and inflate the failed count.
|
||||
if !record.is_object() {
|
||||
continue;
|
||||
}
|
||||
|
||||
let mut destination_stream = stream_params.clone();
|
||||
if destination_stream.stream_name.contains("{") {
|
||||
match resolve_stream_name(&destination_stream.stream_name, &record) {
|
||||
@@ -943,6 +951,13 @@ async fn process_node(
|
||||
flattened = true;
|
||||
}
|
||||
|
||||
// A null / non-object record means an upstream function filtered it out
|
||||
// (e.g. VRL `. = null`). Skip it: it can't satisfy any condition and
|
||||
// `as_object().unwrap()` below would panic on a null.
|
||||
if !record.is_object() {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Evaluate based on condition version
|
||||
let eval_timer = Instant::now();
|
||||
let passes = match condition_params {
|
||||
|
||||
Reference in New Issue
Block a user