Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .github/actions/test_stateful_standalone_linux/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,15 @@ runs:
- name: Run Stateful Tests with Standalone mode (ubuntu-latest only)
shell: bash
run: |
bash ./scripts/ci/ci-run-stateful-tests-standalone-s3.sh
./scripts/ci/ci-run-stateful-tests-standalone-s3.sh

- name: Upload .stdout files
if: failure()
uses: actions/upload-artifact@v3
with:
name: test-stateful-standalone-linux-stdouts
path: |
./tests/suites/1_stateful/*/*.stdout

- name: Upload failure
if: failure()
Expand Down
46 changes: 46 additions & 0 deletions tests/suites/1_stateful/04_mini_dataset/04_0000_mini_ontime.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
1 16773
2 16651
7 15551
3 13671
5 13159
4 13153
6 11041
1 4279
2 3637
7 3571
3 2788
5 2191
4 1880
6 1813
ORD 2036
DTW 1817
DFW 1719
MSP 1506
ATL 877
LGA 816
CVG 603
BOS 556
MEM 509
RDU 371
FL 221.4065829978688
OH 208.2369273484498
NW 207.8941134667772
MQ 205.4136942462831
HA 54.34782608695652
FL 17308.666824532324
HA 5713.526570048309
MQ 12316.754450296687
NW 11370.336373327018
OH 12599.259602036094
2006 12.16979169791698
99999.0
San Diego, CA Los Angeles, CA 622
Los Angeles, CA San Diego, CA 619
Kahului, HI Honolulu, HI 605
Honolulu, HI Kahului, HI 592
Chicago, IL Minneapolis, MN 586
Minneapolis, MN Chicago, IL 565
New York, NY Boston, MA 523
Boston, MA New York, NY 522
New York, NY Raleigh/Durham, NC 488
Lihue, HI Honolulu, HI 486
31 changes: 31 additions & 0 deletions tests/suites/1_stateful/04_mini_dataset/04_0000_mini_ontime.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env bash

CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
. "$CURDIR"/../../../shell_env.sh

echo "drop table if exists ontime_mini;" | $MYSQL_CLIENT_CONNECT
## Create table
cat $CURDIR/../ddl/ontime.sql | sed 's/ontime/ontime_mini/g' | $MYSQL_CLIENT_CONNECT

ontime_statements=(
## Load data
"COPY INTO ontime_mini FROM 'https://repo.databend.rs/dataset/stateful/ontime_2006_100000.csv' FILE_FORMAT = ( type = 'CSV' field_delimiter = ',' record_delimiter = '\n' skip_header = 1 );"
## run test
"SELECT DayOfWeek, count(*) AS c FROM ontime_mini WHERE (Year >= 2000) AND (Year <= 2008) GROUP BY DayOfWeek ORDER BY c DESC;"
"SELECT DayOfWeek, count(*) AS c FROM ontime_mini WHERE (DepDelay > 10) AND (Year >= 2000) AND (Year <= 2008) GROUP BY DayOfWeek ORDER BY c DESC;"
"SELECT Origin, count(*) AS c FROM ontime_mini WHERE (DepDelay > 10) AND (Year >= 2000) AND (Year <= 2008) GROUP BY Origin ORDER BY c DESC LIMIT 10;"
"SELECT IATA_CODE_Reporting_Airline AS Carrier, count() FROM ontime_mini WHERE (DepDelay > 10) AND (Year = 2007) GROUP BY Carrier ORDER BY count() DESC;"
"SELECT IATA_CODE_Reporting_Airline AS Carrier, avg(CAST(DepDelay > 10, Int8)) * 1000 AS c3 FROM ontime_mini WHERE Year = 2007 GROUP BY Carrier ORDER BY c3 DESC;"
"SELECT IATA_CODE_Reporting_Airline AS Carrier, avg(CAST(DepDelay > 10, Int8)) * 1000 AS c3 FROM ontime_mini WHERE (Year >= 2000) AND (Year <= 2008) GROUP BY Carrier ORDER BY c3 DESC;"
"SELECT IATA_CODE_Reporting_Airline AS Carrier, avg(DepDelay) * 1000 AS c3 FROM ontime_mini WHERE (Year >= 2000) AND (Year <= 2008) GROUP BY Carrier ORDER BY Carrier;"
"SELECT Year, avg(DepDelay) FROM ontime_mini GROUP BY Year;"
"SELECT avg(c1) FROM ( SELECT Year, Month, count(*) AS c1 FROM ontime_mini GROUP BY Year, Month ) AS a;"
"SELECT OriginCityName, DestCityName, count(*) AS c FROM ontime_mini GROUP BY OriginCityName, DestCityName ORDER BY c DESC LIMIT 10;"
)

for i in "${ontime_statements[@]}"; do
echo "set enable_planner_v2 = 1; $i" | $MYSQL_CLIENT_CONNECT
done

## Clean table
echo "drop table if exists ontime_mini all;" | $MYSQL_CLIENT_CONNECT