layout: page title: Developing the Avatica Go Client permalink: /develop/avatica-go.html

  • TOC {:toc}

Issues

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

Updating protobuf definitions

To update the procotol buffer definitions, update AVATICA_VER in gen-protobuf.bat and gen-protobuf.sh to match the version you want to generate protobufs for and then run the appropriate script for your platform.

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 up --build.

Manual set up

  1. Install Go.

For Go 1.10 and below, install the dependencies (skip these steps if using Go 1.11 and above): 1a. Install dep: go get -u github.com/golang/dep/cmd/dep

1b. Install dependencies by running dep ensure -v from the root of the repository.

  1. 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: {% highlight shell %} HSQLDB_HOST: http://hsqldb:8765 PHOENIX_HOST: http://phoenix:8765 {% endhighlight %}

  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.

Releasing

If you have not set up a GPG signing key, set one up by following these instructions.

If this release is a new major version (we are releasing 4.0.0 vs the current version 3.0.0), update the version in the import path in go.mod. The import paths in the various sample code snippets should also be updated.

Since we need to support Go modules, tags must be prefixed with a v. For example, tag as v3.1.0 rather than 3.1.0.

From the root of the repository, run ./make-release-artifacts.sh.

You will be asked to select the tag to build release artifacts for. The latest tag is automatically selected if no tag is selected.

The release artifacts will be placed in a folder named for the release within the dist/ folder.

Important things to note before uploading a release

The name of the release folder must be in the following format: apache-calcite-avatica-go-$version. The version must include release candidate identifiers such as -rc0, if they are present.

The files inside the release folder must have any release candidate identifiers such as -rc1 removed, even if the release is a release candidate. src must also be added to the filename.

For example, if we are uploading the apache-calcite-avatica-go-3.0.0-rc1 folder, the files must be named apache-calcite-acatica-go-3.0.0.-srctar.gz. Note the inclusion of src in the filename.

The tar.gz must be named apache-calcite-avatica-go-$version-src.tar.gz.

There must be a GPG signature for the tar.gz named: apache-calcite-avatica-go-$version-src.tar.gz.asc

There must be a SHA256 hash for the tar.gz named: apache-calcite-avatica-go-$version-src.tar.gz.sha256

Uploading release artifacts to dev for voting

svn must be installed in order to upload release artifacts.

  1. Check out the Calcite dev release subdirectory: svn co "https://dist.apache.org/repos/dist/dev/calcite/" calcite-dev.

  2. Move the release folder under dist/ into the calcite-dev folder.

  3. Add the new release to the svn repository: svn add apache-calcite-avatica-go-3.0.0-rc0. Remember to change the folder name to the correct release in the command.

  4. Commit to upload the artifacts: svn commit -m "apache-calcite-avatica-go-3.0.0-rc0" --username yourapacheusername --force-log Note the use of --force-log to suppress the svn warning, because the commit message is the same as the name of the directory.

Promoting a release after voting

svn must be installed in order to upload release artifacts.

NOTE: Only official releases that has passed a vote may be uploaded to the release directory.

  1. Check out the Calcite release directory: svn co "https://dist.apache.org/repos/dist/release/calcite/" calcite-release.

  2. Copy the release into the calcite-release folder. Remember to check the name of the release's folder to ensure that it is in the correct format.

  3. Add the release to the svn repository: svn add apache-calcite-avatica-go-3.0.0. Remember to change the folder name to the correct release in the command.

  4. Commit to upload the artifacts: svn commit -m "Release apache-calcite-avatica-go-3.0.0" --username yourapacheusername.