Skip to content

Commit f3f022a

Browse files
committed
Test for checking results aws
Added query generator which generates equivalent queries for aws and ceph. After runing these queries, their results are matched. Signed-off-by: Girjesh Rajoria <grajoria@redhat.com>
1 parent b95da97 commit f3f022a

18 files changed

+535
-0
lines changed

test/queries_generator/aws_cmds.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/sh
2+
set -x
3+
set -e
4+
5+
mkdir -p aws_results
6+
aws s3api select-object-content --bucket girjesh-bucket --key test_data.csv --expression-type 'SQL' --input-serialization '{"CSV": {}, "CompressionType": "NONE"}' --output-serialization '{"CSV": {}}' --profile openshift-dev --expression "select lower(lower(' %%AbCdEfGhIjKlMnOpQrStUvWxYz## ')) from s3object;" "aws_results/output1.csv"
7+
aws s3api select-object-content --bucket girjesh-bucket --key test_data.csv --expression-type 'SQL' --input-serialization '{"CSV": {}, "CompressionType": "NONE"}' --output-serialization '{"CSV": {}}' --profile openshift-dev --expression "select to_timestamp('1999-11-04T20:27:03.479340Z') from s3object;" "aws_results/output2.csv"
8+
aws s3api select-object-content --bucket girjesh-bucket --key test_data.csv --expression-type 'SQL' --input-serialization '{"CSV": {}, "CompressionType": "NONE"}' --output-serialization '{"CSV": {}}' --profile openshift-dev --expression "select date_add(day, 8, to_timestamp('1982-02-03T00:20:12.42831Z')) from s3object;" "aws_results/output3.csv"
9+
aws s3api select-object-content --bucket girjesh-bucket --key test_data.csv --expression-type 'SQL' --input-serialization '{"CSV": {}, "CompressionType": "NONE"}' --output-serialization '{"CSV": {}}' --profile openshift-dev --expression "select substring(upper(' %%AbCdEfGhIjKlMnOpQrStUvWxYz## '), cast((avg(cast(_3 as int)-cast(_2 as int)) - 3) as int), min(cast(_1 as int)-cast(_1 as int)) + 7) from s3object;" "aws_results/output4.csv"
10+
aws s3api select-object-content --bucket girjesh-bucket --key test_data.csv --expression-type 'SQL' --input-serialization '{"CSV": {}, "CompressionType": "NONE"}' --output-serialization '{"CSV": {}}' --profile openshift-dev --expression "select 10-cast(_2 as int) from s3object;" "aws_results/output5.csv"
11+
aws s3api select-object-content --bucket girjesh-bucket --key test_data.csv --expression-type 'SQL' --input-serialization '{"CSV": {}, "CompressionType": "NONE"}' --output-serialization '{"CSV": {}}' --profile openshift-dev --expression "select character_length(to_string(to_timestamp('1963-06-22T05:35:39.954350Z'), 'SSSSS HH ')) from s3object;" "aws_results/output6.csv"
12+
aws s3api select-object-content --bucket girjesh-bucket --key test_data.csv --expression-type 'SQL' --input-serialization '{"CSV": {}, "CompressionType": "NONE"}' --output-serialization '{"CSV": {}}' --profile openshift-dev --expression "select cast(_2 as int)-2 from s3object;" "aws_results/output7.csv"
13+
aws s3api select-object-content --bucket girjesh-bucket --key test_data.csv --expression-type 'SQL' --input-serialization '{"CSV": {}, "CompressionType": "NONE"}' --output-serialization '{"CSV": {}}' --profile openshift-dev --expression "select char_length(lower(' %%AbCdEfGhIjKlMnOpQrStUvWxYz## ')) from s3object;" "aws_results/output8.csv"
14+
aws s3api select-object-content --bucket girjesh-bucket --key test_data.csv --expression-type 'SQL' --input-serialization '{"CSV": {}, "CompressionType": "NONE"}' --output-serialization '{"CSV": {}}' --profile openshift-dev --expression "select to_string(date_add(second, 5, to_timestamp('1938-09-24T10:57:42.142042Z')), 'hh ') from s3object;" "aws_results/output9.csv"
15+
aws s3api select-object-content --bucket girjesh-bucket --key test_data.csv --expression-type 'SQL' --input-serialization '{"CSV": {}, "CompressionType": "NONE"}' --output-serialization '{"CSV": {}}' --profile openshift-dev --expression "select to_timestamp('1931-12-23T02:54:25.451925Z') from s3object;" "aws_results/output10.csv"
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
select lower(lower(' %%AbCdEfGhIjKlMnOpQrStUvWxYz## ')) from s3object;
2+
select to_timestamp('1999-11-04T20:27:03.479340Z') from s3object;
3+
select date_add(day, 8, to_timestamp('1982-02-03T00:20:12.42831Z')) from s3object;
4+
select substring(upper(' %%AbCdEfGhIjKlMnOpQrStUvWxYz## '), cast((avg(cast(_3 as int)-cast(_2 as int)) - 3) as int), min(cast(_1 as int)-cast(_1 as int)) + 7) from s3object;
5+
select 10-cast(_2 as int) from s3object;
6+
select character_length(to_string(to_timestamp('1963-06-22T05:35:39.954350Z'), 'SSSSS HH ')) from s3object;
7+
select cast(_2 as int)-2 from s3object;
8+
select char_length(lower(' %%AbCdEfGhIjKlMnOpQrStUvWxYz## ')) from s3object;
9+
select to_string(date_add(second, 5, to_timestamp('1938-09-24T10:57:42.142042Z')), 'hh ') from s3object;
10+
select to_timestamp('1931-12-23T02:54:25.451925Z') from s3object;
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
%%abcdefghijklmnopqrstuvwxyz##
2+
%%abcdefghijklmnopqrstuvwxyz##
3+
%%abcdefghijklmnopqrstuvwxyz##
4+
%%abcdefghijklmnopqrstuvwxyz##
5+
%%abcdefghijklmnopqrstuvwxyz##
6+
%%abcdefghijklmnopqrstuvwxyz##
7+
%%abcdefghijklmnopqrstuvwxyz##
8+
%%abcdefghijklmnopqrstuvwxyz##
9+
%%abcdefghijklmnopqrstuvwxyz##
10+
%%abcdefghijklmnopqrstuvwxyz##
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
1931-12-23T02:54:25.451925Z
2+
1931-12-23T02:54:25.451925Z
3+
1931-12-23T02:54:25.451925Z
4+
1931-12-23T02:54:25.451925Z
5+
1931-12-23T02:54:25.451925Z
6+
1931-12-23T02:54:25.451925Z
7+
1931-12-23T02:54:25.451925Z
8+
1931-12-23T02:54:25.451925Z
9+
1931-12-23T02:54:25.451925Z
10+
1931-12-23T02:54:25.451925Z
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
1999-11-04T20:27:03.479340Z
2+
1999-11-04T20:27:03.479340Z
3+
1999-11-04T20:27:03.479340Z
4+
1999-11-04T20:27:03.479340Z
5+
1999-11-04T20:27:03.479340Z
6+
1999-11-04T20:27:03.479340Z
7+
1999-11-04T20:27:03.479340Z
8+
1999-11-04T20:27:03.479340Z
9+
1999-11-04T20:27:03.479340Z
10+
1999-11-04T20:27:03.479340Z
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
1982-02-11T00:20:12.42831Z
2+
1982-02-11T00:20:12.42831Z
3+
1982-02-11T00:20:12.42831Z
4+
1982-02-11T00:20:12.42831Z
5+
1982-02-11T00:20:12.42831Z
6+
1982-02-11T00:20:12.42831Z
7+
1982-02-11T00:20:12.42831Z
8+
1982-02-11T00:20:12.42831Z
9+
1982-02-11T00:20:12.42831Z
10+
1982-02-11T00:20:12.42831Z
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
-42916
2+
-21159
3+
-35571
4+
-38378
5+
-42792
6+
-45572
7+
-8538
8+
-22623
9+
-38429
10+
-6601
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
9
2+
9
3+
9
4+
9
5+
9
6+
9
7+
9
8+
9
9+
9
10+
9
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
42924
2+
21167
3+
35579
4+
38386
5+
42800
6+
45580
7+
8546
8+
22631
9+
38437
10+
6609

0 commit comments

Comments
 (0)