presto

package
v0.0.0-...-1d44d98 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 2, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TimestampFormat is the time format string used to produce Presto timestamps.
	TimestampFormat = "2006-01-02 15:04:05.000"
)

Variables

This section is empty.

Functions

func CreateTable

func CreateTable(queryer db.Queryer, catalog, schema, tableName string, columns []Column, comment string, properties map[string]string, ignoreExists bool) error

func CreateTableAs

func CreateTableAs(queryer db.Queryer, catalog, schema, tableName string, columns []Column, comment string, properties map[string]string, ignoreExists bool, query string) error

func CreateView

func CreateView(queryer db.Queryer, catalog, schema, viewName string, query string, replace bool) error

func DeleteFrom

func DeleteFrom(queryer db.Queryer, tableName string) error

func DropTable

func DropTable(queryer db.Queryer, catalog, schema, tableName string, ignoreNotExists bool) error

func DropView

func DropView(queryer db.Queryer, catalog, schema, viewName string, ignoreNotExists bool) error

func FormatInsertQuery

func FormatInsertQuery(target, query string) string

func FullyQualifiedTableName

func FullyQualifiedTableName(catalog, schema, tableName string) string

func GenerateGetRowsSQL

func GenerateGetRowsSQL(tableName string, columns []Column) string

func GenerateGetRowsSQLWithWhere

func GenerateGetRowsSQLWithWhere(tableName string, columns []Column, whereClause string) string

func GenerateOrderBySQL

func GenerateOrderBySQL(columns []Column) string

func GenerateQuotedColumnsListSQL

func GenerateQuotedColumnsListSQL(columns []Column) string

func InsertInto

func InsertInto(queryer db.Queryer, tableName, query string) error

Types

type Column

type Column struct {
	Name string `json:"name"`
	Type string `json:"type"`
}

func QueryMetadata

func QueryMetadata(queryer db.Queryer, catalog, schema, tableName string) ([]Column, error)

QueryMetadata executes a "DESCRIBE" Presto query against an existing, fully-qualified table name to determine that table's column information.

type PartitionSpec

type PartitionSpec map[string]string

type Row

type Row map[string]interface{}

func ExecuteSelect

func ExecuteSelect(queryer db.Queryer, query string) ([]Row, error)

ExecuteSelectQuery performs the query on the table target. It's expected target has the correct schema.

func GetRows

func GetRows(queryer db.Queryer, tableName string, columns []Column) ([]Row, error)

func GetRowsWhere

func GetRowsWhere(queryer db.Queryer, tableName string, columns []Column, whereClause string) ([]Row, error)

type TablePartition

type TablePartition struct {
	Location      string        `json:"location"`
	PartitionSpec PartitionSpec `json:"partitionSpec"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL