0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-24 00:47:50 +01:00

feat: udf v2 (#25642)

This commit is contained in:
Sandy Spicer 2024-10-17 11:55:04 -07:00 committed by GitHub
parent 532ecc6cdf
commit a9b5a600bd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 625 additions and 0 deletions

View File

@ -0,0 +1,9 @@
#!/bin/sh
DIR_NAME=$(dirname "$0")
case $( uname -m ) in
aarch64) $DIR_NAME/aggregate_funnel_aarch64 "$@";;
*) $DIR_NAME/aggregate_funnel_x86_64 "$@";;
esac

Binary file not shown.

View File

@ -0,0 +1,13 @@
#!/usr/bin/python3
import sys
import json
if __name__ == "__main__":
for line in sys.stdin:
try:
print(json.dumps({"result": line})) # noqa: T201
# calculate_funnel_trends_from_user_events(*parse_args(line))
except Exception as e:
print(json.dumps({"result": json.dumps(str(e))}), end="\n") # noqa: T201
sys.stdout.flush()

View File

@ -0,0 +1,14 @@
#!/usr/bin/python3
import json
import sys
import traceback
if __name__ == "__main__":
for line in sys.stdin:
try:
# calculate_funnel_from_user_events(*parse_args(line))
print(json.dumps({"result": line})) # noqa: T201
except Exception as e:
print(json.dumps({"result": json.dumps(str(e) + traceback.format_exc())}), end="\n") # noqa: T201
sys.stdout.flush()

Binary file not shown.

View File

