Documentation ¶
Index ¶
- Constants
- type ConnectConfiguration
- type Connection
- type Cursor
- func (c *Cursor) Cancel()
- func (c *Cursor) Close()
- func (c *Cursor) Description() [][]string
- func (c *Cursor) Error() error
- func (c *Cursor) Execute(ctx context.Context, query string, async bool)
- func (c *Cursor) FetchOne(ctx context.Context, dests ...interface{})
- func (c *Cursor) Finished() bool
- func (c *Cursor) HasMore(ctx context.Context) bool
- func (c *Cursor) Poll(getProgres bool) (status *hiveserver.TGetOperationStatusResp)
- func (c *Cursor) RowMap(ctx context.Context) map[string]interface{}
- func (c *Cursor) WaitForCompletion(ctx context.Context)
- 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) 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
Variables ¶
This section is empty.
Functions ¶
This section is empty.
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 }
ConnectConfiguration is the configuration for the connection The fields have to be filled manually but not all of them are required Depends on the 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(host string, port int, configuration *ConnectConfiguration) (conn *Connection, err error)
Connect to hive server
func (*Connection) Cursor ¶
func (c *Connection) Cursor() *Cursor
Cursor creates a cursor from a connection
type Cursor ¶
type Cursor struct { Err error // contains filtered or unexported fields }
Cursor is used for fetching the rows after a query
func (*Cursor) Description ¶
Description return a map with the names of the columns and their types must be called after a FetchResult request a context should be added here but seems to be ignored by thrift
func (*Cursor) Execute ¶
Execute sends a query to hive for execution with a context If the context is Done it may not be possible to cancel the opeartion Use async = true
func (*Cursor) Poll ¶
func (c *Cursor) Poll(getProgres bool) (status *hiveserver.TGetOperationStatusResp)
Poll returns the current status of the last operation
func (*Cursor) WaitForCompletion ¶
WaitForCompletion waits for an async operation to finish
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