presto

package
v0.0.0-...-410a1e5 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2017 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// state
	FAILED = "FAILED"
)

Functions

func Do

func Do(req *http.Request) (*http.Response, error)

Types

type ClientTypeSignature

type ClientTypeSignature struct {
	RawType          string                         `json:"rawType"`
	TypeArguments    []interface{}                  `json:"typeArguments"`
	LiteralArguments []interface{}                  `json:"literalArguments"`
	Arguments        []ClientTypeSignatureParameter `json:"arguments"`
}

type ClientTypeSignatureParameter

type ClientTypeSignatureParameter struct {
	Kind  interface{} `json:"kind"`
	Value interface{} `json:"value"`
}

type Column

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

type Columns

type Columns []Column

func (Columns) Names

func (this Columns) Names() []string

type Config

type Config struct {
	Host string

	// HTTP-Request-Header
	User     string `default:"hive"`
	Catalog  string `default:"hive"`
	Schema   string `default:"default"`
	TimeZone string `default:"UTC"`
}

type Data

type Data [][]interface{}

func (Data) StringSlices

func (this Data) StringSlices() [][]string

type ErrorLocation

type ErrorLocation struct {
	LineNumber   int `json:"lineNumber"`
	ColumnNumber int `json:"columnNumber"`
}

type FailerInfo

type FailerInfo struct {
	Type          string        `json:"type"`
	Message       string        `json:"message"`
	Cause         interface{}   `json:"cause"`
	Suppressed    []interface{} `json:"Suppressed"`
	Stack         []string      `json:"stack"`
	ErrorLocation ErrorLocation `json:"errorLocation"`
}

type Presto

type Presto struct {
	URL           string
	DefaultHeader http.Header
}

func New

func New(config *Config) *Presto

func (*Presto) Query

func (this *Presto) Query(query string) (*QueryResult, error)

func (*Presto) Request

func (this *Presto) Request(method, endpoint string, body io.Reader) (*http.Request, error)

func (*Presto) SetHeader

func (this *Presto) SetHeader(config *Config)

type QueryError

type QueryError struct {
	Message       string        `json:"message"`
	SqlState      string        `json:"sqlState"`
	ErrorName     string        `json:"errorName"`
	ErrorType     string        `json:"errorType"`
	ErrorLocation ErrorLocation `json:"errorLocation"`
	FailerInfo    FailerInfo    `json:"failureInfo"`
}

func (QueryError) Error

func (err QueryError) Error() string

type QueryResult

type QueryResult struct {
	ID          string         `json:"id"`
	InfoUri     string         `json:"infoUri"`
	NextUri     string         `json:"nextUri"`
	Columns     Columns        `json:"columns"`
	Data        Data           `json:"data"`
	Stats       StatementStats `json:"stats"`
	Error       QueryError     `json:"error"`
	UpdateType  string         `json:"updateType"`
	UpdateCount int            `json:"updateCount"`
	Presto      *Presto        `json:"-"`
}

func (*QueryResult) Next

func (this *QueryResult) Next() (*QueryResult, error)

type StageStats

type StageStats struct {
	StageID        string       `json:"stageId"`
	State          string       `json:"state"`
	Done           string       `json:"done"`
	Nodes          string       `json:"nodes"`
	TotalSplits    int          `json:"totalSplits"`
	QueuedSplits   int          `json:"queuedSplits"`
	RunningSplits  int          `json:"runningSplits"`
	CompleteSplits int          `json:"completeSplits"`
	UserMillis     int          `json:"userMillis"`
	CpuMillis      int          `json:"cpuMillis"`
	WallTimeMillis int          `json:"wallTimeMillis"`
	ProcessedRows  int          `json:"processedRows"`
	ProcessedBytes int          `json:"processedBytes"`
	SubStages      []StageStats `json:"subStages"`
}

type StatementStats

type StatementStats struct {
	State          string     `json:"state"`
	Queued         bool       `json:"queued"`
	Nodes          int        `json:"nodes"`
	TotalSplits    int        `json:"totalSplits"`
	QueuedSplits   int        `json:"queuedSplits"`
	RunningSplits  int        `json:"runningSplits"`
	CompleteSplits int        `json:"completeSplits"`
	UserMillis     int        `json:"userMillis"`
	CpuMillis      int        `json:"cpuMillis"`
	WallTimeMillis int        `json:"wallTimeMillis"`
	ProcessedRows  int        `json:"processedRows"`
	ProcessedBytes int        `json:"processedBytes"`
	RootState      StageStats `json:"rootState"`
}

Jump to

Keyboard shortcuts

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