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

Method resolveColumn

query/aql_compiler.go:552–573  ·  view source on GitHub ↗

resolveColumn resolves the VarRef identifier against the schema, and returns the matched tableID (query scoped) and columnID (schema scoped).

(identifier string)

Source from the content-addressed store, hash-verified

550// resolveColumn resolves the VarRef identifier against the schema,
551// and returns the matched tableID (query scoped) and columnID (schema scoped).
552func (qc *AQLQueryContext) resolveColumn(identifier string) (int, int, error) {
553 tableAlias := qc.Query.Table
554 column := identifier
555 segments := strings.SplitN(identifier, ".", 2)
556 if len(segments) == 2 {
557 tableAlias = segments[0]
558 column = segments[1]
559 }
560
561 tableID, exists := qc.TableIDByAlias[tableAlias]
562 if !exists {
563 return 0, 0, utils.StackError(nil, "unknown table alias %s", tableAlias)
564 }
565
566 columnID, exists := qc.TableScanners[tableID].Schema.ColumnIDs[column]
567 if !exists {
568 return 0, 0, utils.StackError(nil, "unknown column %s for table alias %s",
569 column, tableAlias)
570 }
571
572 return tableID, columnID, nil
573}
574
575func blockNumericOpsForColumnOverFourBytes(token expr.Token, expressions ...expr.Expr) error {
576 if token == expr.UNARY_MINUS || token == expr.BITWISE_NOT ||

Callers 2

RewriteMethod · 0.95

Calls 1

StackErrorFunction · 0.92

Tested by

no test coverage detected