Documentation ¶
Overview ¶
Package pinot provides a client for Pinot, a real-time distributed OLAP datastore.
Index ¶
- type AggregationResult
- type BrokerResponse
- type ClientConfig
- type Connection
- func NewFromBrokerList(brokerList []string) (*Connection, error)
- func NewFromBrokerListAndClient(brokerList []string, httpClient *http.Client) (*Connection, error)
- func NewFromController(controllerAddress string) (*Connection, error)
- func NewFromControllerAndClient(controllerAddress string, httpClient *http.Client) (*Connection, error)
- func NewFromZookeeper(zkPath []string, zkPathPrefix string, pinotCluster string) (*Connection, error)
- func NewFromZookeeperAndClient(zkPath []string, zkPathPrefix string, pinotCluster string, ...) (*Connection, error)
- func NewWithConfig(config *ClientConfig) (*Connection, error)
- func NewWithConfigAndClient(config *ClientConfig, httpClient *http.Client) (*Connection, error)
- func (c *Connection) CloseTrace()
- func (c *Connection) ExecuteSQL(table string, query string) (*BrokerResponse, error)
- func (c *Connection) ExecuteSQLWithParams(table string, queryPattern string, params []interface{}) (*BrokerResponse, error)
- func (c *Connection) OpenTrace()
- func (c *Connection) UseMultistageEngine(useMultistageEngine bool)
- type ControllerConfig
- type Exception
- type GroupValue
- type HTTPClient
- type ReadZNode
- type Request
- type RespSchema
- type ResultTable
- func (r ResultTable) Get(rowIndex int, columnIndex int) interface{}
- func (r ResultTable) GetColumnCount() int
- func (r ResultTable) GetColumnDataType(columnIndex int) string
- func (r ResultTable) GetColumnName(columnIndex int) string
- func (r ResultTable) GetDouble(rowIndex int, columnIndex int) float64
- func (r ResultTable) GetFloat(rowIndex int, columnIndex int) float32
- func (r ResultTable) GetInt(rowIndex int, columnIndex int) int32
- func (r ResultTable) GetLong(rowIndex int, columnIndex int) int64
- func (r ResultTable) GetRowCount() int
- func (r ResultTable) GetString(rowIndex int, columnIndex int) string
- type SelectionResults
- type ZookeeperConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AggregationResult ¶
type AggregationResult struct { Function string `json:"function"` Value string `json:"value,omitempty"` GroupByColumns []string `json:"groupByColumns,omitempty"` GroupByResult []GroupValue `json:"groupByResult,omitempty"` }
AggregationResult is the data structure for PQL aggregation result
type BrokerResponse ¶
type BrokerResponse struct { SelectionResults *SelectionResults `json:"SelectionResults,omitempty"` ResultTable *ResultTable `json:"resultTable,omitempty"` TraceInfo map[string]string `json:"traceInfo,omitempty"` AggregationResults []*AggregationResult `json:"aggregationResults,omitempty"` Exceptions []Exception `json:"exceptions"` NumSegmentsProcessed int `json:"numSegmentsProcessed"` NumServersResponded int `json:"numServersResponded"` NumSegmentsQueried int `json:"numSegmentsQueried"` NumServersQueried int `json:"numServersQueried"` NumSegmentsMatched int `json:"numSegmentsMatched"` NumConsumingSegmentsQueried int `json:"numConsumingSegmentsQueried"` NumDocsScanned int64 `json:"numDocsScanned"` NumEntriesScannedInFilter int64 `json:"numEntriesScannedInFilter"` NumEntriesScannedPostFilter int64 `json:"numEntriesScannedPostFilter"` TotalDocs int64 `json:"totalDocs"` TimeUsedMs int `json:"timeUsedMs"` MinConsumingFreshnessTimeMs int64 `json:"minConsumingFreshnessTimeMs"` NumGroupsLimitReached bool `json:"numGroupsLimitReached"` }
BrokerResponse is the data structure for broker response.
type ClientConfig ¶
type ClientConfig struct { // Additional HTTP headers to include in broker query API requests ExtraHTTPHeader map[string]string // Zookeeper Configs ZkConfig *ZookeeperConfig // Controller Config ControllerConfig *ControllerConfig // BrokerList BrokerList []string // HTTP request timeout in your broker query for API requests HTTPTimeout time.Duration // UseMultistageEngine is a flag to enable multistage query execution engine UseMultistageEngine bool }
ClientConfig configs to create a PinotDbConnection
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
Connection to Pinot, normally created through calls to the {@link ConnectionFactory}.
func NewFromBrokerList ¶
func NewFromBrokerList(brokerList []string) (*Connection, error)
NewFromBrokerList create a new Pinot connection with pre configured Pinot Broker list.
func NewFromBrokerListAndClient ¶ added in v0.2.0
func NewFromBrokerListAndClient(brokerList []string, httpClient *http.Client) (*Connection, error)
NewFromBrokerListAndClient create a new Pinot connection with pre configured Pinot Broker list and http client.
func NewFromController ¶ added in v0.2.0
func NewFromController(controllerAddress string) (*Connection, error)
NewFromController creates a new Pinot connection that periodically fetches available brokers via the Controller API.
func NewFromControllerAndClient ¶ added in v0.2.0
func NewFromControllerAndClient(controllerAddress string, httpClient *http.Client) (*Connection, error)
NewFromControllerAndClient creates a new Pinot connection that periodically fetches available brokers via the Controller API.
func NewFromZookeeper ¶
func NewFromZookeeper(zkPath []string, zkPathPrefix string, pinotCluster string) (*Connection, error)
NewFromZookeeper create a new Pinot connection through Pinot Zookeeper.
func NewFromZookeeperAndClient ¶ added in v0.2.0
func NewFromZookeeperAndClient(zkPath []string, zkPathPrefix string, pinotCluster string, httpClient *http.Client) (*Connection, error)
NewFromZookeeperAndClient create a new Pinot connection through Pinot Zookeeper and http client.
func NewWithConfig ¶
func NewWithConfig(config *ClientConfig) (*Connection, error)
NewWithConfig create a new Pinot connection.
func NewWithConfigAndClient ¶ added in v0.2.0
func NewWithConfigAndClient(config *ClientConfig, httpClient *http.Client) (*Connection, error)
NewWithConfigAndClient create a new Pinot connection with pre-created http client.
func (*Connection) CloseTrace ¶ added in v0.2.0
func (c *Connection) CloseTrace()
CloseTrace for the connection
func (*Connection) ExecuteSQL ¶
func (c *Connection) ExecuteSQL(table string, query string) (*BrokerResponse, error)
ExecuteSQL for a given table
func (*Connection) ExecuteSQLWithParams ¶ added in v0.4.0
func (c *Connection) ExecuteSQLWithParams(table string, queryPattern string, params []interface{}) (*BrokerResponse, error)
ExecuteSQLWithParams executes an SQL query with parameters for a given table
func (*Connection) OpenTrace ¶ added in v0.2.0
func (c *Connection) OpenTrace()
OpenTrace for the connection
func (*Connection) UseMultistageEngine ¶ added in v0.3.0
func (c *Connection) UseMultistageEngine(useMultistageEngine bool)
UseMultistageEngine for the connection
type ControllerConfig ¶ added in v0.2.0
type ControllerConfig struct { // Additional HTTP headers to include in the controller API request ExtraControllerAPIHeaders map[string]string ControllerAddress string // Frequency of broker data refresh in milliseconds via controller API - defaults to 1000ms UpdateFreqMs int }
ControllerConfig describes connection of a controller-based selector that periodically fetches table-to-broker mapping via the controller API
type GroupValue ¶
GroupValue is the data structure for PQL aggregation GroupBy result
type HTTPClient ¶ added in v0.2.0
HTTPClient is an interface for http.Client
type Request ¶
type Request struct {
// contains filtered or unexported fields
}
Request is used in server request to host multiple pinot query types, like PQL, SQL.
type RespSchema ¶
type RespSchema struct { ColumnDataTypes []string `json:"columnDataTypes"` ColumnNames []string `json:"columnNames"` }
RespSchema is response schema
type ResultTable ¶
type ResultTable struct { DataSchema RespSchema `json:"dataSchema"` Rows [][]interface{} `json:"rows"` }
ResultTable is a ResultTable
func (ResultTable) Get ¶
func (r ResultTable) Get(rowIndex int, columnIndex int) interface{}
Get returns a ResultTable entry given row index and column index
func (ResultTable) GetColumnCount ¶
func (r ResultTable) GetColumnCount() int
GetColumnCount returns how many columns in the ResultTable
func (ResultTable) GetColumnDataType ¶
func (r ResultTable) GetColumnDataType(columnIndex int) string
GetColumnDataType returns column data type given column index
func (ResultTable) GetColumnName ¶
func (r ResultTable) GetColumnName(columnIndex int) string
GetColumnName returns column name given column index
func (ResultTable) GetDouble ¶
func (r ResultTable) GetDouble(rowIndex int, columnIndex int) float64
GetDouble returns a ResultTable double entry given row index and column index
func (ResultTable) GetFloat ¶
func (r ResultTable) GetFloat(rowIndex int, columnIndex int) float32
GetFloat returns a ResultTable float entry given row index and column index
func (ResultTable) GetInt ¶
func (r ResultTable) GetInt(rowIndex int, columnIndex int) int32
GetInt returns a ResultTable int entry given row index and column index
func (ResultTable) GetLong ¶
func (r ResultTable) GetLong(rowIndex int, columnIndex int) int64
GetLong returns a ResultTable long entry given row index and column index
func (ResultTable) GetRowCount ¶
func (r ResultTable) GetRowCount() int
GetRowCount returns how many rows in the ResultTable
type SelectionResults ¶
type SelectionResults struct { Columns []string `json:"columns"` Results [][]interface{} `json:"results"` }
SelectionResults is the data structure for PQL selection result
type ZookeeperConfig ¶
ZookeeperConfig describes how to config Pinot Zookeeper connection