Documentation
¶
Index ¶
Constants ¶
const ( // Driver errors ErrNotImplemented = "not implemented" ErrTransactionsNotSupported = "transactions are not supported" ErrReadQueryStatus = "could not read query status" ErrSentinelTimeout = "sentinel timed out waiting for operation to complete" ErrParametersNotSupported = "query parameters are not supported by this server" ErrMixedNamedAndPositionalParameters = "named and positional parameters cannot be used simultaneously" // Request error messages (connection, authentication, network error) ErrCloseConnection = "failed to close connection" ErrThriftClient = "error initializing thrift client" ErrInvalidURL = "invalid URL" ErrNoAuthenticationMethod = "no authentication method set" ErrNoDefaultAuthenticator = "unable to create default authenticator" ErrInvalidDSNFormat = "invalid DSN: invalid format" ErrInvalidDSNPort = "invalid DSN: invalid DSN port" ErrInvalidDSNPATIsEmpty = "invalid DSN: empty token" ErrBasicAuthNotSupported = "invalid DSN: basic auth not enabled" ErrInvalidDSNM2m = "invalid DSN: clientId and clientSecret params required" // Execution error messages (query failure) ErrQueryExecution = "failed to execute query" ErrLinkExpired = "link expired" )
Error messages
Variables ¶
var DatabricksError error = errors.New("Databricks Error")
value to be used with errors.Is() to determine if an error chain contains any databricks error
var DriverError error = errors.New("Driver Error")
value to be used with errors.Is() to determine if an error chain contains a driver error
var ErrInvalidKernelConfig error = errors.New("invalid kernel backend configuration")
value to be used with errors.Is() to determine that a kernel-backend option was itself malformed (e.g. a WithKernelProxy URL that does not parse) — as opposed to unsupported (ErrNotSupportedByKernel) or a transient connect failure. The kernel path validates such options in the Go layer before handing them to the kernel's C ABI, where the failure would otherwise surface as an opaque wrapped string a caller can't branch on. Lets a caller distinguish "fix your config" from a retryable error instead of matching on message text.
var ErrKernelNotCompiled error = errors.New("the SEA-via-kernel backend is not compiled into this binary")
value to be used with errors.Is() to determine that WithUseKernel(true) was set but the binary was built without the kernel backend compiled in (missing the `databricks_kernel` build tag / CGO_ENABLED=1). Lets a caller detect the build-mismatch case programmatically — the same detection mechanism as ErrNotSupportedByKernel — instead of matching on message text.
var ErrNotSupportedByKernel error = errors.New("not supported by the kernel backend")
value to be used with errors.Is() to determine if an error is a kernel-backend "option/feature not supported" rejection. The kernel backend (WithUseKernel) rejects options it cannot yet honor rather than silently ignoring them; wrapping them all with this sentinel lets a caller detect the case programmatically (e.g. to fall back to the default Thrift backend) instead of matching on message text.
var ErrRequiresKernelBackend error = errors.New("requires the SEA-via-kernel backend")
value to be used with errors.Is() to determine that a kernel-only option (e.g. WithKernelTrustedCerts / WithKernelSkipHostnameVerify) was set without WithUseKernel, so the default (Thrift) backend rejected it rather than connecting with a weaker-than-intended TLS trust store. This is the mirror of ErrNotSupportedByKernel — that sentinel means "the kernel can't honor this option"; this one means "this option requires the kernel". Lets a caller detect the case programmatically instead of matching on message text.
var ExecutionError error = errors.New("Execution Error")
value to be used with errors.Is() to determine if an error chain contains an execution error
var RequestError error = errors.New("Request Error")
value to be used with errors.Is() to determine if an error chain contains a request error
Functions ¶
func ErrUnexpectedOperationState ¶ added in v1.4.0
Types ¶
type DBDriverError ¶
type DBDriverError interface {
DBError
}
A fault that is caused by Databricks services
type DBError ¶
type DBError interface {
// Descriptive message describing the error
Error() string
// User specified id to track what happens under a request. Useful to track multiple connections in the same request.
// Appears in log messages as field corrId. See driverctx.NewContextWithCorrelationId()
CorrelationId() string
// Internal id to track what happens under a connection. Connections can be reused so this would track across queries.
// Appears in log messages as field connId.
ConnectionId() string
// Stack trace associated with the error. May be nil.
StackTrace() errors.StackTrace
// Underlying causative error. May be nil.
Cause() error
IsRetryable() bool
RetryAfter() time.Duration
}
Base interface for driver errors
type DBExecutionError ¶
type DBExecutionError interface {
DBError
// Internal id to track what happens under a query.
// Appears in log messages as field queryId.
QueryId() string
// Optional portable error identifier across SQL engines.
// See https://github.com/apache/spark/tree/master/core/src/main/resources/error#ansiiso-standard
SqlState() string
}
Any error that occurs after the SQL statement has been accepted (e.g. SQL syntax error).
type DBRequestError ¶
type DBRequestError interface {
DBError
}
An error that is caused by an invalid request. Example: permission denied, or the user tries to access a warehouse that doesn’t exist