Skip to content

Commit a1557cf

Browse files
committed
Expressions
Signed-off-by: Nicholas Gates <[email protected]>
1 parent 4704971 commit a1557cf

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

vortex-array/src/expr/expression.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@ impl Expression {
105105

106106
/// Computes the return dtype of this expression given the input dtype.
107107
pub fn return_dtype(&self, scope: &DType) -> VortexResult<DType> {
108+
if self.is::<Root>() {
109+
return Ok(scope.clone());
110+
}
108111
self.scalar_fn.return_dtype(&ExpressionReturnDTypeCtx {
109112
expr: self,
110113
scope_dtype: scope,
@@ -247,7 +250,6 @@ impl ReturnDTypeCtx for ExpressionReturnDTypeCtx<'_> {
247250

248251
fn return_dtype(&self, child_idx: usize) -> VortexResult<DType> {
249252
let child = &self.expr.children()[child_idx];
250-
251253
if child.is::<Root>() {
252254
return Ok(self.scope_dtype.clone());
253255
}

0 commit comments

Comments
 (0)