andygrove opened a new issue, #7725:
URL: https://github.com/apache/arrow-datafusion/issues/7725
### Is your feature request related to a problem or challenge?
It is not always apparent to new users how to get the data type for a
logical expression.
### Describe the solution you'd like
Add some docs explaining ExprSchemable.
Quick example:
```rust
use arrow_schema::DataType;
use datafusion::common::DFField;
use datafusion::common::DFSchema;
use datafusion::logical_expr::col;
use datafusion::logical_expr::ExprSchemable;
use std::collections::HashMap;
fn main() {
let expr = col("foo");
let schema = DFSchema::new_with_metadata(
vec![DFField::new_unqualified("foo", DataType::Utf8, true)],
HashMap::new(),
)
.unwrap();
print!("type = {}", expr.get_type(&schema).unwrap());
}
```
### Describe alternatives you've considered
_No response_
### Additional context
_No response_
--
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]