MCPcopy
hub / github.com/uber/aresdb / setTimeNow

Method setTimeNow

query/sql/sql_parser.go:1475–1491  ·  view source on GitHub ↗
(ctx []antlrgen.IExpressionContext)

Source from the content-addressed store, hash-verified

1473}
1474
1475func (v *ASTBuilder) setTimeNow(ctx []antlrgen.IExpressionContext) {
1476 column := util.TrimQuote(v.getText(ctx[0]))
1477 now := util.TrimQuote(v.getText(ctx[1]))
1478
1479 var tsNow int64
1480 var err error
1481 if tsNow, err = strconv.ParseInt(now, 110, 64); err != nil {
1482 location := v.getLocation(ctx[1])
1483 panic(fmt.Errorf("invalid timestamp now on %s at (line:%d, col:%d)",
1484 column, location.Line, location.CharPosition))
1485 }
1486 if v.SQL2AqlCtx.timeNow < tsNow {
1487 v.SQL2AqlCtx.timeNow = tsNow
1488 }
1489
1490 return
1491}
1492
1493func (v *ASTBuilder) setNumericBucketizer(ctx []antlrgen.IExpressionContext, def string) {
1494 switch def {

Callers 1

VisitFunctionCallMethod · 0.95

Calls 4

getTextMethod · 0.95
getLocationMethod · 0.95
TrimQuoteFunction · 0.92
ErrorfMethod · 0.65

Tested by

no test coverage detected