Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Utilize the DruidIngestion controller in e2e tests
- Loading branch information
Sam Wheating
committed
Mar 2, 2024
1 parent
8b1f785
commit 3f355a0
Showing
9 changed files
with
173 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
apiVersion: druid.apache.org/v1alpha1 | ||
kind: DruidIngestion | ||
metadata: | ||
labels: | ||
app.kubernetes.io/name: druidingestion | ||
app.kubernetes.io/instance: druidingestion-sample | ||
name: wikipedia-ingestion | ||
spec: | ||
suspend: false | ||
druidCluster: tiny-cluster | ||
ingestion: | ||
type: native-batch | ||
spec: |- | ||
{ | ||
"type" : "index_parallel", | ||
"spec" : { | ||
"dataSchema" : { | ||
"dataSource" : "wikipedia-2", | ||
"timestampSpec": { | ||
"column": "time", | ||
"format": "iso" | ||
}, | ||
"dimensionsSpec" : { | ||
"dimensions" : [ | ||
"channel", | ||
"cityName", | ||
"comment", | ||
"countryIsoCode", | ||
"countryName", | ||
"isAnonymous", | ||
"isMinor", | ||
"isNew", | ||
"isRobot", | ||
"isUnpatrolled", | ||
"metroCode", | ||
"namespace", | ||
"page", | ||
"regionIsoCode", | ||
"regionName", | ||
"user", | ||
{ "name": "added", "type": "long" }, | ||
{ "name": "deleted", "type": "long" }, | ||
{ "name": "delta", "type": "long" } | ||
] | ||
}, | ||
"metricsSpec" : [], | ||
"granularitySpec" : { | ||
"type" : "uniform", | ||
"segmentGranularity" : "day", | ||
"queryGranularity" : "none", | ||
"intervals" : ["2015-09-12/2015-09-13"], | ||
"rollup" : false | ||
} | ||
}, | ||
"ioConfig" : { | ||
"type" : "index_parallel", | ||
"inputSource" : { | ||
"type" : "local", | ||
"baseDir" : "quickstart/tutorial/", | ||
"filter" : "wikiticker-2015-09-12-sampled.json.gz" | ||
}, | ||
"inputFormat" : { | ||
"type" : "json" | ||
}, | ||
"appendToExisting" : false | ||
}, | ||
"tuningConfig" : { | ||
"type" : "index_parallel", | ||
"maxRowsPerSegment" : 5000000, | ||
"maxRowsInMemory" : 25000 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
TASK_ID=$1 | ||
|
||
echo "Checking Status for task $TASK_ID..." | ||
STATUS=$(curl -s http://druid-tiny-cluster-coordinators.druid.svc:8088/druid/indexer/v1/task/${TASK_ID}/status | jq '.status.status' -r); | ||
while [ $STATUS == "RUNNING" ] | ||
do | ||
sleep 8; | ||
echo "TASK is "$STATUS "..." | ||
STATUS=$(curl -s http://druid-tiny-cluster-coordinators.druid.svc:8088/druid/indexer/v1/task/${TASK_ID}/status | jq '.status.status' -r) | ||
done | ||
|
||
if [ $STATUS == "SUCCESS" ] | ||
then | ||
echo "TASK $TASK_ID COMPLETED SUCCESSFULLY" | ||
sleep 60 # need time for the segments to become queryable | ||
else | ||
echo "TASK $TASK_ID FAILED !!!!" | ||
exit 1 | ||
fi | ||
|
||
echo "Querying Data ... " | ||
echo "Running query SELECT COUNT(*) AS \"Count\" FROM \"wikipedia-2\" WHERE isMinor = 'false'" | ||
|
||
cat > query.json <<EOF | ||
{"query":"SELECT COUNT(*) AS \"Count\" FROM \"wikipedia-2\" WHERE isMinor = 'false'","resultFormat":"objectlines"} | ||
EOF | ||
|
||
count=`curl -s -XPOST -H'Content-Type: application/json' http://druid-tiny-cluster-routers.druid.svc:8088/druid/v2/sql -d @query.json| jq '.Count'` | ||
echo "count is $count" | ||
if [ $count != "21936" ] | ||
then | ||
echo "Query failed !!!" | ||
exit 1 | ||
else | ||
echo "Query Successful !!!" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters