Skip to content

Commit a4bef13

Browse files
feat: unordered steps and trends funnels in udfs (#29802)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 7e17e3a commit a4bef13

34 files changed

+1396
-658
lines changed

docker-compose.dev.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,6 @@ services:
6666
- '9440:9440'
6767
- '9009:9009'
6868
volumes:
69-
# this new entrypoint file is to fix a bug detailed here https://github.com/ClickHouse/ClickHouse/pull/59991
70-
# revert this when we upgrade clickhouse
71-
- ./docker/clickhouse/entrypoint.sh:/entrypoint.sh
7269
- ./posthog/idl:/idl
7370
- ./docker/clickhouse/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d
7471
- ./docker/clickhouse/config.xml:/etc/clickhouse-server/config.xml

docker/clickhouse/entrypoint.sh

Lines changed: 0 additions & 207 deletions
This file was deleted.

docker/clickhouse/user_defined_function.xml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,10 @@
144144
<type>UInt8</type>
145145
<name>from_step</name>
146146
</argument>
147+
<argument>
148+
<type>UInt8</type>
149+
<name>to_step</name>
150+
</argument>
147151
<argument>
148152
<type>UInt8</type>
149153
<name>num_steps</name>
@@ -183,6 +187,10 @@
183187
<type>UInt8</type>
184188
<name>from_step</name>
185189
</argument>
190+
<argument>
191+
<type>UInt8</type>
192+
<name>to_step</name>
193+
</argument>
186194
<argument>
187195
<type>UInt8</type>
188196
<name>num_steps</name>
@@ -222,6 +230,10 @@
222230
<type>UInt8</type>
223231
<name>from_step</name>
224232
</argument>
233+
<argument>
234+
<type>UInt8</type>
235+
<name>to_step</name>
236+
</argument>
225237
<argument>
226238
<type>UInt8</type>
227239
<name>num_steps</name>
@@ -260,6 +272,10 @@
260272
<type>UInt8</type>
261273
<name>from_step</name>
262274
</argument>
275+
<argument>
276+
<type>UInt8</type>
277+
<name>to_step</name>
278+
</argument>
263279
<argument>
264280
<type>UInt8</type>
265281
<name>num_steps</name>

funnel-udf/Cargo.lock

Lines changed: 26 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

funnel-udf/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ serde = { version = "1.0.104", features = ["derive"] }
88
serde_json = "1.0.48"
99
itertools = "0.11"
1010
uuid = { version = "1.10.0", features = ["v4", "serde"] }
11+
ordered-float = "5.0.0"
1112

1213
[profile.release]
1314
lto = true

funnel-udf/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ cross build --target x86_64-unknown-linux-gnu --release
55
cross build --target aarch64-unknown-linux-gnu --release
66
cp target/x86_64-unknown-linux-gnu/release/funnels ../posthog/user_scripts/aggregate_funnel_x86_64
77
cp target/aarch64-unknown-linux-gnu/release/funnels ../posthog/user_scripts/aggregate_funnel_aarch64
8-
echo "Make sure to run udf_versioner.py"
8+
echo "Make sure to run udf_versioner.py"

funnel-udf/src/main.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
mod steps;
22
mod trends;
3+
mod unordered_steps;
4+
mod unordered_trends;
35

4-
use std::env;
56
use serde::{Deserialize, Serialize};
7+
use std::env;
68
use std::io::{self, BufRead, Write};
79

8-
#[derive(Clone, PartialEq, Deserialize, Serialize)]
10+
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
911
#[serde(untagged)]
1012
enum PropVal {
1113
String(String),
@@ -30,4 +32,4 @@ fn main() {
3032
stdout.flush().unwrap();
3133
}
3234
}
33-
}
35+
}

0 commit comments

Comments
 (0)