Skip to content

Latest commit

 

History

36 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Calcite CLI

Calcite CLI is a command-line interface for executing SQL queries using Calcite or Phoenix servers via Avatica. It provides a prompt where you can enter queries and view the results.

Go Reference Build Status

Build

go build -v -ldflags="-s -w" -o calcite-cli

Installation

To install Calcite CLI, you can use the following command:

go install github.com/satyakommula96/calcite-cli@latest

Usage

After installing Calcite CLI, you can run it using the following command:

calcite-cli [flags]

Flags:


  -h, --help                   Help for calcite
  -m, --maxRowsTotal string    The maximum number of rows to return for a given query
      --params string          Extra parameters for avatica connection (ex: "parameter1=value&...parameterN=value")
  -p, --password string        The password to use when authenticating against Avatica
  -s, --schema string          The schema path sets the default schema to use for this connection.
      --serialization string   Serialization parameter (defaults to protobuf)
      --url string             Connection URL (default "http://localhost:8080")
  -u, --username string        The user to use when authenticating against Avatica

Once the Calcite CLI prompt starts, you can enter your SQL queries. To exit the prompt, type exit or quit.

Testing Locally with Apache Phoenix

To run a test database locally using Docker, you can launch an Apache Phoenix Query Server (which runs Avatica under the hood):

docker run -d \
  -p 2181:2181 \
  -p 8765:8765 \
  -p 16000:16000 \
  -p 16010:16010 \
  -p 16020:16020 \
  --name phoenix-server \
  boostport/hbase-phoenix-all-in-one:latest

After the container starts and initializes (takes ~15-30 seconds), connect your client:

./calcite-cli --url "http://localhost:8765"

Dependencies

This project uses the following third-party dependencies:

That's the basic usage of the Calcite CLI. You can customize the connection URL and other parameters using command flags.

Happy querying!

License

This project is licensed under the Apache License. See the LICENSE file for more information.

About

Calcite CLI : Interactive Sql execution tool for Apache Calcite server

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages