In Graph API, how to transform the outcome from a windowing function to non-grouped value
I have the following graph
{
node1: {
type: 'operator',
nodeType: 'window',
props: {
type: 'tumblingwindow',
unit: 'ss',
size: 10,
},
},
}, {
node2: {
type: 'operator',
nodeType: 'aggfunc',
props: {
expr: 'avg(value)',
},
},
}, {
node3: {
type: 'operator',
nodeType: 'function',
props: {
expr: 'abs(avg)',
},
},
},
but got error message saying:
collection type mismatch, expect non-grouped collection, got grouped collection
Can I use a pick operator to select the first element of the collection? Thanks.
Update I replaced node3 with a script node trying to process the avg value:
node3: {
type: 'operator',
nodeType: 'script',
props: {
script:
'function exec(msg, meta) { return msg.avg}',
isAgg: true,
},
}
Now the error message says:
input type mismatch, expect row, got collection
Hi, @ngjaying thank you for looking into this. Do you have a solution for this now or is it coming? I was trying to implement my own function plugin to covert the collection into a row, but it seems to be a circle. In order to consume the data from the window function, my function needs to declare IsAggregate() true. Thus my function becomes one that outputs collection again. Is there a way to get around this dilemma? Thanks!
Sorry, I don't have time to look into this deeply. I don't think we have the mechanism to convert collection back into one row now.
OK. Do you have any tips how I should go ahead and implement it? As mentioned above, if I declare IsAggregate true for my function, does it mean my function only accept collection and only output collection too? Thanks!
OK. Do you have any tips how I should go ahead and implement it? As mentioned above, if I declare IsAggregate true for my function, does it mean my function only accept collection and only output collection too? Thanks!
Yes, this is the current design
Hello, thank you for this amazing project. I was wondering if there is any update about this topic.
Thanks
There is no update on this issue. Welcome to share your ideas here.
This should be supported after implementing #2504