Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExecutionResultFormat ¶
func ExecutionResultFormat(md *cli_service.TGetResultSetMetadataResp) string
ExecutionResultFormat maps the result format declared by Thrift result-set metadata to the telemetry execution_result value, or "" when none is declared.
func NewRows ¶
func NewRows( ctx context.Context, opHandle *cli_service.TOperationHandle, client cli_service.TCLIService, config *config.Config, directResults *cli_service.TSparkDirectResults, callbacks *TelemetryCallbacks, ) (driver.Rows, dbsqlerr.DBError)
Types ¶
type TelemetryCallbacks ¶
type TelemetryCallbacks struct {
// OnChunkFetched is called after each result page fetch with chunk-level stats.
OnChunkFetched func(chunkCount int, bytesDownloaded int64, chunkIndex int, chunkLatencyMs int64, totalChunksPresent int32)
// OnClose is called from rows.Close() after all rows have been consumed.
// iterErr is the first error from Next()/fetchResultPage (nil if iteration succeeded).
// closeErr is the error from the CloseOperation RPC (nil if close succeeded).
OnClose func(latencyMs int64, chunkCount int, iterErr error, closeErr error)
// OnCloudFetchFile is called per S3 file download for CloudFetch result sets.
OnCloudFetchFile func(downloadMs int64)
// OnResultFormat is called from rows.Close(), before OnClose, with the
// telemetry execution_result of the result-set metadata the rows already
// hold. It is not called when that format is unknown.
OnResultFormat func(format string)
}
TelemetryCallbacks bundles the optional telemetry hooks passed into NewRows. Pass nil when telemetry is not active; individual fields may also be nil.