kumarUjjawal commented on code in PR #23429:
URL: https://github.com/apache/datafusion/pull/23429#discussion_r3720481103
##########
datafusion/expr/src/expr_schema.rs:
##########
@@ -1192,6 +1204,64 @@ mod tests {
}
}
+ /// A scan of `t`, whose single column `a` has the given nullability.
Review Comment:
we can add a test using LogicalPlanBuilder empty false and verify that
nullable returns an error
##########
datafusion/expr/src/expr_schema.rs:
##########
@@ -366,7 +366,14 @@ impl ExprSchemable for Expr {
| Expr::IsNotUnknown(_)
| Expr::Exists { .. } => Ok(false),
Expr::SetComparison(_) => Ok(true),
- Expr::InSubquery(InSubquery { expr, .. }) =>
expr.nullable(input_schema),
+ Expr::InSubquery(InSubquery { expr, subquery, .. }) => {
+ let expr_nullable = expr.nullable(input_schema)?;
+ let subquery_nullable =
subquery.subquery.schema().fields().first().ok_or_else(|| {
+ exec_datafusion_err!("subquery must return exactly one
column of data to compare against")
Review Comment:
Could this return a planning error instead? The invalid subquery is detected
while inspecting a logical expression, so reporting it as an execution error
seems misleading.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]