Documentation
¶
Index ¶
- Constants
- Variables
- func OpenDB(cfg Config) *sql.DB
- type Config
- type DSN
- type Driver
- type HiveConnector
- type HiveMetastoreClient
- type MetastoreConnectConfiguration
- 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 )
Variables ¶
var DEFAULT_ERROR_CODE = int32(-1)
var DEFAULT_ERROR_MESSAGE = "unknown error"
var DEFAULT_SQL_STATE = ""
var DEFAULT_STATUS = hiveserver.TStatus{ StatusCode: hiveserver.TStatusCode_ERROR_STATUS, InfoMessages: nil, SqlState: &DEFAULT_SQL_STATE, ErrorCode: &DEFAULT_ERROR_CODE, ErrorMessage: &DEFAULT_ERROR_MESSAGE, }
Functions ¶
Types ¶
type Config ¶
type Config struct {
Host string
Port int
Auth string // "NONE", "KERBEROS", "NOSASL", etc.
Username string
Password string
Database string
TransportMode string // "binary" or "http"
HTTPPath string
Service string // Kerberos service name
TLSConfig *tls.Config
SSLCertFile string
SSLKeyFile string
SSLCAFile string
SSLInsecureSkip bool
HiveConfiguration map[string]string
}
Config holds everything needed to connect to Hive/Impala via gohive v2.
type DSN ¶
type DSN struct {
Username string
Password string
Host string
Port int
Database string
Auth string
TransportMode string
Service string
SSLCertFile string
SSLKeyFile string
SSLInsecureSkip bool
HiveConfiguration map[string]string
}
DSN represents a parsed Data Source Name
type Driver ¶
type Driver struct{}
Driver is the interface that must be implemented by a database driver.
type HiveConnector ¶
type HiveConnector struct {
// contains filtered or unexported fields
}
HiveConnector implements driver.Connector using gohive v2 under the hood.
func NewConnector ¶
func NewConnector(cfg Config) *HiveConnector
NewConnector creates a new HiveConnector with the given config.
func (*HiveConnector) Driver ¶
func (c *HiveConnector) Driver() driver.Driver
Driver returns a placeholder driver (unused by sql.OpenDB).
type HiveMetastoreClient ¶
type HiveMetastoreClient struct {
Client *hive_metastore.ThriftHiveMetastoreClient
// contains filtered or unexported fields
}
func ConnectToMetastore ¶
func ConnectToMetastore(host string, port int, auth string, configuration *MetastoreConnectConfiguration) (client *HiveMetastoreClient, err error)
Open connection to the metastore.
func (*HiveMetastoreClient) Close ¶
func (c *HiveMetastoreClient) Close()
type MetastoreConnectConfiguration ¶
func NewMetastoreConnectConfiguration ¶
func NewMetastoreConnectConfiguration() *MetastoreConnectConfiguration
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, maxLength uint32) (*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
Directories
¶
| Path | Synopsis |
|---|---|
|
gohivemeta
|
|
|
fb303/facebook_service-remote
command
|
|
|
thrift_hive_metastore-remote
command
|
|