Skip to content

Commit dead208

Browse files
committed
Cosmetics
1 parent c06a04b commit dead208

File tree

5 files changed

+35
-95
lines changed

5 files changed

+35
-95
lines changed

starrocks/queries_formatted.sql

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
------------------------------------------------------------------------------------------------------------------------
44

55
SELECT get_json_string(data, 'commit.collection') AS event,
6-
count() AS count
7-
FROM bluesky
8-
GROUP BY event
6+
count() AS count
7+
FROM bluesky
8+
GROUP BY event
99
ORDER BY count DESC;
1010

1111
------------------------------------------------------------------------------------------------------------------------
@@ -17,33 +17,33 @@ SELECT
1717
count(DISTINCT get_json_string(data, 'did')) AS users
1818
FROM bluesky
1919
WHERE (get_json_string(data, 'kind') = 'commit')
20-
AND (get_json_string(data, 'commit.operation') = 'create')
20+
AND (get_json_string(data, 'commit.operation') = 'create')
2121
GROUP BY event
2222
ORDER BY count DESC;
2323

2424
------------------------------------------------------------------------------------------------------------------------
2525
-- Q3 - When do people use BlueSky
2626
------------------------------------------------------------------------------------------------------------------------
2727
SELECT
28-
get_json_string(data, 'commit.collection') AS event,
28+
get_json_string(data, 'commit.collection') AS event,
2929
hour_from_unixtime(get_json_int(data, 'time_us')/1000000) as hour_of_day,
3030
count() AS count
3131
FROM bluesky
32-
WHERE (get_json_string(data, 'kind') = 'commit')
33-
AND (get_json_string(data, 'commit.operation') = 'create')
34-
AND (array_contains(['app.bsky.feed.post', 'app.bsky.feed.repost', 'app.bsky.feed.like'], get_json_string(data, 'commit.collection')))
32+
WHERE (get_json_string(data, 'kind') = 'commit')
33+
AND (get_json_string(data, 'commit.operation') = 'create')
34+
AND (array_contains(['app.bsky.feed.post', 'app.bsky.feed.repost', 'app.bsky.feed.like'], get_json_string(data, 'commit.collection')))
3535
GROUP BY event, hour_of_day
3636
ORDER BY hour_of_day, event;
3737

