当前位置: 首页>>代码示例>>Golang>>正文


Golang SelectQuery.GetQueryString方法代码示例

本文整理汇总了Golang中github.com/influxdb/influxdb/parser.SelectQuery.GetQueryString方法的典型用法代码示例。如果您正苦于以下问题:Golang SelectQuery.GetQueryString方法的具体用法?Golang SelectQuery.GetQueryString怎么用?Golang SelectQuery.GetQueryString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在github.com/influxdb/influxdb/parser.SelectQuery的用法示例。


在下文中一共展示了SelectQuery.GetQueryString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: runContinuousQuery

func (s *RaftServer) runContinuousQuery(db string, query *parser.SelectQuery, start time.Time, end time.Time) {
	adminName := s.clusterConfig.GetClusterAdmins()[0]
	clusterAdmin := s.clusterConfig.GetClusterAdmin(adminName)
	intoClause := query.GetIntoClause()
	targetName := intoClause.Target.Name
	queryString := query.GetQueryStringWithTimesAndNoIntoClause(start, end)

	f := func(series *protocol.Series) error {
		return s.coordinator.InterpolateValuesAndCommit(query.GetQueryString(), db, series, targetName, true)
	}

	writer := NewContinuousQueryWriter(f)
	s.coordinator.RunQuery(clusterAdmin, db, queryString, writer)
}
开发者ID:Kenterfie,项目名称:influxdb,代码行数:14,代码来源:raft_server.go

示例2: NewJoinEngine

// Create and return a new JoinEngine given the shards that will be
// processed and the query
func NewJoinEngine(shards []uint32, query *parser.SelectQuery, next Processor) Processor {
	tableNames := query.GetFromClause().Names
	name := query.GetFromClause().GetString()
	log4go.Debug("NewJoinEngine: shards=%v, query=%s, next=%s, tableNames=%v, name=%s",
		shards, query.GetQueryString(), next.Name(), tableNames, name)

	joinEngine := &JoinEngine{
		next:        next,
		name:        name,
		tablesState: make([]joinEngineState, len(tableNames)),
		tableIdx:    make(map[string]int, len(tableNames)),
		query:       query,
		pts:         0,
	}

	for i, tn := range tableNames {
		alias := tn.GetAlias()
		joinEngine.tablesState[i] = joinEngineState{}
		joinEngine.tableIdx[alias] = i
	}

	mergeEngine := NewCommonMergeEngine(shards, false, query.Ascending, joinEngine)
	return mergeEngine
}
开发者ID:ericcapricorn,项目名称:influxdb,代码行数:26,代码来源:join_engine.go


注:本文中的github.com/influxdb/influxdb/parser.SelectQuery.GetQueryString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。