haohuaijin commented on code in PR #9722:
URL: https://github.com/apache/arrow-datafusion/pull/9722#discussion_r1534064495


##########
datafusion/expr/src/expr_schema.rs:
##########
@@ -50,6 +50,10 @@ pub trait ExprSchemable {
 
     /// cast to a type with respect to a schema
     fn cast_to(self, cast_to_type: &DataType, schema: &dyn ExprSchema) -> 
Result<Expr>;
+
+    /// given a schema, return the type and nullability of the expr
+    fn data_type_and_nullable(&self, schema: &dyn ExprSchema)
+        -> Result<(DataType, bool)>;

Review Comment:
   I made it consistent with `get_type()` and `nullable()`
   
https://github.com/apache/arrow-datafusion/blob/dc373a3550610ce041fd73a1eabe08b096d6ed27/datafusion/expr/src/expr_schema.rs#L39-L43
   we use this to create DFField, which it use `DataType`
   
https://github.com/apache/arrow-datafusion/blob/dc373a3550610ce041fd73a1eabe08b096d6ed27/datafusion/expr/src/expr_schema.rs#L379-L384



-- 
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]

Reply via email to