resolveColumn resolves the VarRef identifier against the schema, and returns the matched tableID (query scoped) and columnID (schema scoped).
(identifier string)
| 550 | // resolveColumn resolves the VarRef identifier against the schema, |
| 551 | // and returns the matched tableID (query scoped) and columnID (schema scoped). |
| 552 | func (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 | |
| 575 | func blockNumericOpsForColumnOverFourBytes(token expr.Token, expressions ...expr.Expr) error { |
| 576 | if token == expr.UNARY_MINUS || token == expr.BITWISE_NOT || |
no test coverage detected