https://pinot.apache.org/ logo
#general
Title
# general
a

Ashish

06/13/2021, 2:53 AM
m

Mayank

06/13/2021, 2:54 AM
Yes the enhancement was merged
a

Ashish

06/13/2021, 2:55 AM
Ok, thanks. Is there an example of multi argument aggregation function that I can refer to?
a

Ashish

06/13/2021, 3:01 AM
That however takes only a single column as input.
For aggregation function with multiple column names as input, the Map<ExpressionContext, BlockValSet> blockValSetMap parameter in the aggregation method may not be sufficient.
As each value for column1 could be associated with multiple values of column2.
Any idea on how to handle this?
m

Mayank

06/13/2021, 3:05 AM
What's your requirement?
a

Ashish

06/13/2021, 3:08 AM
I was looking to do the following query: select bucket(ts, 1 min), avg_then_sum(ts, dimensioncolumn, value) group by bucket(ts, 1 min)
m

Mayank

06/13/2021, 3:09 AM
Theta sketch is just an example. Custom aggr functions can now take any number of args
a

Ashish

06/13/2021, 3:10 AM
Basically, within each 1 min bucket, I want to average all metric values grouped by dimension and then sum those averaged values across the dimension column.
m

Mayank

06/13/2021, 3:10 AM
You planning to write a custom aggr function?
a

Ashish

06/13/2021, 3:11 AM
Yes, unless there is a better alternative
I was told that subqueries are not yet supported.
m

Mayank

06/13/2021, 3:59 AM
In
Map<ExpressionContext, BlockValSet> blockValSetMap
, each entry in the map can be a column
or expression on the column
a

Ashish

06/13/2021, 4:00 AM
Yes. However, each blockset’s getIntValuesSV and other methods return an array of values.
So for column1 and column2 (assuming they are both single value int columns), getIntValuesSV will return same number of elements? And they will be in the same order (by docIds)?
If that’s the case it should work for me.
m

Mayank

06/13/2021, 4:07 AM
Yes same order
a

Ashish

06/13/2021, 4:11 AM
Got it - so individual array elements of both columns will correspond to the same docId. Right?
m

Mayank

06/13/2021, 4:14 AM
Yep
a

Ashish

06/13/2021, 4:14 AM
Thanks for confirming.
I plan to proceed along - let me know if you have any alternate ways / suggestions, etc.
appreciate your help.
m

Mayank

06/13/2021, 4:27 AM
👍