3838
------------------------------------------------------------------------------------------------------------------------
3939
-- Q4 - top 3 post veterans
4040
------------------------------------------------------------------------------------------------------------------------
4141
SELECT
42-
get_json_string(data, 'did') as user_id,
43-
to_datetime(min(get_json_int(data, 'time_us')), 6) AS first_post_date
42+
get_json_string(data, 'did') as user_id,
43+
to_datetime(min(get_json_int(data, 'time_us')), 6) AS first_post_date
4444
FROM bluesky
45-
WHERE (get_json_string(data, 'kind') = 'commit')
46-
AND (get_json_string(data, 'commit.operation') = 'create')
45+
WHERE (get_json_string(data, 'kind') = 'commit')
46+
AND (get_json_string(data, 'commit.operation') = 'create')
4747
AND (get_json_string(data, 'commit.collection') = 'app.bsky.feed.post')
4848
GROUP BY user_id
4949
ORDER BY first_post_date ASC
@@ -53,13 +53,13 @@ LIMIT 3;
5353
-- Q5 - top 3 users with longest activity
5454
------------------------------------------------------------------------------------------------------------------------
5555
SELECT
56-
get_json_string(data, 'did') as user_id,
57-
date_diff('millisecond',
56+
get_json_string(data, 'did') as user_id,
57+
date_diff('millisecond',
5858
to_datetime(min(get_json_int(data, 'time_us')), 6),
59-
to_datetime(max(get_json_int(data, 'time_us')), 6)) AS activity_span
60-
FROM bluesky_sorted
61-
WHERE (get_json_string(data, 'kind') = 'commit')
62-
AND (get_json_string(data, 'commit.operation') = 'create')
59+
to_datetime(max(get_json_int(data, 'time_us')), 6)) AS activity_span
60+
FROM bluesky
61+
WHERE (get_json_string(data, 'kind') = 'commit')
62+
AND (get_json_string(data, 'commit.operation') = 'create')
6363
AND (get_json_string(data, 'commit.collection') = 'app.bsky.feed.post')
6464
GROUP BY user_id
6565
ORDER BY activity_span DESC
Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,5 @@
1-
{
2-
"system": "Starrocks",
3-
"version": "4.0.0-rc01",
4-
"os": "Ubuntu 24.04",
5-
"date": "2025-09-09",
6-
"machine": "m6i.8xlarge, 10000gib gp3",
7-
"retains_structure": "yes",
8-
"tags": [
9-
],
10-
"dataset_size": 1000000000,
11-
"num_loaded_documents": 996999662,
12-
"total_size": 192981470543,
13-
"result": [
14-
[0.47,0.44,0.43],
15-
[4.80,4.87,5.03],
16-
[1.90,1.53,1.51],
17-
[0.73,0.62,0.60],
18-
[0.67,0.70,0.70]
19-
]
20-
}
1+
[1.02,0.81,0.85],
2+
[8.93,8.70,20.44],
3+
[2.05,2.03,29.45],
4+
[3.25,1.76,21.13],
5+
[7.16,4.21,
Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,5 @@
1-
{
2-
"system": "Starrocks",
3-
"version": "4.0.0-rc01",
4-
"os": "Ubuntu 24.04",
5-
"date": "2025-09-09",
6-
"machine": "m6i.8xlarge, 10000gib gp3",
7-
"retains_structure": "yes",
8-
"tags": [
9-
],
10-
"dataset_size": 100000000,
11-
"num_loaded_documents": 99999984,
12-
"total_size": 18193481465,
13-
"result": [
14-
[0.06,0.06,0.06],
15-
[0.79,0.75,0.73],
16-
[0.17,0.17,0.17],
17-
[0.11,0.10,0.11],
18-
[0.12,0.12,0.11]
19-
]
20-
}
1+
[0.57,0.42,0.43],
2+
[8.04,1.28,1.19],
3+
[0.97,0.77,0.78],
4+
[0.76,0.73,0.78],
5+
[0.78,0.75,0.77],
Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,5 @@
1-
{
2-
"system": "Starrocks",
3-
"version": "4.0.0-rc01",
4-
"os": "Ubuntu 24.04",
5-
"date": "2025-09-09",
6-
"machine": "m6i.8xlarge, 10000gib gp3",
7-
"retains_structure": "yes",
8-
"tags": [
9-
],
10-
"dataset_size": 10000000,
11-
"num_loaded_documents": 9999997,
12-
"total_size": 2043330691,
13-
"result": [
14-
[0.02,0.02,0.02],
15-
[0.13,0.11,0.11],
16-
[0.04,0.03,0.04],
1+
[0.07,0.05,0.05],
2+
[0.33,0.32,0.32],
3+
[0.11,0.11,0.09],
4+
[0.03,0.03,0.02],
175
[0.03,0.03,0.03],
18-
[0.04,0.04,0.04]
19-
]
20-
}
Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,5 @@
1-
{
2-
"system": "Starrocks",
3-
"version": "4.0.0-rc01",
4-
"os": "Ubuntu 24.04",
5-
"date": "2025-09-09",
6-
"machine": "m6i.8xlarge, 10000gib gp3",
7-
"retains_structure": "yes",
8-
"tags": [
9-
],
10-
"dataset_size": 1000000,
11-
"num_loaded_documents": 1000000,
12-
"total_size": 207987146,
13-
"result": [
14-
[0.01,0.02,0.01],
1+
[0.03,0.03,0.03],
2+
[0.11,0.05,0.04],
153
[0.04,0.04,0.03],
4+
[0.03,0.02,0.02],
165
[0.02,0.02,0.02],
17-
[0.02,0.02,0.02],
18-
[0.02,0.02,0.03]
19-
]
20-
}

0 commit comments

Comments
 (0)