grafadruid / go-druid

A Golang client for Druid
https://join.slack.com/t/grafadruid/shared_invite/zt-1qy0skzy8-axnZuyzaWRm9t8f0r9dUWQ
Apache License 2.0
39 stars 32 forks source link

Add support for aggregation of type `expression` #77

Open saketbairoliya2 opened 1 year ago

saketbairoliya2 commented 1 year ago
Screenshot 2022-11-16 at 9 09 50 AM

Getting above error when trying to use aggregation of type expression

jbguerraz commented 1 year ago

Hello @saketbairoliya2 Adding an aggregator is pretty straigth-forward, take a look here: https://github.com/grafadruid/go-druid/tree/master/builder/aggregation basically add a case here https://github.com/grafadruid/go-druid/blob/master/builder/aggregation/aggregation.go#L40 and then provide the structure for expression like here for instance https://github.com/grafadruid/go-druid/blob/master/builder/aggregation/string_last.go I didn't find any expression aggregator here https://druid.apache.org/docs/latest/querying/aggregations.html nor here https://druid.apache.org/docs/latest/development/extensions.html could you please point me to the aggregator documentation ? Thank you!

jbguerraz commented 1 year ago

@saketbairoliya2 any news on that ? since I didn't find that aggregator, maybe we can close it ?

AngryShamrock commented 1 year ago

@jbguerraz This aggregation type doesn't seem to be documented, but it does exist. I've seen it generated by EXPLAIN PLAN FOR when using Druid SQL

Here's the list of properties it accepts, from the druid github