Documentation ¶
Index ¶
- Constants
- func Exec(ctx context.Context, connection *Connection, query string) error
- func Query(ctx context.Context, connection *Connection, query string) (*hiveserver.TFetchResultsResp, int, error)
- type ConnectConfiguration
- type Connection
- type TSaslTransport
- func (p *TSaslTransport) Close() (err error)
- func (p *TSaslTransport) Flush(ctx context.Context) (err error)
- func (p *TSaslTransport) IsOpen() bool
- func (p *TSaslTransport) Open() (err error)
- func (p *TSaslTransport) Read(buf []byte) (l int, err error)
- func (p *TSaslTransport) RemainingBytes() uint64
- func (p *TSaslTransport) SetMaxLength(maxLength uint32)
- func (p *TSaslTransport) Write(buf []byte) (int, error)
Constants ¶
const ( START = 1 OK = 2 BAD = 3 ERROR = 4 COMPLETE = 5 )
const DEFAULT_FETCH_SIZE int64 = 1000
const DEFAULT_MAX_LENGTH = 16384000
const ZOOKEEPER_DEFAULT_NAMESPACE = "hiveserver2"
Variables ¶
This section is empty.
Functions ¶
func Exec ¶ added in v1.3.1
func Exec(ctx context.Context, connection *Connection, query string) error
func Query ¶ added in v1.3.3
func Query(ctx context.Context, connection *Connection, query string) (*hiveserver.TFetchResultsResp, int, error)
Types ¶
type ConnectConfiguration ¶
type ConnectConfiguration struct { Username string Principal string Password string Service string HiveConfiguration map[string]string PollIntervalInMillis int FetchSize int64 TransportMode string HTTPPath string TLSConfig *tls.Config ZookeeperNamespace string Database string Timeout time.Duration }
ConnectConfiguration is the configuration for the connection The fields have to be filled manually but not all of them are required Depends on the auth and kind of connection.
func NewConnectConfiguration ¶
func NewConnectConfiguration() *ConnectConfiguration
NewConnectConfiguration returns a connect configuration, all with empty fields
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
Connection holds the information for getting a cursor to hive
func Connect ¶
func Connect(ctx context.Context, host string, port int, auth string, configuration *ConnectConfiguration) (conn *Connection, err error)
Connect to hive server
func ConnectZookeeper ¶
func ConnectZookeeper(ctx context.Context, hosts string, auth string, configuration *ConnectConfiguration) (conn *Connection, err error)
Connect to zookeper to get hive hosts and then connect to hive. hosts is in format host1:port1,host2:port2,host3:port3 (zookeeper hosts).
type TSaslTransport ¶
type TSaslTransport struct { OpeningContext context.Context // contains filtered or unexported fields }
TSaslTransport is a tranport thrift struct that uses SASL
func NewTSaslTransport ¶
func NewTSaslTransport(trans thrift.TTransport, host string, mechanismName string, configuration map[string]string) (*TSaslTransport, error)
NewTSaslTransport return a TSaslTransport
func (*TSaslTransport) Close ¶
func (p *TSaslTransport) Close() (err error)
Close close a SASL transport connection
func (*TSaslTransport) Flush ¶
func (p *TSaslTransport) Flush(ctx context.Context) (err error)
Flush the bytes in the buffer
func (*TSaslTransport) IsOpen ¶
func (p *TSaslTransport) IsOpen() bool
IsOpen opens a SASL connection
func (*TSaslTransport) Open ¶
func (p *TSaslTransport) Open() (err error)
Open check if a SASL transport connection is opened
func (*TSaslTransport) RemainingBytes ¶
func (p *TSaslTransport) RemainingBytes() uint64
RemainingBytes return the size of the unwrapped bytes
func (*TSaslTransport) SetMaxLength ¶
func (p *TSaslTransport) SetMaxLength(maxLength uint32)
SetMaxLength set the maxLength