Simple table reduction uses window operation instead of aggregation
See original GitHub issueActual behaviour
import ibis
t = ibis.table([('e', 'int64'), ('f', 'int32')])
expr1 = t[t.e.sum().name('e'), t.f.sum().name('f')]
expr1
mysql compiles to
SELECT sum(t0.e) OVER (ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS e, sum(t0.f) OVER (ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS f
FROM t5 AS t0
Expected behaviour
expr1
should aggregate instead of using window operation like the following expression
expr2 = t.aggregate([t.e.sum().name('e'), t.f.sum().name('f')])
expr2
mysql compiles to
SELECT sum(t0.e) AS e, sum(t0.f) AS f
FROM t5 AS t0
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (6 by maintainers)
Top Results From Across the Web
Data tutorial: Using Window Functions
Window Functions enable users to perform calculations against partitions, subgroups or sections, of a result such as a table or results from another...
Read more >Implementing a generic REDUCE aggregate function with ...
A reduction is a generic aggregate function that operates on groups. So, we will have to re-use some SQL aggregate function mechanism to...
Read more >SQL Window Functions vs. SQL Aggregate Functions
In SQL, window functions operate on a set of rows called a window frame. They return a single value for each row from...
Read more >An Easy Guide to Advanced SQL Window Functions
This article is a guide on advanced window functions for data analysis in SQL. You'll learn through examples about aggregation, ranking, ...
Read more >Data Aggregation in Tableau
In Tableau, multidimensional data sources are supported only in Windows. You can change the aggregation for a measure in the view from its...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@fuxinhao-crypto It looks like
row_to_json
isn’t a reduction. Can you try subclassingValueOp
instead?@fuxinhao-crypto – would you mind re-posing this question over in https://github.com/ibis-project/ibis/discussions so it’s more easily discoverable for other users?