Documentation
¶
Index ¶
- Constants
- type Client
- type ColDesc
- type ColumnName
- type DBMetadata
- func (m DBMetadata) GetColumnsSeq(ctx context.Context, schemaPattern string, tableNamePattern string, ...) (iter.Seq[ColumnName], *error)
- func (m DBMetadata) GetSchemasSeq(ctx context.Context, pattern string) (iter.Seq[string], *error)
- func (m DBMetadata) GetTablesSeq(ctx context.Context, schemaPattern string, tableNamePattern string) (iter.Seq[TableName], *error)
- type Operation
- func (op *Operation) CheckStateAndStatus(ctx context.Context) (cli_service.TOperationState, error)
- func (op *Operation) Close(ctx context.Context) (int64, error)
- func (op *Operation) FetchResults(ctx context.Context, schema *TableSchema) (*ResultSet, error)
- func (op *Operation) GetResultSetMetadata(ctx context.Context) (*TableSchema, error)
- func (op *Operation) HasResultSet() bool
- func (op *Operation) RowsAffected() float64
- func (op *Operation) WaitToFinish(ctx context.Context) error
- type Options
- type ResultSet
- type Session
- type TableName
- type TableSchema
Constants ¶
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
type ColDesc ¶
type ColDesc struct {
Name string
DatabaseTypeName string
ScanType reflect.Type
// Impala columns are always Nullable, except some Kudu columns
NotNull bool
Length int64
HasLength bool
Precision int64
Scale int64
HasPrecisionScale bool
}
ColDesc mirrors sql.ColumnType struct which we can't just reuse because its fields are private
type ColumnName ¶ added in v1.1.0
type DBMetadata ¶
type DBMetadata struct {
// contains filtered or unexported fields
}
DBMetadata exposes the database schema. It does not own the underlying client and session so they must be open while the objects and the data iterators are used.
func (DBMetadata) GetColumnsSeq ¶ added in v1.1.0
func (m DBMetadata) GetColumnsSeq(ctx context.Context, schemaPattern string, tableNamePattern string, columnNamePattern string) (iter.Seq[ColumnName], *error)
func (DBMetadata) GetSchemasSeq ¶
func (DBMetadata) GetTablesSeq ¶
func (m DBMetadata) GetTablesSeq(ctx context.Context, schemaPattern string, tableNamePattern string) (iter.Seq[TableName], *error)
GetTablesSeq returns tables and views that match the criteria as an iterator. Patterns use LIKE syntax Unlike SHOW TABLES IN, GetTablesSeq can work across schemas and can report if the results are tables or views.
type Operation ¶
type Operation struct {
// contains filtered or unexported fields
}
Operation represents hive operation
func (*Operation) CheckStateAndStatus ¶ added in v1.0.0
func (op *Operation) CheckStateAndStatus(ctx context.Context) (cli_service.TOperationState, error)
CheckStateAndStatus returns the operation state if both the state and status are ok
func (*Operation) FetchResults ¶
FetchResults lazily prepares query result from server
func (*Operation) GetResultSetMetadata ¶
func (op *Operation) GetResultSetMetadata(ctx context.Context) (*TableSchema, error)
GetResultSetMetadata return schema
func (*Operation) HasResultSet ¶
HasResultSet return if operation has result set
func (*Operation) RowsAffected ¶
RowsAffected return number of rows affected by operation
type Options ¶
type Options struct {
MaxRows int64
// MemLimit configures the MEM_LIMIT Impala property at session level
// https://impala.apache.org/docs/build/html/topics/impala_mem_limit.html
MemLimit string
// QueryTimeout in seconds - for QUERY_TIMEOUT_S session configuration value
// https://impala.apache.org/docs/build/html/topics/impala_query_timeout_s.html
QueryTimeout int
}
Options for Hive Client
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session represents hive session
func (*Session) DBMetadata ¶
func (s *Session) DBMetadata() DBMetadata
func (*Session) ExecuteStatement ¶
ExecuteStatement returns hive operation
type TableSchema ¶
type TableSchema struct {
Columns []*ColDesc
}