Roquettor
Roquettor is a non-official Indexima command-line tool that allows you to send queries in batch.
Download
You can be downloaded here.
Basic usage
Set the JDBC URL:
-url "jdbc:hive2://<url_jdbc_to_indexima>/"
To execute a pool:
-script "myScript.sql"
To execute many pools:
-script "myQueries_1.sql,myQueries_2.sql"
Example
We are going to create a table, insert data, and execute a few select statements.
Let's create these scripts.
# create_table.sql
CREATE TABLE myTable ( country STRING, population INT, INDEX(country));
# insert_into.sql
INSERT INTO TABLE myTable VALUES ('France', 66000000);
INSERT INTO TABLE myTable VALUES ('Italy', 60000000);
INSERT INTO TABLE myTable VALUES ('England', 55000000);
INSERT INTO TABLE myTable VALUES ('United-States', 327000000);
INSERT INTO TABLE myTable VALUES ('Spain', 48000000);
# select_from.sql
SELECT country, population FROM myTable;
SELECT COUNT(country) FROM myTable;
SELECT AVG(population) FROM myTable;
Here, we'll execute the three queries scripts sequentially.
Queries inside each script will be executed in concurrence.
java -jar roquettor-1-1.jar
-url "jdbc:hive2://localhost:10000/default"
-user "admin"
-password "myPassword"
-script "create_table.sql,insert_into.sql,select_from.sql"
-threads 3
Options
Name | Description |
---|---|
URL | Define JDBC URL to Indexima. |
script | Set the queries script files to execute. |
threads | Define max concurrent connections. |
driver-class | Define the Driver Class to register. |
output | Define path to results directory. |
user | Define the user who execute queries. Default: empty. |
password | Define the user's password. |
timeout | timeout in seconds: if the query lasts more than x sec, roquettor will cancel the query |
results | boolean to retrieve results or not |