hive

package
v2.2.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2022 License: MIT Imports: 13 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// TimestampFormat is JDBC compliant timestamp format
	TimestampFormat = "2006-01-02 15:04:05.999999999"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client represents Hive Client

func NewClient

func NewClient(client thrift.TClient, log *log.Logger, opts *Options) *Client

NewClient creates Hive Client

func (*Client) OpenSession

func (c *Client) OpenSession(ctx context.Context) (*Session, error)

OpenSession creates new hive session

type ColDesc

type ColDesc struct {
	Name string

	DatabaseTypeName string
	ScanType         reflect.Type

	ColumnTypeNullable  bool
	ColumnTypeLength    int64
	ColumnTypePrecision int64
	ColumnTypeScale     int64
}

type Operation

type Operation struct {
	// contains filtered or unexported fields
}

Operation represents hive operation

func (*Operation) Close

func (op *Operation) Close(ctx context.Context) error

Close closes operation

func (*Operation) FetchResults

func (op *Operation) FetchResults(ctx context.Context, schema *TableSchema) (*ResultSet, error)

FetchResults fetches query result from server

func (*Operation) GetResultSetMetadata

func (op *Operation) GetResultSetMetadata(ctx context.Context) (*TableSchema, error)

GetResultSetMetadata return schema

func (*Operation) HasResultSet

func (op *Operation) HasResultSet() bool

HasResultSet return if operation has result set

func (*Operation) RowsAffected

func (op *Operation) RowsAffected() float64

RowsAffected return number of rows affected by operation

type Options

type Options struct {
	MaxRows      int64
	MemLimit     string
	QueryTimeout int
	Database     string
}

Options for Hive Client

type RPCResponse

type RPCResponse interface {
	GetStatus() *cli_service.TStatus
}

RPCResponse respresents thrift rpc response

type ResultSet

type ResultSet struct {
	// contains filtered or unexported fields
}

ResultSet ...

func (*ResultSet) Next

func (rs *ResultSet) Next(dest []driver.Value) error

Next ...

type Session

type Session struct {
	// contains filtered or unexported fields
}

Session represents hive session

func (*Session) Close

func (s *Session) Close(ctx context.Context) error

Close session

func (*Session) ExecuteStatement

func (s *Session) ExecuteStatement(ctx context.Context, stmt string) (*Operation, error)

ExecuteStatement returns hive operation

func (*Session) Ping

func (s *Session) Ping(ctx context.Context) error

Ping checks the connection

type TableSchema

type TableSchema struct {
	Columns []*ColDesc
}

Jump to

Keyboard shortcuts

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