elasticsearch

package
v0.0.0-...-f111e62 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2017 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SourceType defines the "source" type from qlbridge datasource
	SourceType = "elasticsearch"
)

Variables

View Source
var (
	DefaultLimit = 1000
)

Functions

This section is empty.

Types

type ElasticsearchDataSource

type ElasticsearchDataSource struct {
	// contains filtered or unexported fields
}

func (*ElasticsearchDataSource) Close

func (m *ElasticsearchDataSource) Close() error

func (*ElasticsearchDataSource) DataSource

func (m *ElasticsearchDataSource) DataSource() schema.Source

func (*ElasticsearchDataSource) Init

func (m *ElasticsearchDataSource) Init()

func (*ElasticsearchDataSource) Open

func (m *ElasticsearchDataSource) Open(schemaName string) (schema.Conn, error)

func (*ElasticsearchDataSource) Setup

func (*ElasticsearchDataSource) Table

func (m *ElasticsearchDataSource) Table(table string) (*schema.Table, error)

func (*ElasticsearchDataSource) Tables

func (m *ElasticsearchDataSource) Tables() []string

type ResultReader

type ResultReader struct {
	*exec.TaskBase

	Docs []u.JsonHelper
	Vals [][]driver.Value

	Total    int
	Aggs     u.JsonHelper
	ScrollId string
	Req      *SqlToEs
	// contains filtered or unexported fields
}

Elasticsearch ResultProvider, adapts the elasticsearch http json

to dataux/driver values

func NewResultReader

func NewResultReader(req *SqlToEs) *ResultReader

func (*ResultReader) Close

func (m *ResultReader) Close() error

func (*ResultReader) Columns

func (m *ResultReader) Columns() []string

func (*ResultReader) Run

func (m *ResultReader) Run() error

Run() Fetch api response, wait for response, then convert response into rows (static) and allow Next() to start iterating through them.

type ResultReaderNext

type ResultReaderNext struct {
	*ResultReader
}

A wrapper, allowing us to implement sql/driver Next() interface

which is different than qlbridge/datasource Next()

type SqlToEs

type SqlToEs struct {
	// contains filtered or unexported fields
}

Sql To Elasticsearch Request Object

Map sql queries into Elasticsearch Json Requests

func NewSqlToEs

func NewSqlToEs(table *schema.Table) *SqlToEs

func (*SqlToEs) Close

func (m *SqlToEs) Close() error

func (*SqlToEs) Columns

func (m *SqlToEs) Columns() []string

func (*SqlToEs) Host

func (m *SqlToEs) Host() string

func (*SqlToEs) WalkAggs

func (m *SqlToEs) WalkAggs(cur expr.Node) (q esMap, _ error)

WalkAggs() aggregate expressions when used ast part of <select_list>

  • For Aggregates (functions) it builds aggs
  • For Projectsion (non-functions) it does nothing, that will be done later during projection

func (*SqlToEs) WalkExecSource

func (m *SqlToEs) WalkExecSource(p *plan.Source) (exec.Task, error)

func (*SqlToEs) WalkGroupBy

func (m *SqlToEs) WalkGroupBy() error

Aggregations from the <select_list>

WHERE .. GROUP BY x,y,z

func (*SqlToEs) WalkNode

func (m *SqlToEs) WalkNode(cur expr.Node, q *esMap) (value.Value, error)

Walk() an expression, and its AND/OR/() logic to create an appropriately

nested json document for elasticsearch queries

TODO:  think we need to separate Value Nodes from those that return es types?

func (*SqlToEs) WalkSelectList

func (m *SqlToEs) WalkSelectList() error

Aggregations from the <select_list>

SELECT <select_list> FROM ... WHERE

func (*SqlToEs) WalkSourceSelect

func (m *SqlToEs) WalkSourceSelect(planner plan.Planner, p *plan.Source) (plan.Task, error)

WalkSourceSelect is used during planning phase, to create a plan (plan.Task)

or error, and to report back any poly-fill necessary

Jump to

Keyboard shortcuts

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