driver

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 21, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package driver provides a driver compatible with the golang database/sql/driver standard package.

Basic example

import (
	"strings"
	"database/sql"

	_ "github.com/factset/go-drill/driver"
)

func main() {
	props := []string{
		"zk=zookeeper1,zookeeper2,zookeeper3",
		"auth=kerberos",
		"service=<krb_service_name>",
		"cluster=<clustername>",
	}
	db, err := sql.Open("drill", strings.Join(props, ";"))
	...
}

Connection String

zk=node1,node2,node3/non/default/path
		Specify the zookeeper nodes to utilize for discovering endpoints. Will
		default to using port 2181 if not specified with the address for each
		zookeeper node. Will default to using /drill/drillbits unless a non default
		zookeeper path is specified as shown.

auth=<auth type>
		If using sasl authentication, this is used to specify the authentication
		mechanism. Currently only supports "kerberos" which will use GSSAPI
		authentication. If using user/password authentication, this is ignored.

schema=<default schema>
		Default schema/context to run queries in.

service=<servicename>
		If using kerberos authentication, this should be the kerberos service name
		for the ticket utilized by the server for authentication.

encrypt=<true|false>
		Set to true if using Sasl Encryption for communication.

user=<username>
		Username to authenticate as either for the kerberos TKT to use for auth,
		or the username to authenticate with the provided password.

pass=<password>
		If using user/pass authentication instead of kerberos, this is how you provide
		the password to use.

cluster=<clustername>
		If using a non-default cluster name for drill, specify this so that the
		zookeeper cluster can be found properly for the drillbit endpoints.

host=<hostname>
		Hostname to connect to for direct connection.

port=<portnumber>
		Port number to use if not using the default 31010 port for direct connection.

heartbeat=<frequency in seconds>
		By default the driver will use a 15 second heartbeat frequency to keep the
		the connection going. If a different frequency is desired it can be specified
		with this parameter. A frequency of 0 results in no heartbeat used.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL