Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve aggrMethod #432

Open
fgalan opened this issue Jan 16, 2018 · 5 comments · May be fixed by #605
Open

Improve aggrMethod #432

fgalan opened this issue Jan 16, 2018 · 5 comments · May be fixed by #605
Labels

Comments

@fgalan
Copy link
Member

fgalan commented Jan 16, 2018

Currently:

aggrMethod must be one of max, min, sum, sum2, occur

It would be great:

  1. To include costless additional aggregations. For example, average is sum by occur. It would be very easy for STH to generate avg at rendering time.
  2. To be able to include several aggregations at the same time using a comma separeted list, e.g. aggrMethod=min,max. The all token could be used as alias for "all metrics".
@fgalan fgalan added the backlog label Jan 16, 2018
@Madhu1029
Copy link
Contributor

Hi @fgalan,

Could you please confirm if anybody is working on this issue?

2. To be able to include several aggregations at the same time using a comma separated list, e.g. aggrMethod=min,max. The all token could be used as alias for "all metrics".

As per my understanding, below API should work fine for the above improvement. Please confirm my understanding.
curl -v 'http://localhost:8666/STH/v2/entities/Room1/attrs/temperature?type=Room&aggrMethod=min,max&aggrPeriod=second&dateFrom=2016-01-01T00:00:00.000Z&dateTo=2023-01-01T23:59:59.999Z' -s -S -H 'Content-Type: application/json' -H 'Fiware-Service: qsg' -H 'Fiware-ServicePath: /testsink'

@Madhu1029
Copy link
Contributor

Hi @fgalan ,

Could you please confirm the queries?

@fgalan
Copy link
Member Author

fgalan commented Feb 10, 2023

As far as I know, nobody is working on this issue so far.

Your query is correct. Note that ?aggrMethod=min,max is just an example. All combination of existing aggrMethod should be supported, in addition to the keyword all, meaning all them.

Thanks!

@Madhu1029
Copy link
Contributor

Hi @fgalan ,

  1. To include costless additional aggregations. For example, average is sum by occur. It would be very easy for STH to generate avg at rendering time.

As per my understanding, sum is calculated for attribute type float and occur is calculated for attribute type string.
So, we need to calculate the avg by different method. Also, it could only be implemented for attribute type float.
Could you please share your opinion?
Could you please share your ideas on more examples of additional aggregations?

@fgalan
Copy link
Member Author

fgalan commented Feb 22, 2023

As per my understanding, sum is calculated for attribute type float and occur is calculated for attribute type string.
So, we need to calculate the avg by different method. Also, it could only be implemented for attribute type float.
Could you please share your opinion?

Yes, maybe occur is not the one to use. You have to divide sum by the number of summed elements.

Could you please share your ideas on more examples of additional aggregations?

Part of the work on this issue is to come up with more examples of additional aggregations :) Do you have any idea regarding this?

@Madhu1029 Madhu1029 linked a pull request Feb 22, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants