Skip to content

Commit 09569ef

Browse files
authored
update e2e workflow to use sql plugin's ppl integ tests. (#20079)
These tests run 42 or 43 queries right now and match results for correctness. all queries flagged as supported are expected to succeed for this check to pass Signed-off-by: Marc Handalian <[email protected]>
1 parent cf5fad4 commit 09569ef

File tree

1 file changed

+3
-120
lines changed

1 file changed

+3
-120
lines changed

.github/workflows/datafusion-e2e-test.yml

Lines changed: 3 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -83,123 +83,6 @@ jobs:
8383
# Wait for OpenSearch to start
8484
timeout 300 bash -c 'until curl -s http://localhost:9200; do sleep 5; done'
8585
86-
- name: Run E2E Tests
87-
run: |
88-
# Create index
89-
HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" -X PUT 'http://localhost:9200/index-7' \
90-
-H 'Content-Type: application/json' \
91-
-d '{
92-
"settings": {
93-
"number_of_shards": 1,
94-
"number_of_replicas": 0,
95-
"refresh_interval": -1
96-
},
97-
"mappings": {
98-
"properties": {
99-
"id": {"type": "keyword"},
100-
"name": {"type": "keyword"},
101-
"age": {"type": "integer"},
102-
"salary": {"type": "long"},
103-
"score": {"type": "double"},
104-
"active": {"type": "boolean"},
105-
"created_date": {"type": "date"}
106-
}
107-
}
108-
}')
109-
if [ "$HTTP_CODE" != "200" ]; then
110-
echo "Failed to create index. HTTP status: $HTTP_CODE"
111-
exit 1
112-
fi
113-
114-
# Index documents
115-
HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" -X POST 'http://localhost:9200/_bulk' \
116-
-H 'Content-Type: application/json' \
117-
-d '{"index":{"_index":"index-7"}}
118-
{"id":"1","name":"Alice","age":30,"salary":75000,"score":95.5,"active":true,"created_date":"2024-01-15"}
119-
{"index":{"_index":"index-7"}}
120-
{"id":"2","name":"Bob","age":25,"salary":60000,"score":88.3,"active":true,"created_date":"2024-02-20"}
121-
{"index":{"_index":"index-7"}}
122-
{"id":"3","name":"Charlie","age":35,"salary":90000,"score":92.7,"active":false,"created_date":"2024-03-10"}
123-
{"index":{"_index":"index-7"}}
124-
{"id":"4","name":"Diana","age":28,"salary":70000,"score":89.1,"active":true,"created_date":"2024-04-05"}
125-
{"index":{"_index":"index-7"}}
126-
{"id":"5","name":"Bob","age":30,"salary":55000,"score":81.1,"active":true,"created_date":"2024-04-05"}
127-
{"index":{"_index":"index-7"}}
128-
{"id":"6","name":"Diana","age":35,"salary":65000,"score":71.1,"active":true,"created_date":"2024-02-05"}
129-
')
130-
if [ "$HTTP_CODE" != "200" ]; then
131-
echo "Failed to index documents. HTTP status: $HTTP_CODE"
132-
exit 1
133-
fi
134-
135-
# Refresh index
136-
HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" -X POST 'localhost:9200/index-7/_refresh')
137-
if [ "$HTTP_CODE" != "200" ]; then
138-
echo "Failed to refresh index. HTTP status: $HTTP_CODE"
139-
exit 1
140-
fi
141-
142-
# Query 1: stats with min, max, avg
143-
HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" -X POST 'http://localhost:9200/_plugins/_ppl' \
144-
-H 'Content-Type: application/json' \
145-
-d '{"query": "source=index-7 | stats count(), min(age) as min, max(age) as max, avg(age) as avg"}')
146-
if [ "$HTTP_CODE" != "200" ]; then
147-
echo "Query 1 failed. HTTP status: $HTTP_CODE"
148-
exit 1
149-
fi
150-
151-
# Query 2: count by name with sort
152-
HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" -X POST 'http://localhost:9200/_plugins/_ppl' \
153-
-H 'Content-Type: application/json' \
154-
-d '{"query": "source=index-7 | stats count() as c by name | sort c"}')
155-
if [ "$HTTP_CODE" != "200" ]; then
156-
echo "Query 2 failed. HTTP status: $HTTP_CODE"
157-
exit 1
158-
fi
159-
160-
# Query 3: count and sum by name with sort
161-
HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" -X POST 'http://localhost:9200/_plugins/_ppl' \
162-
-H 'Content-Type: application/json' \
163-
-d '{"query": "source=index-7 | stats count(), sum(age) as c by name | sort c"}')
164-
if [ "$HTTP_CODE" != "200" ]; then
165-
echo "Query 3 failed. HTTP status: $HTTP_CODE"
166-
exit 1
167-
fi
168-
169-
# Query 4: where clause with stats
170-
HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" -X POST 'http://localhost:9200/_plugins/_ppl' \
171-
-H 'Content-Type: application/json' \
172-
-d '{"query": "source=index-7 | where name = \"Bob\" | stats sum(age)"}')
173-
if [ "$HTTP_CODE" != "200" ]; then
174-
echo "Query 4 failed. HTTP status: $HTTP_CODE"
175-
exit 1
176-
fi
177-
178-
# Query 5: sum by name sorted by sum
179-
HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" -X POST 'http://localhost:9200/_plugins/_ppl' \
180-
-H 'Content-Type: application/json' \
181-
-d '{"query": "source=index-7 | stats sum(age) as s by name | sort s"}')
182-
if [ "$HTTP_CODE" != "200" ]; then
183-
echo "Query 5 failed. HTTP status: $HTTP_CODE"
184-
exit 1
185-
fi
186-
187-
# Query 6: sum by name sorted by name
188-
HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" -X POST 'http://localhost:9200/_plugins/_ppl' \
189-
-H 'Content-Type: application/json' \
190-
-d '{"query": "source=index-7 | stats sum(age) as s by name | sort name"}')
191-
if [ "$HTTP_CODE" != "200" ]; then
192-
echo "Query 6 failed. HTTP status: $HTTP_CODE"
193-
exit 1
194-
fi
195-
196-
# Query 7: count by name
197-
HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" -X POST 'http://localhost:9200/_plugins/_ppl' \
198-
-H 'Content-Type: application/json' \
199-
-d '{"query": "source=index-7 | stats count() as c by name"}')
200-
if [ "$HTTP_CODE" != "200" ]; then
201-
echo "Query 7 failed. HTTP status: $HTTP_CODE"
202-
exit 1
203-
fi
204-
205-
echo "All E2E tests passed successfully!"
86+
- name: Run SQL CalcitePPLClickBenchIT
87+
working-directory: opensearch-sql
88+
run: ./gradlew :integ-test:integTest --tests "org.opensearch.sql.calcite.clickbench.CalcitePPLClickBenchIT" -Dtests.method="testDataFusion" -Dtests.cluster=localhost:9200 -Dtests.rest.cluster=localhost:9200 -DignorePrometheus=true -Dtests.clustername=opensearch -Dtests.output=true

0 commit comments

Comments
 (0)