Skip to content

Commit b168a7d

Browse files
authored
fix: fill non-current source with empty table during evaluation (#845)
1 parent 16c904e commit b168a7d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/execution/evaluator.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,17 @@ pub async fn evaluate_source_entry(
530530
value::Value::KTable(BTreeMap::from([(src_eval_ctx.key.clone(), scope_value)])),
531531
)?;
532532

533+
// Fill other source fields with empty tables
534+
for import_op in src_eval_ctx.plan.import_ops.iter() {
535+
let field_idx = import_op.output.field_idx;
536+
if field_idx != src_eval_ctx.import_op.output.field_idx {
537+
root_scope_entry.define_field(
538+
&AnalyzedOpOutput { field_idx },
539+
&value::Value::KTable(BTreeMap::new()),
540+
)?;
541+
}
542+
}
543+
533544
evaluate_op_scope(
534545
&src_eval_ctx.plan.op_scope,
535546
RefList::Nil.prepend(&root_scope_entry),

0 commit comments

Comments
 (0)