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

Unsupported aggregation type on JSON query #145

Open
Fryuni opened this issue Feb 23, 2023 · 5 comments
Open

Unsupported aggregation type on JSON query #145

Fryuni opened this issue Feb 23, 2023 · 5 comments
Labels
enhancement New feature or request

Comments

@Fryuni
Copy link

Fryuni commented Feb 23, 2023

I use Tuple Sketches on my datasource and as such I need to use the appropriate aggregation on the query. Those aggregations are not available on the query builder, so it looks like the JSON option would allow me to write the entire query by hand since it is using something that the query builder doesn't know about.

But then, the JSON query is parsed only for known aggregation types. This makes absolutely no sense.
Druid supports plugins, if I create a new interleaveDigits aggregation I should be able to use it. The go-druid library can't possibly know about every Druid extension both public and private in every company.

The JSON queries should just be interpolated with the interval variables and sent to Druid without going through the builder at all or, if go-druid actually aims to be compatible with everything, it should accept any unknown aggregation and post aggregation as a map[string]any instead of returning an error.

@jbguerraz
Copy link
Contributor

Hello @Fryuni
Thank you for your bright feedback; which, not like this project, makes total sense :)
Being in a hurry, you can already use the SQL query type and profit from any plugin you want.
If you want to go the JSON query way, then since we do use the builder pattern, the best would probably be to contribute your plugin of choice support.
If you want to spend a bit more time to make the builders (front-end & back-end) able to fallback to direct query when unable to support the query then I'll be happy to help you all the way long!
On my side, I have no time and will to make such a change.

@Fryuni
Copy link
Author

Fryuni commented Mar 7, 2023

Being in a hurry, you can already use the SQL query type and profit from any plugin you want.

Some aggregations are only available on the native JSON query, like those for Tuple Sketches

If you want to spend a bit more time to make the builders (front-end & back-end) able to fallback to direct query when unable to support the query then I'll be happy to help you all the way long!

I can make the backend support arbitrary aggregations from the JSON editor, but the frontend builder is a complete mystery for me. But I can try.

I'll start with a PR on go-druid first.

@Fryuni
Copy link
Author

Fryuni commented Mar 12, 2023

@jbguerraz I opened the PR on the library: grafadruid/go-druid#83

@jbguerraz
Copy link
Contributor

and merged @Fryuni ! :) thx a lot!

@jbguerraz jbguerraz added the enhancement New feature or request label Jun 7, 2023
@Fryuni
Copy link
Author

Fryuni commented Jun 7, 2023

Great, so updating the library here should already enable custom queries.
The query builder still needs to be changed to allow creating values of custom types.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants