Files
impala/bin/runquery
2011-11-06 17:03:33 -08:00

27 lines
682 B
Bash
Executable File

#!/usr/bin/env bash
# Copyright (c) 2011 Cloudera, Inc. All rights reserved.
bin=`dirname "$0"`
bin=`cd "$bin"; pwd`
. "$bin"/impala-config.sh
cd $IMPALA_FE_DIR
# Convert arguments so mvn passes it to java correctly (i.e. mvn doesn't
# try to parse the arguments as arguments to mvn)
# For example,
# runquery "select count(*) from table" -batchsize=10
# args becomes:
# 'select count(*) from table' '-batchsize=10'
# Java main will see 2 arguments.
args=""
while [ "$1" != "" ] ;
do
args="$args '$1'"
shift
done
mvn exec:java -Dexec.mainClass=com.cloudera.impala.service.Executor \
-Dexec.classpathScope=test \
-Dexec.args="$args"