@ -0,0 +1,589 @@
<functions>
<!-- Version: v2. Generated at: 2024-10-17T05:08:53.836354+00:00
This file is autogenerated by udf_versioner.py. Do not edit this, only edit the version at docker/clickhouse/user_defined_function.xml--><function>
<type>executable_pool</type>
<name>aggregate_funnel_v1</name>
<return_type>Array(Tuple(Int8, Nullable(String), Array(Float64), Array(Array(UUID))))</return_type>
<return_name>result</return_name>
<argument>
<type>UInt8</type>
<name>num_steps</name>
</argument>
<argument>
<type>UInt64</type>
<name>conversion_window_limit</name>
</argument>
<argument>
<type>String</type>
<name>breakdown_attribution_type</name>
</argument>
<argument>
<type>String</type>
<name>funnel_order_type</name>
</argument>
<argument>
<type>Array(Nullable(String))</type>
<name>prop_vals</name>
</argument>
<argument>
<type>Array(Tuple(Nullable(Float64), UUID, Nullable(String), Array(Int8)))</type>
<name>value</name>
</argument>
<format>JSONEachRow</format>
<command>v1/aggregate_funnel steps</command>
<lifetime>600</lifetime>
</function>
<function>
<type>executable_pool</type>
<name>aggregate_funnel_cohort_v1</name>
<return_type>Array(Tuple(Int8, UInt64, Array(Float64), Array(Array(UUID))))</return_type>
<return_name>result</return_name>
<argument>
<type>UInt8</type>
<name>num_steps</name>
</argument>
<argument>
<type>UInt64</type>
<name>conversion_window_limit</name>
</argument>
<argument>
<type>String</type>
<name>breakdown_attribution_type</name>
</argument>
<argument>
<type>String</type>
<name>funnel_order_type</name>
</argument>
<argument>
<type>Array(UInt64)</type>
<name>prop_vals</name>
</argument>
<argument>
<type>Array(Tuple(Nullable(Float64), UUID, UInt64, Array(Int8)))</type>
<name>value</name>
</argument>
<format>JSONEachRow</format>
<command>v1/aggregate_funnel steps</command>
<lifetime>600</lifetime>
</function>
<function>
<type>executable_pool</type>
<name>aggregate_funnel_array_v1</name>
<return_type>Array(Tuple(Int8, Array(String), Array(Float64), Array(Array(UUID))))</return_type>
<return_name>result</return_name>
<argument>
<type>UInt8</type>
<name>num_steps</name>
</argument>
<argument>
<type>UInt64</type>
<name>conversion_window_limit</name>
</argument>
<argument>
<type>String</type>
<name>breakdown_attribution_type</name>
</argument>
<argument>
<type>String</type>
<name>funnel_order_type</name>
</argument>
<argument>
<type>Array(Array(String))</type>
<name>prop_vals</name>
</argument>
<argument>
<type>Array(Tuple(Nullable(Float64), UUID, Array(String), Array(Int8)))</type>
<name>value</name>
</argument>
<format>JSONEachRow</format>
<command>v1/aggregate_funnel steps</command>
<lifetime>600</lifetime>
</function>
<function>
<type>executable_pool</type>
<name>aggregate_funnel_test_v1</name>
<return_type>String</return_type>
<return_name>result</return_name>
<argument>
<type>UInt8</type>
<name>num_steps</name>
</argument>
<argument>
<type>UInt64</type>
<name>conversion_window_limit</name>
</argument>
<argument>
<type>String</type>
<name>breakdown_attribution_type</name>
</argument>
<argument>
<type>String</type>
<name>funnel_order_type</name>
</argument>
<argument>
<type>Array(Array(String))</type>
<name>prop_vals</name>
</argument>
<argument>
<type>Array(Tuple(Nullable(Float64), UUID, Nullable(String), Array(Int8)))</type>
<name>value</name>
</argument>
<format>JSONEachRow</format>
<command>v1/aggregate_funnel_test.py</command>
<lifetime>600</lifetime>
</function>
<function>
<type>executable_pool</type>
<name>aggregate_funnel_trends_v1</name>
<return_type>Array(Tuple(UInt64, Int8, Nullable(String)))</return_type>
<return_name>result</return_name>
<argument>
<type>UInt8</type>
<name>from_step</name>
</argument>
<argument>
<type>UInt8</type>
<name>num_steps</name>
</argument>
<argument>
<type>UInt8</type>
<name>num_steps</name>
</argument>
<argument>
<type>UInt64</type>
<name>conversion_window_limit</name>
</argument>
<argument>
<type>String</type>
<name>breakdown_attribution_type</name>
</argument>
<argument>
<type>String</type>
<name>funnel_order_type</name>
</argument>
<argument>
<type>Array(Nullable(String))</type>
<name>prop_vals</name>
</argument>
<argument>
<type>Array(Tuple(Nullable(Float64), UInt64, Nullable(String), Array(Int8)))</type>
<name>value</name>
</argument>
<format>JSONEachRow</format>
<command>v1/aggregate_funnel trends</command>
<lifetime>600</lifetime>
</function>
<function>
<type>executable_pool</type>
<name>aggregate_funnel_array_trends_v1</name>
<return_type>Array(Tuple(UInt64, Int8, Array(String)))</return_type>
<return_name>result</return_name>
<argument>
<type>UInt8</type>
<name>from_step</name>
</argument>
<argument>
<type>UInt8</type>
<name>num_steps</name>
</argument>
<argument>
<type>UInt64</type>
<name>conversion_window_limit</name>
</argument>
<argument>
<type>String</type>
<name>breakdown_attribution_type</name>
</argument>
<argument>
<type>String</type>
<name>funnel_order_type</name>
</argument>
<argument>
<type>Array(Array(String))</type>
<name>prop_vals</name>
</argument>
<argument>
<type>Array(Tuple(Nullable(Float64), UInt64, Array(String), Array(Int8)))</type>
<name>value</name>
</argument>
<format>JSONEachRow</format>
<command>v1/aggregate_funnel trends</command>
<lifetime>600</lifetime>
</function>
<function>
<type>executable_pool</type>
<name>aggregate_funnel_cohort_trends_v1</name>
<return_type>Array(Tuple(UInt64, Int8, UInt64))</return_type>
<return_name>result</return_name>
<argument>
<type>UInt8</type>
<name>from_step</name>
</argument>
<argument>
<type>UInt8</type>
<name>num_steps</name>
</argument>
<argument>
<type>UInt64</type>
<name>conversion_window_limit</name>
</argument>
<argument>
<type>String</type>
<name>breakdown_attribution_type</name>
</argument>
<argument>
<type>String</type>
<name>funnel_order_type</name>
</argument>
<argument>
<type>Array(UInt64)</type>
<name>prop_vals</name>
</argument>
<argument>
<type>Array(Tuple(Nullable(Float64), UInt64, UInt64, Array(Int8)))</type>
<name>value</name>
</argument>
<format>JSONEachRow</format>
<command>v1/aggregate_funnel trends</command>
<lifetime>600</lifetime>
</function>
<function>
<type>executable_pool</type>
<name>aggregate_funnel_array_trends_test_v1</name>
<return_type>String</return_type>
<return_name>result</return_name>
<argument>
<type>UInt8</type>
<name>from_step</name>
</argument>
<argument>
<type>UInt8</type>
<name>num_steps</name>
</argument>
<argument>
<type>UInt64</type>
<name>conversion_window_limit</name>
</argument>
<argument>
<type>String</type>
<name>breakdown_attribution_type</name>
</argument>
<argument>
<type>String</type>
<name>funnel_order_type</name>
</argument>
<argument>
<type>Array(Array(String))</type>
<name>prop_vals</name>
</argument>
<argument>
<type>Array(Tuple(Nullable(Float64), UInt64, Array(String), Array(Int8)))</type>
<name>value</name>
</argument>
<format>JSONEachRow</format>
<command>v1/aggregate_funnel_array_trends_test.py</command>
<lifetime>600</lifetime>
</function>
<function>
<type>executable_pool</type>
<name>aggregate_funnel_v2</name>
<return_type>Array(Tuple(Int8, Nullable(String), Array(Float64), Array(Array(UUID))))</return_type>
<return_name>result</return_name>
<argument>
<type>UInt8</type>
<name>num_steps</name>
</argument>
<argument>
<type>UInt64</type>
<name>conversion_window_limit</name>
</argument>
<argument>
<type>String</type>
<name>breakdown_attribution_type</name>
</argument>
<argument>
<type>String</type>
<name>funnel_order_type</name>
</argument>
<argument>
<type>Array(Nullable(String))</type>
<name>prop_vals</name>
</argument>
<argument>
<type>Array(Tuple(Nullable(Float64), UUID, Nullable(String), Array(Int8)))</type>
<name>value</name>
</argument>
<format>JSONEachRow</format>
<command>v2/aggregate_funnel steps</command>
<lifetime>600</lifetime>
</function>
<function>
<type>executable_pool</type>
<name>aggregate_funnel_cohort_v2</name>
<return_type>Array(Tuple(Int8, UInt64, Array(Float64), Array(Array(UUID))))</return_type>
<return_name>result</return_name>
<argument>
<type>UInt8</type>
<name>num_steps</name>
</argument>
<argument>
<type>UInt64</type>
<name>conversion_window_limit</name>
</argument>
<argument>
<type>String</type>
<name>breakdown_attribution_type</name>
</argument>
<argument>
<type>String</type>
<name>funnel_order_type</name>
</argument>
<argument>
<type>Array(UInt64)</type>
<name>prop_vals</name>
</argument>
<argument>
<type>Array(Tuple(Nullable(Float64), UUID, UInt64, Array(Int8)))</type>
<name>value</name>
</argument>
<format>JSONEachRow</format>
<command>v2/aggregate_funnel steps</command>
<lifetime>600</lifetime>
</function>
<function>
<type>executable_pool</type>
<name>aggregate_funnel_array_v2</name>
<return_type>Array(Tuple(Int8, Array(String), Array(Float64), Array(Array(UUID))))</return_type>
<return_name>result</return_name>
<argument>
<type>UInt8</type>
<name>num_steps</name>
</argument>
<argument>
<type>UInt64</type>
<name>conversion_window_limit</name>
</argument>
<argument>
<type>String</type>
<name>breakdown_attribution_type</name>
</argument>
<argument>
<type>String</type>
<name>funnel_order_type</name>
</argument>
<argument>
<type>Array(Array(String))</type>
<name>prop_vals</name>
</argument>
<argument>
<type>Array(Tuple(Nullable(Float64), UUID, Array(String), Array(Int8)))</type>
<name>value</name>
</argument>
<format>JSONEachRow</format>
<command>v2/aggregate_funnel steps</command>
<lifetime>600</lifetime>
</function>
<function>
<type>executable_pool</type>
<name>aggregate_funnel_test_v2</name>
<return_type>String</return_type>
<return_name>result</return_name>
<argument>
<type>UInt8</type>
<name>num_steps</name>
</argument>
<argument>
<type>UInt64</type>
<name>conversion_window_limit</name>
</argument>
<argument>
<type>String</type>
<name>breakdown_attribution_type</name>
</argument>
<argument>
<type>String</type>
<name>funnel_order_type</name>
</argument>
<argument>
<type>Array(Array(String))</type>
<name>prop_vals</name>
</argument>
<argument>
<type>Array(Tuple(Nullable(Float64), UUID, Nullable(String), Array(Int8)))</type>
<name>value</name>
</argument>
<format>JSONEachRow</format>
<command>v2/aggregate_funnel_test.py</command>
<lifetime>600</lifetime>
</function>
<function>
<type>executable_pool</type>
<name>aggregate_funnel_trends_v2</name>
<return_type>Array(Tuple(UInt64, Int8, Nullable(String), UUID))</return_type>
<return_name>result</return_name>
<argument>
<type>UInt8</type>
<name>from_step</name>
</argument>
<argument>
<type>UInt8</type>
<name>num_steps</name>
</argument>
<argument>
<type>UInt8</type>
<name>num_steps</name>
</argument>
<argument>
<type>UInt64</type>
<name>conversion_window_limit</name>
</argument>
<argument>
<type>String</type>
<name>breakdown_attribution_type</name>
</argument>
<argument>
<type>String</type>
<name>funnel_order_type</name>
</argument>
<argument>
<type>Array(Nullable(String))</type>
<name>prop_vals</name>
</argument>
<argument>
<type>Array(Tuple(Nullable(Float64), UInt64, UUID, Nullable(String), Array(Int8)))</type>
<name>value</name>
</argument>
<format>JSONEachRow</format>
<command>v2/aggregate_funnel trends</command>
<lifetime>600</lifetime>
</function>
<function>
<type>executable_pool</type>
<name>aggregate_funnel_array_trends_v2</name>
<return_type>Array(Tuple(UInt64, Int8, Array(String), UUID))</return_type>
<return_name>result</return_name>
<argument>
<type>UInt8</type>
<name>from_step</name>
</argument>
<argument>
<type>UInt8</type>
<name>num_steps</name>
</argument>
<argument>
<type>UInt64</type>
<name>conversion_window_limit</name>
</argument>
<argument>
<type>String</type>
<name>breakdown_attribution_type</name>
</argument>
<argument>
<type>String</type>
<name>funnel_order_type</name>
</argument>
<argument>
<type>Array(Array(String))</type>
<name>prop_vals</name>
</argument>
<argument>
<type>Array(Tuple(Nullable(Float64), UInt64, UUID, Array(String), Array(Int8)))</type>
<name>value</name>
</argument>
<format>JSONEachRow</format>
<command>v2/aggregate_funnel trends</command>
<lifetime>600</lifetime>
</function>
<function>
<type>executable_pool</type>
<name>aggregate_funnel_cohort_trends_v2</name>
<return_type>Array(Tuple(UInt64, Int8, UInt64, UUID))</return_type>
<return_name>result</return_name>
<argument>
<type>UInt8</type>
<name>from_step</name>
</argument>
<argument>
<type>UInt8</type>
<name>num_steps</name>
</argument>
<argument>
<type>UInt64</type>
<name>conversion_window_limit</name>
</argument>
<argument>
<type>String</type>
<name>breakdown_attribution_type</name>
</argument>
<argument>
<type>String</type>
<name>funnel_order_type</name>
</argument>
<argument>
<type>Array(UInt64)</type>
<name>prop_vals</name>
</argument>
<argument>
<type>Array(Tuple(Nullable(Float64), UInt64, UUID, UInt64, Array(Int8)))</type>
<name>value</name>
</argument>
<format>JSONEachRow</format>
<command>v2/aggregate_funnel trends</command>
<lifetime>600</lifetime>
</function>
<function>
<type>executable_pool</type>
<name>aggregate_funnel_array_trends_test_v2</name>
<return_type>String</return_type>
<return_name>result</return_name>
<argument>
<type>UInt8</type>
<name>from_step</name>
</argument>
<argument>
<type>UInt8</type>
<name>num_steps</name>
</argument>
<argument>
<type>UInt64</type>
<name>conversion_window_limit</name>
</argument>
<argument>
<type>String</type>
<name>breakdown_attribution_type</name>
</argument>
<argument>
<type>String</type>
<name>funnel_order_type</name>
</argument>
<argument>
<type>Array(Array(String))</type>
<name>prop_vals</name>
</argument>
<argument>
<type>Array(Tuple(Nullable(Float64), UInt64, UUID, Array(String), Array(Int8)))</type>
<name>value</name>
</argument>
<format>JSONEachRow</format>
<command>v2/aggregate_funnel_array_trends_test.py</command>
<lifetime>600</lifetime>
</function>
</functions>