Commit Graph

145 Commits

Author SHA1 Message Date
Robert Schulze
da0002c4c4
Document how the library-bridge port can be changed
Fixes #43605
2022-12-02 10:54:54 +00:00
Alejandro
62ab271b82 fix docs 2022-11-03 09:04:22 +01:00
Alejandro
4e3f43650a Added function to docs 2022-11-03 09:04:22 +01:00
alexeyerm
9abfe76fbb
doc fix fix 2022-10-21 20:08:44 +03:00
alexeyerm
95943dbdda
fix transform() example 2022-10-21 19:44:35 +03:00
Robert Schulze
82139fad0e
Docs: Remove obsolete modelEvaluate() mention 2022-09-28 11:47:16 +00:00
Robert Schulze
60f9f6855d
feat: implement catboost in library-bridge
This commit moves the catboost model evaluation out of the server
process into the library-bridge binary. This serves two goals: On the
one hand, crashes / memory corruptions of the catboost library no longer
affect the server. On the other hand, we can forbid loading dynamic
libraries in the server (catboost was the last consumer of this
functionality), thus improving security.

SQL syntax:

  SELECT
    catboostEvaluate('/path/to/model.bin', FEAT_1, ..., FEAT_N) > 0 AS prediction,
    ACTION AS target
  FROM amazon_train
  LIMIT 10

Required configuration:

  <catboost_lib_path>/path/to/libcatboostmodel.so</catboost_lib_path>

*** Implementation Details ***

The internal protocol between the server and the library-bridge is
simple:

- HTTP GET on path "/extdict_ping":
  A ping, used during the handshake to check if the library-bridge runs.

- HTTP POST on path "extdict_request"
  (1) Send a "catboost_GetTreeCount" request from the server to the
      bridge, containing a library path (e.g /home/user/libcatboost.so) and
      a model path (e.g. /home/user/model.bin). Rirst, this unloads the
      catboost library handler associated to the model path (if it was
      loaded), then loads the catboost library handler associated to the
      model path, then executes GetTreeCount() on the library handler and
      finally sends the result back to the server. Step (1) is called once
      by the server from FunctionCatBoostEvaluate::getReturnTypeImpl(). The
      library path handler is unloaded in the beginning because it contains
      state which may no longer be valid if the user runs
      catboost("/path/to/model.bin", ...) more than once and if "model.bin"
      was updated in between.
  (2) Send "catboost_Evaluate" from the server to the bridge, containing
      the model path and the features to run the interference on. Step (2)
      is called multiple times (once per chunk) by the server from function
      FunctionCatBoostEvaluate::executeImpl(). The library handler for the
      given model path is expected to be already loaded by Step (1).

Fixes #27870
2022-09-08 09:01:32 +00:00
Robert Schulze
912663b719
Revert "Move CatBoost evaluation into clickhouse-library-bridge" 2022-08-31 20:54:43 +02:00
Robert Schulze
6b2b3c1eb3
feat: implement catboost in library-bridge
This commit moves the catboost model evaluation out of the server
process into the library-bridge binary. This serves two goals: On the
one hand, crashes / memory corruptions of the catboost library no longer
affect the server. On the other hand, we can forbid loading dynamic
libraries in the server (catboost was the last consumer of this
functionality), thus improving security.

SQL syntax:

  SELECT
    catboostEvaluate('/path/to/model.bin', FEAT_1, ..., FEAT_N) > 0 AS prediction,
    ACTION AS target
  FROM amazon_train
  LIMIT 10

Required configuration:

  <catboost_lib_path>/path/to/libcatboostmodel.so</catboost_lib_path>

*** Implementation Details ***

The internal protocol between the server and the library-bridge is
simple:

- HTTP GET on path "/extdict_ping":
  A ping, used during the handshake to check if the library-bridge runs.

- HTTP POST on path "extdict_request"
  (1) Send a "catboost_GetTreeCount" request from the server to the
      bridge, containing a library path (e.g /home/user/libcatboost.so) and
      a model path (e.g. /home/user/model.bin). Rirst, this unloads the
      catboost library handler associated to the model path (if it was
      loaded), then loads the catboost library handler associated to the
      model path, then executes GetTreeCount() on the library handler and
      finally sends the result back to the server. Step (1) is called once
      by the server from FunctionCatBoostEvaluate::getReturnTypeImpl(). The
      library path handler is unloaded in the beginning because it contains
      state which may no longer be valid if the user runs
      catboost("/path/to/model.bin", ...) more than once and if "model.bin"
      was updated in between.
  (2) Send "catboost_Evaluate" from the server to the bridge, containing
      the model path and the features to run the interference on. Step (2)
      is called multiple times (once per chunk) by the server from function
      FunctionCatBoostEvaluate::executeImpl(). The library handler for the
      given model path is expected to be already loaded by Step (1).

