本文整理汇总了Golang中parser.SelectQuery.GetIntoClause方法的典型用法代码示例。如果您正苦于以下问题:Golang SelectQuery.GetIntoClause方法的具体用法?Golang SelectQuery.GetIntoClause怎么用?Golang SelectQuery.GetIntoClause使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类parser.SelectQuery
的用法示例。
在下文中一共展示了SelectQuery.GetIntoClause方法的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.GetQueryStringForContinuousQuery(start, end)
f := func(series *protocol.Series) error {
return s.coordinator.InterpolateValuesAndCommit(db, series, targetName, true)
}
writer := NewContinuousQueryWriter(f)
s.coordinator.RunQuery(clusterAdmin, db, queryString, writer)
}
示例2: runContinuousQuery
func (s *RaftServer) runContinuousQuery(db string, query *parser.SelectQuery, start time.Time, end time.Time) {
clusterAdmin := s.clusterConfig.clusterAdmins["root"]
intoClause := query.GetIntoClause()
targetName := intoClause.Target.Name
sequenceNumber := uint64(1)
queryString := query.GetQueryStringForContinuousQuery(start, end)
s.engine.RunQuery(clusterAdmin, db, queryString, false, func(series *protocol.Series) error {
interpolatedTargetName := strings.Replace(targetName, ":series_name", *series.Name, -1)
series.Name = &interpolatedTargetName
for _, point := range series.Points {
point.SequenceNumber = &sequenceNumber
}
return s.coordinator.WriteSeriesData(clusterAdmin, db, series)
})
}