Skip to content

Commit

Permalink
add queries, table & results for a generic testing staging framework …
Browse files Browse the repository at this point in the history
…setup

Signed-off-by: YANGDB <[email protected]>
  • Loading branch information
YANG-DB committed Nov 1, 2023
1 parent 2b316e5 commit 2dd5333
Show file tree
Hide file tree
Showing 17 changed files with 561 additions and 0 deletions.
1 change: 1 addition & 0 deletions integ-test/src/test/python/http_logs/queries/q1.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SELECT * FROM mys3.default.http_logs ORDER BY "@timestamp" LIMIT 5;
2 changes: 2 additions & 0 deletions integ-test/src/test/python/http_logs/queries/q2.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SELECT COUNT(DISTINCT clientip) as unique_client_ips
FROM mys3.default.http_logs;
8 changes: 8 additions & 0 deletions integ-test/src/test/python/http_logs/queries/q3.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
SELECT
FIRST(day) AS day,
status,
COUNT(status) AS status_count_by_day
FROM (SELECT * FROM mys3.default.http_logs LIMIT 1000)
GROUP BY day, status
ORDER BY day, status
LIMIT 10;
9 changes: 9 additions & 0 deletions integ-test/src/test/python/http_logs/queries/q4.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
SELECT
FIRST(day) AS day,
status,
COUNT(status) AS status_count_by_day
FROM mys3.default.http_logs
WHERE status >= 400
GROUP BY day, status
ORDER BY day, status
LIMIT 20;
8 changes: 8 additions & 0 deletions integ-test/src/test/python/http_logs/queries/q5.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
SELECT
status,
COUNT(status) AS status_count_by_day
FROM mys3.default.http_logs
WHERE status >= 400
GROUP BY status
ORDER BY status
LIMIT 20;
3 changes: 3 additions & 0 deletions integ-test/src/test/python/http_logs/queries/q6.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SELECT day, SUM(size) as total_size FROM mys3.default.http_logs
WHERE year = 1998 AND month =6
GROUP BY day;
6 changes: 6 additions & 0 deletions integ-test/src/test/python/http_logs/queries/q7.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
SELECT count(*) as count, clientip
FROM mys3.default.http_logs
WHERE clientip BETWEEN '208.0.0.0' AND '210.0.0.0'
GROUP BY clientip
ORDER BY DESC count
limit 20;
96 changes: 96 additions & 0 deletions integ-test/src/test/python/http_logs/results/q1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
{
"data": {
"ok": true,
"resp": {
"status": "SUCCESS",
"schema": [
{
"name": "@timestamp",
"type": "date"
},
{
"name": "clientip",
"type": "string"
},
{
"name": "request",
"type": "string"
},
{
"name": "status",
"type": "integer"
},
{
"name": "size",
"type": "integer"
},
{
"name": "year",
"type": "integer"
},
{
"name": "month",
"type": "integer"
},
{
"name": "day",
"type": "integer"
}
],
"datarows": [
[
"1998-06-10T14:37:23.000Z",
"76.112.16.0",
"GET /images/102325.gif HTTP/1.0",
200,
1555,
1998,
6,
10
],
[
"1998-06-10T14:37:23.000Z",
"78.109.16.0",
"GET /english/images/comp_bu_stage1n.gif HTTP/1.0",
200,
1548,
1998,
6,
10
],
[
"1998-06-10T14:37:23.000Z",
"140.48.14.0",
"GET /images/102321.gif HTTP/1.0",
200,
1602,
1998,
6,
10
],
[
"1998-06-10T14:37:23.000Z",
"114.113.16.0",
"GET /english/images/team_bu_roster_on.gif HTTP/1.0",
200,
1567,
1998,
6,
10
],
[
"1998-06-10T14:37:24.000Z",
"79.48.14.0",
"GET /english/images/comp_bu_stage1n.gif HTTP/1.0",
200,
1548,
1998,
6,
10
]
],
"total": 5,
"size": 5
}
}
}
21 changes: 21 additions & 0 deletions integ-test/src/test/python/http_logs/results/q2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"data": {
"ok": true,
"resp": {
"status": "SUCCESS",
"schema": [
{
"name": "unique_client_ips",
"type": "long"
}
],
"datarows": [
[
1149519
]
],
"total": 1,
"size": 1
}
}
}
31 changes: 31 additions & 0 deletions integ-test/src/test/python/http_logs/results/q3.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"data": {
"ok": true,
"resp": {
"status": "SUCCESS",
"schema": [
{
"name": "day",
"type": "integer"
},
{
"name": "status",
"type": "integer"
},
{
"name": "status_count_by_day",
"type": "long"
}
],
"datarows": [
[
12,
200,
1000
]
],
"total": 1,
"size": 1
}
}
}
126 changes: 126 additions & 0 deletions integ-test/src/test/python/http_logs/results/q4.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
{
"data": {
"ok": true,
"resp": {
"status": "SUCCESS",
"schema": [
{
"name": "day",
"type": "integer"
},
{
"name": "status",
"type": "integer"
},
{
"name": "status_count_by_day",
"type": "long"
}
],
"datarows": [
[
1,
400,
20
],
[
1,
404,
1757
],
[
1,
500,
33
],
[
2,
400,
4
],
[
2,
404,
1743
],
[
2,
500,
36
],
[
3,
400,
13
],
[
3,
404,
12790
],
[
3,
500,
56
],
[
4,
400,
119
],
[
4,
403,
1
],
[
4,
404,
48657
],
[
4,
500,
513
],
[
5,
400,
19
],
[
5,
404,
3190
],
[
5,
500,
47
],
[
6,
400,
35
],
[
6,
404,
4596
],
[
6,
500,
47
],
[
7,
400,
36
]
],
"total": 20,
"size": 20
}
}
}
38 changes: 38 additions & 0 deletions integ-test/src/test/python/http_logs/results/q5.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"data": {
"ok": true,
"resp": {
"status": "SUCCESS",
"schema": [
{
"name": "status",
"type": "integer"
},
{
"name": "status_count_by_day",
"type": "long"
}
],
"datarows": [
[
400,
2677
],
[
403,
224
],
[
404,
1224876
],
[
500,
6134
]
],
"total": 4,
"size": 4
}
}
}
Loading

0 comments on commit 2dd5333

Please sign in to comment.