-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Is your feature request related to a problem or challenge?
In datafusion-sqlparser-rs, we define many SQL types but they aren't all required by the DataFusion core.
datafusion/datafusion/sql/src/planner.rs
Lines 524 to 529 in b0b6e44
| // Explicitly list all other types so that if sqlparser | |
| // adds/changes the `SQLDataType` the compiler will tell us on upgrade | |
| // and avoid bugs like https://github.com/apache/datafusion/issues/3059 | |
| SQLDataType::Nvarchar(_) | |
| | SQLDataType::JSON | |
| | SQLDataType::Uuid |
I think it's good to provide a way to extend or customize the behavior for SQL type to DataFusion type (maybe changed to NativeType in the future) for the downstream project that may want to use those unsupported SQL types.
Describe the solution you'd like
Introduce a new API for ExprPlanner,
/// Plan SQL type to DataFusion data type
///
/// Returns None if not possible
fn plan_data_type(&self, _sql_type: &ast::DataType) -> Option<DataType> {
None
}
Try planning the SQL type using ExprPlanner first. If not present, revert to the default behavior.
Describe alternatives you've considered
No response
Additional context
No response
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request