leoyvens commented on code in PR #10876:
URL: https://github.com/apache/datafusion/pull/10876#discussion_r1638301822
##########
datafusion/core/src/catalog/mod.rs:
##########
@@ -295,6 +296,118 @@ impl CatalogProvider for MemoryCatalogProvider {
}
}
+/// Resolve all table references in the SQL statement.
+///
+/// ## Example
+///
+/// ```
+/// use datafusion_sql::parser::DFParser;
+/// use datafusion::catalog::resolve_table_references;
+///
+/// let query = "SELECT a FROM foo where x IN (SELECT y FROM bar)";
+/// let statement = DFParser::parse_sql(query).unwrap().pop_back().unwrap();
+/// let table_refs = resolve_table_references(&statement, true).unwrap();
+/// assert_eq!(table_refs.len(), 2);
+/// assert_eq!(table_refs[0].to_string(), "foo");
+/// assert_eq!(table_refs[1].to_string(), "bar");
+/// ```
Review Comment:
Thanks this is very handy, I've added it.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]