You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2023/01/18 16:22:38 UTC
[GitHub] [arrow-datafusion] avantgardnerio commented on a diff in pull request #4958: Expose `sql_to_statement` and `statement_to_plan` on `SessionState`
avantgardnerio commented on code in PR #4958:
URL: https://github.com/apache/arrow-datafusion/pull/4958#discussion_r1073760608
##########
datafusion/core/src/execution/context.rs:
##########
@@ -1729,6 +1741,15 @@ impl SessionState {
query.statement_to_plan(statement)
}
+ /// Creates a [`LogicalPlan`] from the provided SQL string
+ ///
+ /// See [`SessionContext::sql`] for a higher-level interface that also handles DDL
+ pub async fn create_logical_plan(&self, sql: &str) -> Result<LogicalPlan> {
+ let statement = self.sql_to_statement(sql)?;
+ let plan = self.statement_to_plan(statement).await?;
+ Ok(plan)
+ }
Review Comment:
@gruuya your suggestion makes sense and I'd be amenable to merging a PR containing the changes you described, but in the interest of expedience, given the approvals on this PR, I'd like to merge it as-is.
If you file an issue, I can take a look next time I'm free.
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org