Describe the bug
information_schema.routines and SHOW FUNCTIONS only enumerate scalar / aggregate / window UDFs. Table functions (UDTFs) registered via SessionContext::register_udtf are silently omitted, which makes them undiscoverable through SQL.
To Reproduce
```rust
use datafusion::prelude::*;
use datafusion_catalog::TableFunctionImpl;
let ctx = SessionContext::new_with_config(
SessionConfig::new().with_information_schema(true),
);
ctx.register_udtf("my_udtf", Arc::new(MyUdtf {}));
// Neither of these lists 'my_udtf':
ctx.sql("SHOW FUNCTIONS LIKE 'my%'").await?.show().await?;
ctx.sql("SELECT * FROM information_schema.routines WHERE routine_name = 'my_udtf'").await?.show().await?;
```
Expected behavior
UDTFs should appear in both information_schema.routines (with routine_type = 'FUNCTION', function_type = 'TABLE', data_type = 'TABLE') and in SHOW FUNCTIONS output.
Additional context
Root cause: InformationSchemaConfig::make_routines and make_parameters iterate udfs / udafs / udwfs only. TaskContext doesn't expose table_functions (and can't, since TableFunction lives in datafusion-catalog which depends on datafusion-execution, so adding it to TaskContext would create a cycle). The straightforward fix is to snapshot SessionState.table_functions into InformationSchemaProvider at construction time (the provider is built per-query via schema_for_ref, so the snapshot stays fresh).
Additionally the current SHOW FUNCTIONS SQL rewrite does parameters p JOIN routines r where p requires both an IN and an OUT parameter row. UDTFs have no IN parameters, so they fall out of the JOIN. The fix rewrites the query so it starts from OUT rows and LEFT JOINs IN rows.
PR: coming shortly.
Describe the bug
information_schema.routinesandSHOW FUNCTIONSonly enumerate scalar / aggregate / window UDFs. Table functions (UDTFs) registered viaSessionContext::register_udtfare silently omitted, which makes them undiscoverable through SQL.To Reproduce
```rust
use datafusion::prelude::*;
use datafusion_catalog::TableFunctionImpl;
let ctx = SessionContext::new_with_config(
SessionConfig::new().with_information_schema(true),
);
ctx.register_udtf("my_udtf", Arc::new(MyUdtf {}));
// Neither of these lists 'my_udtf':
ctx.sql("SHOW FUNCTIONS LIKE 'my%'").await?.show().await?;
ctx.sql("SELECT * FROM information_schema.routines WHERE routine_name = 'my_udtf'").await?.show().await?;
```
Expected behavior
UDTFs should appear in both
information_schema.routines(withroutine_type = 'FUNCTION',function_type = 'TABLE',data_type = 'TABLE') and inSHOW FUNCTIONSoutput.Additional context
Root cause:
InformationSchemaConfig::make_routinesandmake_parametersiterateudfs / udafs / udwfsonly.TaskContextdoesn't expose table_functions (and can't, sinceTableFunctionlives indatafusion-catalogwhich depends ondatafusion-execution, so adding it to TaskContext would create a cycle). The straightforward fix is to snapshotSessionState.table_functionsintoInformationSchemaProviderat construction time (the provider is built per-query viaschema_for_ref, so the snapshot stays fresh).Additionally the current
SHOW FUNCTIONSSQL rewrite doesparameters p JOIN routines rwhereprequires both an IN and an OUT parameter row. UDTFs have no IN parameters, so they fall out of the JOIN. The fix rewrites the query so it starts from OUT rows and LEFT JOINs IN rows.PR: coming shortly.