apache / datafusion

Apache DataFusion SQL Query Engine
https://datafusion.apache.org/
Apache License 2.0
6.39k stars 1.21k forks source link

[Docs] Add info on type system (DFSchema/Schema) to user guide #7724

Open andygrove opened 1 year ago

andygrove commented 1 year ago

Is your feature request related to a problem or challenge?

A source of confusion for new users is why we have Schema/SchemaRef as well as DFSchema/DFSchemaRef and how to convert between the two.

Here is a quick answer I gave to someone recently. Would be good to add a section about the type system to the user guide, perhaps before introducing TableProvider.

DFSchema is similar to Schema, but adds optional qualifiers (table names). You can convert from Schema by calling DFSchema::try_from_qualified_schema(Some("table_name"), arrow_schema). There is also DFField::from_qualified.

Describe the solution you'd like

More docs

Describe alternatives you've considered

No response

Additional context

No response

alamb commented 1 year ago

Other things we should add: doc examples of how to go back and forth between Schema. <--> DFSchema

alamb commented 1 year ago

(BTW I aspire to work on this ticket at some point soon)

caicancai commented 3 months ago

take