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 2022/04/14 22:21:23 UTC

[GitHub] [arrow-datafusion] andygrove opened a new issue, #2238: Add SQL query planning support for simple/nested subqueries

andygrove opened a new issue, #2238:
URL: https://github.com/apache/arrow-datafusion/issues/2238

   **Is your feature request related to a problem or challenge? Please describe what you are trying to do.**
   As a user of the DataFusion library for SQL parsing and logical query planning, I would like to be able to produce a valid logical plan from a SQL query containing a simple nested subquery instead of failing with `Unsupported ast node Query`.
   
   Example query: `SELECT name FROM (SELECT * FROM t2 WHERE id > 1) WHERE id < 4`
   
   **Describe the solution you'd like**
   The SQL should parse without error and produce a valid logical plan.
   
   For reference, here is an example query and logical plan from Apache Spark:
   
   ```
   scala> val df = spark.sql("SELECT name FROM (SELECT * FROM t2 WHERE id > 1) WHERE id < 4")
   df: org.apache.spark.sql.DataFrame = [id: int, name: string]
   
   scala> df.queryExecution.logical 
   res5: org.apache.spark.sql.catalyst.plans.logical.LogicalPlan =
   'Project ['name]
   +- 'Filter ('id < 4)
      +- 'SubqueryAlias __auto_generated_subquery_name
         +- 'Project [*]
            +- 'Filter ('id > 1)
               +- 'UnresolvedRelation [t2], [], false
   ```
   
   **Describe alternatives you've considered**
   None
   
   **Additional context**
   This does not cover optimization or physical plan. We will need to file follow-on issues for those.
   


-- 
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.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] andygrove commented on issue #2238: Add SQL query planning support for simple/nested subqueries

Posted by GitBox <gi...@apache.org>.
andygrove commented on issue #2238:
URL: https://github.com/apache/arrow-datafusion/issues/2238#issuecomment-1120235615

   This was already implemented


-- 
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


[GitHub] [arrow-datafusion] andygrove closed issue #2238: Add SQL query planning support for simple/nested subqueries

Posted by GitBox <gi...@apache.org>.
andygrove closed issue #2238: Add SQL query planning support for simple/nested subqueries
URL: https://github.com/apache/arrow-datafusion/issues/2238


-- 
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