-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclicklisp_function.xml
More file actions
68 lines (65 loc) · 2.59 KB
/
Copy pathclicklisp_function.xml
File metadata and controls
68 lines (65 loc) · 2.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<!--
ClickHouse executable UDF definitions backed by the clicklisp binary.
Install:
1. Copy bin/clicklisp into user_scripts_path
(default: /var/lib/clickhouse/user_scripts/).
2. Copy this file next to the server config so it matches
user_defined_executable_functions_config (default glob: *_function.*ml).
3. SELECT clicklisp_entropy(domain) FROM dns_events;
With execute_direct (the default) the first token of <command> must be an
executable inside user_scripts_path; the rest become argv.
type executable_pool keeps long-lived processes fed blocks over stdin;
send_chunk_header=1 prefixes each block with its row count, which lets the
process flush once per block instead of once per row.
-->
<functions>
<function>
<type>executable_pool</type>
<name>clicklisp_entropy</name>
<command>clicklisp udf --fn entropy --chunked</command>
<format>TabSeparated</format>
<argument>
<type>String</type>
<name>value</name>
</argument>
<return_type>Float64</return_type>
<send_chunk_header>1</send_chunk_header>
<deterministic>1</deterministic>
<pool_size>4</pool_size>
</function>
<function>
<type>executable</type>
<name>clicklisp_rot13</name>
<command>clicklisp udf --fn rot13</command>
<format>TabSeparated</format>
<argument>
<type>String</type>
<name>value</name>
</argument>
<return_type>String</return_type>
<deterministic>1</deterministic>
</function>
<!--
Hot patching: clicklisp_shout is served from a watched Lisp file
(copy examples/udfs/text.lisp into user_scripts_path next to the
binary). Edit text.lisp there and the next block is served by the
new definition; reloads use ECL's in-image bytecode compiler, so
no C toolchain is needed in the sandbox.
-->
<function>
<type>executable_pool</type>
<name>clicklisp_shout</name>
<!-- paths resolve against the server's working directory (the
`path` setting), so user_scripts/ points into user_scripts_path -->
<command>clicklisp udf --fn shout --load user_scripts/text.lisp --watch user_scripts/text.lisp --chunked</command>
<format>TabSeparated</format>
<argument>
<type>String</type>
<name>value</name>
</argument>
<return_type>Float64</return_type>
<send_chunk_header>1</send_chunk_header>
<deterministic>1</deterministic>
<pool_size>4</pool_size>
</function>
</functions>