Documentation ¶
Index ¶
- Constants
- func GetStringArray(array *C.array) []string
- func RewriteMergeQuery(query *SelectQuery, rm RegexMatcher)
- type BasicQuery
- type DeleteQuery
- type DropQuery
- type DropSeriesQuery
- type From
- type FromClause
- type FromClauseType
- type GroupByClause
- type IntoClause
- type ListQuery
- type ListType
- type Operation
- type Query
- func (self *Query) GetListSeriesQuery() *ListQuery
- func (self *Query) GetQueryString() string
- func (self *Query) GetQueryStringWithTimeCondition() string
- func (self *Query) IsContinuousQuery() bool
- func (self *Query) IsExplainQuery() bool
- func (self *Query) IsListContinuousQueriesQuery() bool
- func (self *Query) IsListQuery() bool
- func (self *Query) IsListSeriesQuery() bool
- func (self *Query) Type() QueryType
- type QueryError
- type QuerySpec
- func (self *QuerySpec) AllShardsQuery() bool
- func (self *QuerySpec) Database() string
- func (self *QuerySpec) DeleteQuery() *DeleteQuery
- func (self *QuerySpec) GetEndTime() time.Time
- func (self *QuerySpec) GetFromClause() *FromClause
- func (self *QuerySpec) GetGroupByColumnCount() int
- func (self *QuerySpec) GetGroupByInterval() *time.Duration
- func (self *QuerySpec) GetQueryString() string
- func (self *QuerySpec) GetQueryStringWithTimeCondition() string
- func (self *QuerySpec) GetStartTime() time.Time
- func (self *QuerySpec) HasAggregates() bool
- func (self *QuerySpec) HasReadAccess(name string) bool
- func (self *QuerySpec) IsAscending() bool
- func (self *QuerySpec) IsDeleteFromSeriesQuery() bool
- func (self *QuerySpec) IsDestructiveQuery() bool
- func (self *QuerySpec) IsDropSeriesQuery() bool
- func (self *QuerySpec) IsExplainQuery() bool
- func (self *QuerySpec) IsListSeriesQuery() bool
- func (self *QuerySpec) IsRegex() bool
- func (self *QuerySpec) IsSinglePointQuery() bool
- func (self *QuerySpec) Query() *Query
- func (self *QuerySpec) ReadsFromMultipleSeries() bool
- func (self *QuerySpec) SelectQuery() *SelectQuery
- func (self *QuerySpec) SeriesValuesAndColumns() map[*Value][]string
- func (self *QuerySpec) TableNames() []string
- func (self *QuerySpec) TableNamesAndRegex() ([]string, *regexp.Regexp)
- func (self *QuerySpec) User() common.User
- type QueryType
- type RegexMatcher
- type SelectDeleteCommonQuery
- func (self *SelectDeleteCommonQuery) GetFromClause() *FromClause
- func (self *SelectDeleteCommonQuery) GetTableAliases(name string) []string
- func (self *SelectDeleteCommonQuery) GetWhereCondition() *WhereCondition
- func (self *SelectDeleteCommonQuery) GetWhereConditionWithTime(startTime, endTime time.Time) *WhereCondition
- func (self *SelectDeleteCommonQuery) WillReturnSingleSeries() bool
- type SelectQuery
- func (self *SelectQuery) ContainsArithmeticOperators() bool
- func (self *SelectQuery) GetColumnNames() []*Value
- func (self *SelectQuery) GetGroupByClause() *GroupByClause
- func (self *SelectQuery) GetIntoClause() *IntoClause
- func (self *SelectQuery) GetQueryString() string
- func (self *SelectQuery) GetQueryStringWithTimeCondition() string
- func (self *SelectQuery) GetQueryStringWithTimes(startTime, endTime time.Time) string
- func (self *SelectQuery) GetQueryStringWithTimesAndNoIntoClause(startTime, endTime time.Time) string
- func (self *SelectQuery) GetReferencedColumns() map[*Value][]string
- func (self *SelectQuery) GetResultColumns() map[*Value][]string
- func (self *SelectQuery) GetSinglePointQuerySequenceNumber() (uint64, error)
- func (self *SelectQuery) HasAggregates() bool
- func (self *SelectQuery) IsExplainQuery() bool
- func (self *SelectQuery) IsNonRecursiveContinuousQuery() bool
- func (self *SelectQuery) IsSinglePointQuery() bool
- func (self *SelectQuery) IsValidContinuousQuery() bool
- type TableName
- type Value
- type ValueType
- type Values
- type WhereCondition
Constants ¶
const ( ValueRegex ValueType = C.VALUE_REGEX ValueInt = C.VALUE_INT ValueBool = C.VALUE_BOOLEAN ValueFloat = C.VALUE_FLOAT ValueString = C.VALUE_STRING ValueIntoName = C.VALUE_INTO_NAME ValueTableName = C.VALUE_TABLE_NAME ValueSimpleName = C.VALUE_SIMPLE_NAME ValueDuration = C.VALUE_DURATION ValueWildcard = C.VALUE_WILDCARD ValueFunctionCall = C.VALUE_FUNCTION_CALL ValueExpression = C.VALUE_EXPRESSION )
Variables ¶
This section is empty.
Functions ¶
func GetStringArray ¶
func RewriteMergeQuery ¶ added in v0.8.4
func RewriteMergeQuery(query *SelectQuery, rm RegexMatcher)
Given a function that returns the series names that match the given regex, this function will rewrite the query such that the matching serires names are included in the query. E.g. if we have series names foobar, foobaz and barbaz and a query
select * from merge(/foo.*/)
the query will be rewritten to
select * from merge(foobar, foobaz)
Types ¶
type BasicQuery ¶
type BasicQuery struct {
// contains filtered or unexported fields
}
func (*BasicQuery) GetEndTime ¶
func (self *BasicQuery) GetEndTime() time.Time
Returns the start time of the query. Queries can only have one condition of the form time > start_time
func (*BasicQuery) GetStartTime ¶
func (self *BasicQuery) GetStartTime() time.Time
Returns the start time of the query. Queries can only have one condition of the form time > start_time
func (*BasicQuery) IsStartTimeSpecified ¶
func (self *BasicQuery) IsStartTimeSpecified() bool
type DeleteQuery ¶
type DeleteQuery struct {
SelectDeleteCommonQuery
}
func (*DeleteQuery) GetQueryString ¶
func (self *DeleteQuery) GetQueryString(withTime bool) string
type DropSeriesQuery ¶
type DropSeriesQuery struct {
// contains filtered or unexported fields
}
func (*DropSeriesQuery) GetTableName ¶
func (self *DropSeriesQuery) GetTableName() string
type FromClause ¶
type FromClause struct { Type FromClauseType Names []*TableName Regex *regexp.Regexp }
func GetFromClause ¶
func GetFromClause(fromClause *C.from_clause) (*FromClause, error)
func (*FromClause) GetString ¶
func (self *FromClause) GetString() string
type FromClauseType ¶
type FromClauseType int
const ( FromClauseArray FromClauseType = C.FROM_ARRAY FromClauseMerge FromClauseType = C.FROM_MERGE FromClauseInnerJoin FromClauseType = C.FROM_JOIN FromClauseMergeRegex FromClauseType = C.FROM_MERGE_REGEX FromClauseJoinRegex FromClauseType = C.FROM_JOIN_REGEX )
type GroupByClause ¶
func GetGroupByClause ¶
func GetGroupByClause(groupByClause *C.groupby_clause) (*GroupByClause, error)
func (GroupByClause) GetGroupByTime ¶
func (self GroupByClause) GetGroupByTime() (*time.Duration, bool, error)
func (*GroupByClause) GetString ¶
func (self *GroupByClause) GetString() string
type IntoClause ¶
func GetIntoClause ¶
func GetIntoClause(intoClause *C.into_clause) (*IntoClause, error)
func (*IntoClause) GetString ¶
func (self *IntoClause) GetString() string
type ListQuery ¶
type ListQuery struct { Type ListType IncludeSpaces bool // contains filtered or unexported fields }
func (*ListQuery) IsCaseSensitive ¶
type Query ¶
type Query struct { SelectQuery *SelectQuery DeleteQuery *DeleteQuery ListQuery *ListQuery DropSeriesQuery *DropSeriesQuery DropQuery *DropQuery // contains filtered or unexported fields }
func ParseQuery ¶
func (*Query) GetListSeriesQuery ¶
func (*Query) GetQueryString ¶
func (*Query) GetQueryStringWithTimeCondition ¶
func (*Query) IsContinuousQuery ¶ added in v0.8.3
func (*Query) IsExplainQuery ¶
func (*Query) IsListContinuousQueriesQuery ¶
func (*Query) IsListQuery ¶
func (*Query) IsListSeriesQuery ¶
type QueryError ¶
type QueryError struct {
// contains filtered or unexported fields
}
func (*QueryError) Error ¶
func (self *QueryError) Error() string
func (*QueryError) PrettyPrint ¶
func (self *QueryError) PrettyPrint() string
type QuerySpec ¶
type QuerySpec struct { RunAgainstAllServersInShard bool GroupByIrregularInterval bool // contains filtered or unexported fields }
func (*QuerySpec) AllShardsQuery ¶
func (*QuerySpec) DeleteQuery ¶
func (self *QuerySpec) DeleteQuery() *DeleteQuery
func (*QuerySpec) GetEndTime ¶
func (*QuerySpec) GetFromClause ¶
func (self *QuerySpec) GetFromClause() *FromClause
func (*QuerySpec) GetGroupByColumnCount ¶
func (*QuerySpec) GetGroupByInterval ¶
func (*QuerySpec) GetQueryString ¶
func (*QuerySpec) GetQueryStringWithTimeCondition ¶
func (*QuerySpec) GetStartTime ¶
func (*QuerySpec) HasAggregates ¶
func (*QuerySpec) HasReadAccess ¶
func (*QuerySpec) IsAscending ¶
func (*QuerySpec) IsDeleteFromSeriesQuery ¶
func (*QuerySpec) IsDestructiveQuery ¶
func (*QuerySpec) IsDropSeriesQuery ¶
func (*QuerySpec) IsExplainQuery ¶
func (*QuerySpec) IsListSeriesQuery ¶
func (*QuerySpec) IsSinglePointQuery ¶
func (*QuerySpec) ReadsFromMultipleSeries ¶
func (*QuerySpec) SelectQuery ¶
func (self *QuerySpec) SelectQuery() *SelectQuery
func (*QuerySpec) SeriesValuesAndColumns ¶
func (*QuerySpec) TableNames ¶
func (*QuerySpec) TableNamesAndRegex ¶
type RegexMatcher ¶ added in v0.8.4
type SelectDeleteCommonQuery ¶
type SelectDeleteCommonQuery struct { BasicQuery FromClause *FromClause Condition *WhereCondition }
func (*SelectDeleteCommonQuery) GetFromClause ¶
func (self *SelectDeleteCommonQuery) GetFromClause() *FromClause
func (*SelectDeleteCommonQuery) GetTableAliases ¶
func (self *SelectDeleteCommonQuery) GetTableAliases(name string) []string
func (*SelectDeleteCommonQuery) GetWhereCondition ¶
func (self *SelectDeleteCommonQuery) GetWhereCondition() *WhereCondition
func (*SelectDeleteCommonQuery) GetWhereConditionWithTime ¶
func (self *SelectDeleteCommonQuery) GetWhereConditionWithTime(startTime, endTime time.Time) *WhereCondition
func (*SelectDeleteCommonQuery) WillReturnSingleSeries ¶
func (self *SelectDeleteCommonQuery) WillReturnSingleSeries() bool
type SelectQuery ¶
type SelectQuery struct { SelectDeleteCommonQuery ColumnNames []*Value IntoClause *IntoClause Limit int Ascending bool Explain bool // contains filtered or unexported fields }
func ParseSelectQuery ¶
func ParseSelectQuery(query string) (*SelectQuery, error)
This is just for backward compatability so we don't have to change all the code.
func (*SelectQuery) ContainsArithmeticOperators ¶ added in v0.8.4
func (self *SelectQuery) ContainsArithmeticOperators() bool
Returns true if the query has some expression in the select clause
func (*SelectQuery) GetColumnNames ¶
func (self *SelectQuery) GetColumnNames() []*Value
func (*SelectQuery) GetGroupByClause ¶
func (self *SelectQuery) GetGroupByClause() *GroupByClause
func (*SelectQuery) GetIntoClause ¶
func (self *SelectQuery) GetIntoClause() *IntoClause
func (*SelectQuery) GetQueryString ¶
func (self *SelectQuery) GetQueryString() string
func (*SelectQuery) GetQueryStringWithTimeCondition ¶
func (self *SelectQuery) GetQueryStringWithTimeCondition() string
func (*SelectQuery) GetQueryStringWithTimes ¶
func (self *SelectQuery) GetQueryStringWithTimes(startTime, endTime time.Time) string
func (*SelectQuery) GetQueryStringWithTimesAndNoIntoClause ¶
func (self *SelectQuery) GetQueryStringWithTimesAndNoIntoClause(startTime, endTime time.Time) string
func (*SelectQuery) GetReferencedColumns ¶
func (self *SelectQuery) GetReferencedColumns() map[*Value][]string
Returns a mapping from the time series names (or regex) to the column names that are references
func (*SelectQuery) GetResultColumns ¶
func (self *SelectQuery) GetResultColumns() map[*Value][]string
func (*SelectQuery) GetSinglePointQuerySequenceNumber ¶
func (self *SelectQuery) GetSinglePointQuerySequenceNumber() (uint64, error)
func (*SelectQuery) HasAggregates ¶
func (self *SelectQuery) HasAggregates() bool
Returns true if the query has aggregate functions applied to the columns
func (*SelectQuery) IsExplainQuery ¶
func (self *SelectQuery) IsExplainQuery() bool
func (*SelectQuery) IsNonRecursiveContinuousQuery ¶
func (self *SelectQuery) IsNonRecursiveContinuousQuery() bool
func (*SelectQuery) IsSinglePointQuery ¶
func (self *SelectQuery) IsSinglePointQuery() bool
func (*SelectQuery) IsValidContinuousQuery ¶
func (self *SelectQuery) IsValidContinuousQuery() bool
type TableName ¶
func GetTableName ¶
func GetTableName(name *C.table_name) (*TableName, error)
func GetTableNameArray ¶
func GetTableNameArray(array *C.table_name_array) ([]*TableName, error)
func (*TableName) GetAliasString ¶
type Value ¶
type Value struct { Name string Alias string Type ValueType Elems []*Value IsInsensitive bool // contains filtered or unexported fields }
func GetValueArray ¶
func GetValueArray(array *C.value_array) ([]*Value, error)
func (*Value) IsFunctionCall ¶
type WhereCondition ¶
type WhereCondition struct { Left interface{} Operation string Right *WhereCondition // contains filtered or unexported fields }
func GetWhereCondition ¶
func GetWhereCondition(condition *C.condition) (*WhereCondition, error)
func (*WhereCondition) GetBoolExpression ¶
func (self *WhereCondition) GetBoolExpression() (*Value, bool)
func (*WhereCondition) GetLeftWhereCondition ¶
func (self *WhereCondition) GetLeftWhereCondition() (*WhereCondition, bool)
func (*WhereCondition) GetString ¶
func (self *WhereCondition) GetString() string