MCPcopy Create free account
hub / github.com/uber/aresdb / blockNumericOpsForColumnOverFourBytes

Function blockNumericOpsForColumnOverFourBytes

query/aql_compiler.go:575–585  ·  view source on GitHub ↗
(token expr.Token, expressions ...expr.Expr)

Source from the content-addressed store, hash-verified

573}
574
575func blockNumericOpsForColumnOverFourBytes(token expr.Token, expressions ...expr.Expr) error {
576 if token == expr.UNARY_MINUS || token == expr.BITWISE_NOT ||
577 (token >= expr.ADD && token <= expr.BITWISE_LEFT_SHIFT) {
578 for _, expression := range expressions {
579 if varRef, isVarRef := expression.(*expr.VarRef); isVarRef && memCom.DataTypeBytes(varRef.DataType) > 4 {
580 return utils.StackError(nil, "numeric operations not supported for column over 4 bytes length, got %s", expression.String())
581 }
582 }
583 }
584 return nil
585}
586
587// Rewrite walks the expresison AST and resolves data types bottom up.
588// In addition it also translates enum strings and rewrites their predicates.

Callers 1

RewriteMethod · 0.70

Calls 2

StackErrorFunction · 0.92
StringMethod · 0.65

Tested by

no test coverage detected