LiaCastaneda commented on code in PR #18921:
URL: https://github.com/apache/datafusion/pull/18921#discussion_r3064357703
##########
datafusion/expr/src/expr_schema.rs:
##########
@@ -199,6 +203,13 @@ impl ExprSchemable for Expr {
// Grouping sets do not really have a type and do not appear
in projections
Ok(DataType::Null)
}
+ Expr::HigherOrderFunction(_func) => {
+ Ok(self.to_field(schema)?.1.data_type().clone())
+ }
+ Expr::Lambda(Lambda { params: _, body }) => body.get_type(schema),
Review Comment:
It does seem that the contract of `get_type` is to return the return type
no? (at least going by the boolean expressions that always return `bool`)? imo
I think it's more honest to return `DataType::Null `than having it return the
body type, also because as @pepijnve mentions, there is no actual Arrow type
for a lambda. At the call site you'd then be more explicit with handling the
body type: `lambda.body.to_field(schema)`
--
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]