Skip to content

Commit ee2f517

Browse files
committed
feat(cubesql): Parse NULL literal in LogicalPlanLanguage
1 parent 1bd57fd commit ee2f517

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
@@ -1778,6 +1778,11 @@ fn literal_bool(literal_bool: bool) -> String {
17781778
format!("(LiteralExpr LiteralExprValue:b:{})", literal_bool)
17791779
}
17801780

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

0 commit comments

Comments
 (0)