Skip to content

Commit 338c0a5

Browse files
author
Kanishk Sachan
committed
test: strengthen null literal test by verifying decoded value (per review)
1 parent 69352ff commit 338c0a5

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

  • datafusion/physical-expr/src/expressions

‎datafusion/physical-expr/src/expressions/literal.rs‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,16 @@ mod proto_tests {
277277
node.expr_type,
278278
Some(physical_expr_node::ExprType::Literal(_))
279279
));
280+
281+
// Decode and verify the null payload round-trips correctly.
282+
let schema = Schema::empty();
283+
let decoder = UnreachableDecoder;
284+
let dec_ctx = PhysicalExprDecodeCtx::new(&schema, &decoder);
285+
let decoded = Literal::try_from_proto(&node, &dec_ctx).unwrap();
286+
let lit = decoded
287+
.downcast_ref::<Literal>()
288+
.expect("decoded expr should be a Literal");
289+
assert_eq!(lit.value(), &ScalarValue::Int32(None));
280290
}
281291

282292
// ── try_from_proto ───────────────────────────────────────────────────────

0 commit comments

Comments
 (0)