Skip to content

Commit ccf9142

Browse files
committed
feat(cubesql): Parse NULL literal in LogicalPlanLanguage
1 parent 0f79ca3 commit ccf9142

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

rust/cubesql/cubesql/src/compile/rewrite/language.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -644,6 +644,8 @@ macro_rules! variant_field_struct {
644644
} else if let Some(value) = typed_str.strip_prefix("f:") {
645645
let n: f64 = value.parse().map_err(|err| Self::Err::InvalidFloatValue(err))?;
646646
Ok([<$variant $var_field:camel>](ScalarValue::Float64(Some(n))))
647+
} else if typed_str == "null" {
648+
Ok([<$variant $var_field:camel>](ScalarValue::Null))
647649
} else {
648650
Err(Self::Err::InvalidScalarType)
649651
}

rust/cubesql/cubesql/src/compile/rewrite/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1780,6 +1780,11 @@ fn literal_bool(literal_bool: bool) -> String {
17801780
format!("(LiteralExpr LiteralExprValue:b:{})", literal_bool)
17811781
}
17821782

1783+
#[allow(dead_code)]
1784+
fn literal_null() -> String {
1785+
format!("(LiteralExpr LiteralExprValue:null)")
1786+
}
1787+
17831788
fn projection(
17841789
expr: impl Display,
17851790
input: impl Display,

0 commit comments

Comments
 (0)