Fixes #27870
2022-08-29 20:26:45 +00:00
DanRoscigno
5b5fcc56aa add slugs 2022-08-28 10:53:34 -04:00
Robert Schulze
f121941916
feat: allow custom error code for SQL function throwIf() 2022-08-17 21:14:40 +00:00
jiahui-97
e7af88b688 implementation of parseTimeDelta function
Co-authored-by: Kruglov Pavel <48961922+Avogar@users.noreply.github.com>
2022-07-19 09:33:02 +08:00
rfraposa
869967de41 Remove H1 anchor tags from docs 2022-06-02 04:55:18 -06:00
rfraposa
d9e6f780db Fixed broken links 2022-04-10 23:01:34 -06:00
rfraposa
8f01fe9c49 Revised /en folder 2022-04-09 07:34:21 -06:00
rfraposa
5250d9ad11 Removed /ja folder, cleaned up /ru markdown 2022-04-09 07:29:05 -06:00
taiyang-li
7889059f7d fix building 2022-03-25 22:39:57 +08:00
李扬
1d8ab36de0
Update other-functions.md 2022-03-23 21:44:14 +08:00
taiyang-li
98a9b81c1d update doc 2022-03-21 14:23:25 +08:00
taiyang-li
93550d547e add doc and tests 2022-03-15 18:25:36 +08:00
Roman Bug
b8248cdc95 Minor fix. 2021-11-09 13:08:47 +03:00
Roman Bug
d8f1ff7727
Update docs/en/sql-reference/functions/other-functions.md
Co-authored-by: gyuton <40863448+gyuton@users.noreply.github.com>
2021-11-09 13:02:06 +03:00
romanzhukov
206c72ed50 DOCSUP-15137: Add zookeeperSessionUptime docs. 2021-11-08 00:42:57 +03:00
Dmitriy
894353d910 Translate to Russian
Выполнил перевод на русский язык.
2021-10-21 21:33:47 +03:00
Dmitriy
b0752b43ac Add the getOSKernelVersion function
Задокументировал английскую версию функции getOSKernelVersion.
2021-10-20 20:20:14 +03:00
Alexey
7f5852a711 New buildId variant
Links from Distributed
2021-10-09 18:37:28 +00:00
Alexey
f854065744 buildID() description 2021-10-08 05:05:12 +00:00
Alexey
c2533b9743 constant or column note added for other functions 2021-10-06 20:13:46 +00:00
Alexey
4894588f27 description improved
new example
2021-10-06 19:50:05 +00:00
Alexey
2266115c54 Merge branch 'master' of https://github.com/ClickHouse/ClickHouse into alexey-sm-DOCSUP-14057-document-shardNum-shardCount 2021-10-05 19:35:46 +00:00
Alexey Milovidov
e9e77b4403 .tech -> .com 2021-09-22 03:22:57 +03:00
Alexey
6277747e8a First draft 2021-09-20 05:37:18 +00:00
Alexey Milovidov
147ef79670 Change website URL, part 1 2021-09-20 01:56:28 +03:00
Dmitriy
c9db269569 Merge remote-tracking branch 'remotes/clickhouse/master' into sevirov-DOCSUP-13590-document_the_getserverport_function 2021-08-29 19:00:29 +03:00
Dmitriy
b62fb1e8cf
Update docs/en/sql-reference/functions/other-functions.md
Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>
2021-08-25 22:30:14 +03:00
Dmitriy
80b6097dae Fix typo
Убрал лишние отступы.
2021-08-25 20:33:00 +03:00
Dmitriy
7295bf95b3
Update docs/en/sql-reference/functions/other-functions.md
Co-authored-by: Alexey Boykov <33257111+mathalex@users.noreply.github.com>
2021-08-25 20:16:16 +03:00
Dmitriy
e8e60e1a60
Update docs/en/sql-reference/functions/other-functions.md
Co-authored-by: Alexey Boykov <33257111+mathalex@users.noreply.github.com>
2021-08-25 20:15:57 +03:00
Dmitriy
f1be822a1a
Update docs/en/sql-reference/functions/other-functions.md
Co-authored-by: Alexey Boykov <33257111+mathalex@users.noreply.github.com>
2021-08-25 20:14:04 +03:00
Dmitriy
7d9180cd8c Update other-functions.md
Поправил предупреждение.
2021-08-24 20:08:39 +03:00
Dmitriy
dd5e303e29
Update docs/en/sql-reference/functions/other-functions.md
Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>
2021-08-24 19:52:28 +03:00
Dmitriy
41bf324f9c
Update docs/en/sql-reference/functions/other-functions.md
Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>
2021-08-24 19:51:56 +03:00
Dmitriy
77483f14c1
Update docs/en/sql-reference/functions/other-functions.md
Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>
2021-08-24 19:51:29 +03:00
Dmitriy
c491d1a587
Update docs/en/sql-reference/functions/other-functions.md
Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>
2021-08-24 19:51:20 +03:00
Dmitriy
3d9668cf40 Translate to Russian
Перевел на русский язык.
2021-08-23 22:44:01 +03:00
Dmitriy
df94b49179 Translate to Russian
Перевел на русский язык.
2021-08-22 19:02:40 +03:00
Dmitriy
f120f3c8a0 Document the getServerPort function
Задокументировал функцию getServerPort.
2021-08-22 13:38:43 +03:00
Dmitriy
eeec8004e8 Add the example
Добавил примеры.
2021-08-21 23:26:27 +03:00
Dmitriy
7887f3892b Document queryID and initialQueryID functions
Задокументировал две функции.
2021-08-21 13:47:06 +03:00
Vitaly Baranov
d3667b348a
Update other-functions.md 2021-08-09 16:16:31 +03:00