Developing the Avatica Go Client

Issues

To file issues, please use the Calcite JIRA and select avatica-go as the component.

Updating protobuf definitions

  1. Install docker and docker compose.
  2. From the root of the repository, run docker compose run compile-protobuf

Live reload during development

It is possible to reload the code in real-time during development. This executes the test suite every time a .go or .mod file is updated. The test suite takes a while to run, so the tests will not complete instantly, but live-reloading during development allows us to not have to manually execute the test suite on save.

Set up

  1. Install docker and docker compose.

  2. From the root of the repository, run docker compose run dev.

  3. After terminating the container, stop all the containers and remove them using: docker compose down

Testing

The test suite takes around 4 minutes to run if you run both the Avatica HSQLDB and Apache Phoenix tests.

Easy way

  1. Install docker and docker compose.

  2. From the root of the repository, run docker compose run test.

  3. After the tests complete, stop all the containers and remove them using: docker compose down

Manual set up

  1. Install Go.

  2. The test suite requires access to an instance of Avatica running HSQLDB and an instance of Apache Phoenix running the Phoenix Query Server.

You should then set the HSQLDB_HOST and PHOENIX_HOST environment variables. For example:

HSQLDB_HOST: http://hsqldb:8765
PHOENIX_HOST: http://phoenix:8765
  1. To select the test suite, export AVATICA_FLAVOR=HSQLDB for Avatica HSQLDB or AVATICA_FLAVOR=PHOENIX for Phoenix.

  2. Then run go test -v ./... from the root of the repository to execute the test suite.