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

Plugins in Clickhouse to improve flexibility #1053

Closed
prog8 opened this issue Aug 2, 2017 · 4 comments
Closed

Plugins in Clickhouse to improve flexibility #1053

prog8 opened this issue Aug 2, 2017 · 4 comments
Labels
feature st-hold We've paused the work on issue for some reason

Comments

@prog8
Copy link
Contributor

prog8 commented Aug 2, 2017

I have a feeling that Clickhouse could be more interesting to extend if it is possible to extend it without touching the main codebase. One could simply implement a plugin. I can imagine a couple places where plugins could be used:

  • functions as plugins (math, date, strings, ...)
    Some functions which implement complex logic can be done using existing math, date, string functions but sometimes they might be optimized if a custom function is just a separate plugin.
  • aggregate functions as plugins
  • plugins implementing more external dictionaries
    At the moment only a limited number of external data sources can be used. What if one can prepare a new external data source?
  • plugins implementing different compression strategies
    General purpose compression algorithms are good but they can be sometimes improved when one knows domain characteristics ... or simply one could use different compression algorithm without changing Clickhouse codebase
  • custom backup methods (S3, HDFS, ... Clickhouse incremental backups on distributed storage #1052)
  • security (AD integration, document level security, ...)
  • plugins can be implemented in any language (C, C++, Go, ...). It just has to be a shared library

I mentioned only a couple use cases. I think each of them could be possibly done in separate tasks (make security filters pluggable, make functions pluggable, ...). I'm just sharing the idea and wanted to get a feedback if you think it makes sense. Could Clickouse be extensible in an easier way?

@prog8
Copy link
Contributor Author

prog8 commented Aug 3, 2017

I've just realized that this is already possible to attach some plugins (Compiler.h) but this is just not documented in https://clickhouse.yandex/docs/en/. Is it only used to automatically compile queries so they can be inlined and speeded up? As far as I understand at the moment only aggregating functions can be compiled but they cannot be loaded from the external .so attached by a user (I can see that SharedLibrary which loads actual .so object is instantiated only after compilation). @alexey-milovidov is it possible to attach external .so which will be loaded and which will register aggregate function by calling factory.registerFunction(?

I have a feeling that we could have a new configuration section (for instance in config.xml in which one can specify a list of external libraries to load) ... or maybe this is already possible and I missed it during a quick scanning of source code.

@theseusyang
Copy link

theseusyang commented Jan 4, 2018

I've interested in this. @alexey-milovidov can you lead this development or make a roadmap plan in 2018 Q1 ?

we will join the development on these plugins extending.

@theseusyang
Copy link

@prog8 We have implemented the integration ClickHouse with HDFS, next week We will push codes into github.

@alexey-milovidov
Copy link
Member

alexey-milovidov commented Jul 14, 2020

We don't consider using shared libraries for implementation of plugins due to maintainability issues.
In fact, most of the usages of shared libraries were removed from ClickHouse, examples:

We don't want to use shared libraries for plugins.
But we consider other possible ways for implementation of plugins.

@alexey-milovidov alexey-milovidov added the st-hold We've paused the work on issue for some reason label Jul 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature st-hold We've paused the work on issue for some reason
Projects
None yet
Development

No branches or pull requests

4 participants