You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "vincev (via GitHub)" <gi...@apache.org> on 2023/02/14 14:38:55 UTC

[GitHub] [arrow-datafusion] vincev opened a new issue, #5281: Optimizer prunes UnnestExec on aggregate count

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

   **Describe the bug**
   When running an aggregate count on an unnested column the `aggregate_statistics` optimizer removes `UnnestExec` from the `ExecutionPlan` 
   
   **To Reproduce**
   Given the following data:
   ```
   "+--------------------+",
   "| tags               |",
   "+--------------------+",                                                   
   "|                    |",                                                   
   "| [tag1, tag2, tag3] |",                                                   
   "| [tag1, tag2, tag3] |",
   "| [tag1, tag2]       |",
   "| [tag1]             |",
   "+--------------------+",
   ```
   
   The following aggregation:
   
   ```rust
   df
       .unnest_column("tags")?
       .aggregate(vec![], vec![count(col("tags"))])?
       .show()
       .await?;
   ```
   
   reports 4 rows instead of 9 unnested nested rows (see [test](https://github.com/vincev/arrow-datafusion/blob/047803a879e7af7e894280eb9c51edb5f931c249/datafusion/core/tests/dataframe.rs#L640)):
   
   **Expected behavior**
   Aggregate count should count unnested rows. 
   
   **Additional context**
   Add any other context about the problem here.
   


-- 
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] alamb closed issue #5281: Optimizer prunes UnnestExec on aggregate count

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb closed issue #5281: Optimizer prunes UnnestExec on aggregate count
URL: https://github.com/apache/arrow-datafusion/issues/5281


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