This process is the same if you launched the Dremio locally or via docker.
- Install Python 3
- Download and install the dremio-flight-endpoint whl file
python -m pip install <PATH TO WHEEL>
- Create a local folder to store the client file and config file.
- Create a file named
example.py
in created folder. Copy the contents ofarrow-flight-client-examples/python/example.py
intoexample.py
. - Create a file named
config.yaml
in created folder. Copy the contents ofarrow-flight-client-examples/python/config_template.yaml
intoconfig.yaml
. - Uncomment the options in
config.yaml
as needed, appending the argument after the key. ie.username: my_username
. You can either delete the options that are not being used or leave them commented.- e.g. If you are connecting to a local instance of Dremio, your config file would look like:
username: my_username password: my_password query: SELECT 1
- Create a file named
- Run the Python Arrow Flight Client by navigating to the created folder in the previous step and running the command
python3 example.py
.
This lightweight Java client application connects to the Dremio Arrow Flight server endpoint. It requires the username and password for authentication. Developers can use admin or regular user credentials for authentication. Any datasets in Dremio that are accessible by the provided Dremio user can be queried. By default, the hostname is localhost
and the port is 32010
. Developers can change these default settings by providing the hostname and port as arguments when running the client. Moreover, the tls option can be provided to establish an encrypted connection.
- Java 8
- Maven 3.5 or above
- Clone this repository.
- Navigate to arrow-flight-client-examples/java.
- Build the sample application on the command line with:
mvn clean install -DskipTests
- By default, the hostname is
localhost
and the port is32010
. - Run the Java sample application:
java -jar target/java-flight-sample-client-application-1.0-SNAPSHOT-shaded.jar -query <QUERY> -host <DREMIO_HOSTNAME> -user <DREMIO_USER> -pass <DREMIO_PASSWORD>
- The application has a demo mode that runs an end-to-end demonstration without any arguments required, use the
-demo
flag to run the demo:java -jar target/java-flight-sample-client-application-1.0-SNAPSHOT-shaded.jar -demo
- To run the demo, you must have a running Dremio instance at the specified host and port.
- The Dremio instance must also have
services.flight.auth.mode: "arrow.flight.auth2"
set in the dremio.conf file.
- Learn more about different command line options with the help menu:
java -jar target/java-flight-sample-client-application-1.0-SNAPSHOT-shaded.jar -h
usage: java -jar target/java-flight-sample-client-application-1.0-SNAPSHOT-shaded.jar -query <QUERY> -host <DREMIO_HOSTNAME> -port <DREMIO_PORT> -user <DREMIO_USER> -pass <DREMIO_PASSWORD>
optional arguments:
-h, --help
show this help message and exit
-port, --flightport
Dremio flight server port
Default: 32010
-host, --hostname
Dremio co-ordinator hostname
Default: localhost
-kstpass, --keyStorePassword
The jks keystore password
-kstpath, --keyStorePath
Path to the jks keystore
-pass, --password
Dremio password
Default: dremio123
-demo, --runDemo
A flag to to run a demo of querying the Dremio Flight Server Endpoint.
Default: false
-query, --sqlQuery
SQL query to test
-tls, --tls
Enable encrypted connection
Default: false
-user, --username
Dremio username
Default: dremio
-projectId, --projectId
Dremio Cloud project to connect to.
Default: default project for organization
If you have any questions, click here to join our forums.