diff --git a/examples/twitter/query.body b/examples/twitter/group_by_query.body similarity index 100% rename from examples/twitter/query.body rename to examples/twitter/group_by_query.body diff --git a/examples/twitter/run_client.sh b/examples/twitter/run_client.sh index b11834ed087..e1a9548713f 100755 --- a/examples/twitter/run_client.sh +++ b/examples/twitter/run_client.sh @@ -7,14 +7,16 @@ shopt -s xpg_echo shopt -s expand_aliases trap "exit 1" 1 2 3 15 -[ ! -e query.body ] && echo "expecting file query.body to be in current directory" && exit 2 +QUERY_FILE="${1:-group_by}_query.body" + +[ ! -e $QUERY_FILE ] && echo "expecting file $QUERY_FILE to be in current directory" && exit 2 for delay in 5 15 15 15 15 15 15 15 15 15 15 do echo "sleep for $delay seconds..." echo " " sleep $delay - curl -X POST 'http://localhost:8080/druid/v2/' -H 'content-type: application/json' -d @query.body + curl -X POST 'http://localhost:8080/druid/v2/' -H 'content-type: application/json' -d @$QUERY_FILE echo " " echo " " done diff --git a/examples/twitter/search_query.body b/examples/twitter/search_query.body new file mode 100644 index 00000000000..f2feb27d4fe --- /dev/null +++ b/examples/twitter/search_query.body @@ -0,0 +1,13 @@ +{ + "queryType": "search", + "dataSource": "twitterstream", + "granularity": "all", + "searchDimensions": ["htags"], + "limit": 1, + "query": { + "type": "fragment", + "values": ["men"], + "sort": { "type": "strlen" } + }, + "intervals":["2012-10-01T00:00/2020-01-01T00"] +}