Documentation
¶
Index ¶
- Variables
- func NewConnector(opts *Options) driver.Connector
- type AuthError
- type ColumnName
- type ConnRawAccess
- type Driver
- type Metadata
- func (m Metadata) GetColumns(ctx context.Context, schemaPattern string, tableNamePattern string, ...) ([]ColumnName, error)
- func (m Metadata) GetSchemas(ctx context.Context, schemaPattern string) ([]string, error)
- func (m Metadata) GetTables(ctx context.Context, schemaPattern string, tableNamePattern string) ([]TableName, error)
- type Options
- type TableName
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNotSupported means the driver does not support this operation ErrNotSupported = isql.ErrNotSupported // ErrOpenFailed means the driver failed to open a connection. // Following database/sql docs, this is a separate error from driver.ErrBadConn. // If the root cause is context.DeadlineExceeded, AuthError, or *tls.CertificateVerificationError, // that cause will be in the same error tree as this sentinel, likely as a sibling. ErrOpenFailed = errors.New("impala: failed to open connection") // ErrBadDSN means the driver failed to parse the DSN or contained incorrect values. // Another error in the tree will describe the specific issue. ErrBadDSN = errors.New("impala: bad DSN") )
Functions ¶
func NewConnector ¶
NewConnector creates connector with specified options
Types ¶
type AuthError ¶ added in v1.1.0
AuthError indicates that there was an authentication or authorization failure. The error message documents the username used, if any. errors.Unwrap() returns the underlying error interpreted as auth. failure, if any. This error will not be top-level in the chain/tree - earlier errors reflect the process during which the error happened.
type ColumnName ¶ added in v1.1.0
type ColumnName = hive.ColumnName
ColumnName contains all attributes that identify a columns
type ConnRawAccess ¶ added in v0.2.0
ConnRawAccess exposes the Raw method of sql.Conn
type Driver ¶
type Driver struct{}
Driver to impala
func (*Driver) Open ¶
Open creates a new connection to impala using the given data source name. Implements driver.Driver. The returned error contains ErrOpenFailed in the chain/tree, along with the specific cause. See ErrOpenFailed about which causes are guaranteed to be reported. The API does not guarantee the order of errors in the tree.
type Metadata ¶ added in v0.1.1
type Metadata struct {
// contains filtered or unexported fields
}
Metadata exposes the schema and other metadata in an Impala instance
func NewMetadata ¶ added in v0.1.1
NewMetadata creates Metadata instance with the given Impala DB as data source. A new connection will be retrieved for any call. If that's an issue, use NewMetadataFromConn
func NewMetadataFromConn ¶ added in v0.2.0
func NewMetadataFromConn(conn ConnRawAccess) *Metadata
NewMetadataFromConn creates Metadata instance with the given Impala connection as data source *sql.Conn implements ConnRawAccess
func (Metadata) GetColumns ¶ added in v1.1.0
func (m Metadata) GetColumns(ctx context.Context, schemaPattern string, tableNamePattern string, columnNamePattern string) ([]ColumnName, error)
GetColumns retrieves columns that match the provided LIKE patterns
func (Metadata) GetSchemas ¶ added in v0.2.0
GetSchemas retrieves schemas that match the provided LIKE pattern
type Options ¶
type Options struct {
Host string
Port string
Username string
Password string
// ReuseSession disables resetting the session when database/sql SPI requests it.
// The connection and session will still be validated. database/sql asks to reset the session
// when it reuses a connection from its pool.
//
// All popular drivers don't reset the connection session even though it is required
// by the database/sql/driver SPI. When this setting is enabled, this driver behaves consistently
// with the other DB drivers in the ecosystem but diverges somewhat from documented database/sql behavior.
//
// This setting must be enabled when this driver is used in github.com/xo/usql.
// `usql` returns the connection to the pool after each statement, relying on the typical driver behavior.
ReuseSession bool
UseLDAP bool
UseTLS bool
CACertPath string
// TlsInsecureSkipVerify configures the tls.Config InsecureSkipVerify flag for
// a TLS connection to Impala. Behaves the same way as AllowSelfSignedCerts in the official JDBC driver.
TLSInsecureSkipVerify bool
BufferSize int
BatchSize int
// MemoryLimit configures the MEM_LIMIT Impala property for the connection
// https://impala.apache.org/docs/build/html/topics/impala_mem_limit.html
MemoryLimit 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
LogOut io.Writer
// SocketTimeout configures the maximum socket idle time. 0 or negative value means no limit.
// Configuring SocketTimeout together with setting a context deadline/timeout
// also causes socket reads to be retried within the deadline (thrift behavior)
SocketTimeout time.Duration
// ConnectTimeout configures the max wait for initial connection to server. 0 or negative value means no limit.
ConnectTimeout time.Duration
}
Options for impala driver connection It is recommended to copy DefaultOptions before customizing values. The zero value of Options is a valid, but not recommended, configuration. The default and recommended value of all fields is the zero value if not otherwise specified in DefaultOptions.