You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to pass already-parsed sqlparser ASTs to Datafusion (I need more power than datafusion::sql::parser exposes). I found SqlToRel to do this.
SqlToRel needs a ContextProvider, and this seems to be the only place where a ContextProvider is used anywhere. Okay, I'll write one, and wrap everything in DefaultTableSource.
But now I can't make my ContextProvider::get_table_source ask for things from my CatalogProvider because SchemaProvider::table is async (see: #4607, #3777 (comment)).
If this was just about accessing my own tables, I could write some alternate API bypassing the SchemaProvider trait. But how am I supposed to support SELECT * FROM information_schema.tables with ContextProvider?
Note that all the examples and tests for SqlToRel just hard-code a trivial schema. This is not realistic.
To Reproduce
No response
Expected behavior
No response
Additional context
No response
The text was updated successfully, but these errors were encountered:
Thank you for the report. The way DataFusion itself handles this case is to do a pass over the parsed AST to find referenced tabes, fetching those tables in an outer function that is async and then creates a CatalogProvider that is not async
I agree this is confusing and it would be great for us to make this clearer in the documentation, or maybe make it easier to find / understand SessionContextProvider
Describe the bug
I'm trying to pass already-parsed
sqlparser
ASTs to Datafusion (I need more power thandatafusion::sql::parser
exposes). I foundSqlToRel
to do this.SqlToRel
needs aContextProvider
, and this seems to be the only place where aContextProvider
is used anywhere. Okay, I'll write one, and wrap everything inDefaultTableSource
.But now I can't make my
ContextProvider::get_table_source
ask for things from myCatalogProvider
becauseSchemaProvider::table
is async (see: #4607, #3777 (comment)).If this was just about accessing my own tables, I could write some alternate API bypassing the
SchemaProvider
trait. But how am I supposed to supportSELECT * FROM information_schema.tables
withContextProvider
?Note that all the examples and tests for
SqlToRel
just hard-code a trivial schema. This is not realistic.To Reproduce
No response
Expected behavior
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: