Documentation
¶
Index ¶
- Variables
- func CountRows(rowSet *cli_service.TRowSet) int64
- func GetDBType(column *cli_service.TColumnDesc) cli_service.TTypeId
- func GetDBTypeID(column *cli_service.TColumnDesc) cli_service.TTypeId
- func GetDBTypeName(column *cli_service.TColumnDesc) string
- func GetDBTypeQualifiers(column *cli_service.TColumnDesc) *cli_service.TTypeQualifiers
- func HandleDateTime(val any, dbType, columnName string, location *time.Location) (result any, err error)
- func IsNull(nulls []byte, position int64) bool
- type Delimiter
- type Direction
- type ResultPageIterator
- type RowScanner
Constants ¶
This section is empty.
Variables ¶
View Source
var DateTimeFormats map[string]string = map[string]string{
"TIMESTAMP": "2006-01-02 15:04:05.999999999",
"DATE": "2006-01-02",
}
Expected formats for TIMESTAMP and DATE types when represented by a string value
View Source
var ErrRowsFetchPriorToStart = "databricks: unable to fetch row page prior to start of results"
View Source
var ErrRowsParseValue = "databricks: unable to parse %s value '%v' from column %s"
Functions ¶
func CountRows ¶ added in v1.5.0
func CountRows(rowSet *cli_service.TRowSet) int64
countRows returns the number of rows in the TRowSet
func GetDBType ¶
func GetDBType(column *cli_service.TColumnDesc) cli_service.TTypeId
func GetDBTypeID ¶
func GetDBTypeID(column *cli_service.TColumnDesc) cli_service.TTypeId
GetDBTypeID returns the database type ID from a TColumnDesc
func GetDBTypeName ¶
func GetDBTypeName(column *cli_service.TColumnDesc) string
GetDBTypeName returns the database type name from a TColumnDesc
func GetDBTypeQualifiers ¶
func GetDBTypeQualifiers(column *cli_service.TColumnDesc) *cli_service.TTypeQualifiers
GetDBTypeQualifiers returns the TTypeQualifiers from a TColumnDesc. Return value may be nil.
Types ¶
type Delimiter ¶ added in v1.5.0
type Delimiter interface {
Start() int64
End() int64
Count() int64
Contains(int64) bool
Direction(int64) Direction
}
func NewDelimiter ¶ added in v1.5.0
type Direction ¶ added in v1.5.0
type Direction int
Define directions for seeking in the pages of a query result
type ResultPageIterator ¶ added in v1.5.0
type ResultPageIterator interface {
Next() (*cli_service.TFetchResultsResp, error)
HasNext() bool
Close() error
Delimiter
}
Interface for iterating over the pages in the result set of a query
func NewResultPageIterator ¶ added in v1.5.0
func NewResultPageIterator( delimiter Delimiter, maxPageSize int64, opHandle *cli_service.TOperationHandle, closedOnServer bool, client cli_service.TCLIService, connectionId string, correlationId string, logger *dbsqllog.DBSQLLogger, ) ResultPageIterator
Create a new result page iterator.
type RowScanner ¶
type RowScanner interface {
Delimiter
// ScanRow is called to populate the provided slice with the
// content of the current row. The provided slice will be the same
// size as the number of columns.
// The dest should not be written to outside of ScanRow. Care
// should be taken when closing a RowScanner not to modify
// a buffer held in dest.
ScanRow(dest []driver.Value, rowNumber int64) dbsqlerr.DBError
// NRows returns the number of rows in the current result page
NRows() int64
// Close any open resources
Close()
GetArrowBatches(ctx context.Context, cfg config.Config, rpi ResultPageIterator) (dbsqlrows.ArrowBatchIterator, error)
GetArrowIPCStreams(ctx context.Context, cfg config.Config, rpi ResultPageIterator) (dbsqlrows.ArrowIPCStreamIterator, error)
}
RowScanner is an interface defining the behaviours that are specific to the formats in which query results can be returned.
Click to show internal directories.
Click to hide internal directories.