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

Method processTimezone

query/aql_compiler.go:440–466  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

438}
439
440func (qc *AQLQueryContext) processTimezone() {
441 if timezoneColumn, joinKey, success := parseTimezoneColumnString(qc.Query.Timezone); success {
442 timezoneTable := utils.GetConfig().Query.TimezoneTable.TableName
443 qc.timezoneTable.tableColumn = timezoneColumn
444 for _, join := range qc.Query.Joins {
445 if join.Table == timezoneTable {
446 qc.timezoneTable.tableAlias = join.Alias
447 }
448 }
449 // append timezone table to joins
450 if qc.timezoneTable.tableAlias == "" {
451 qc.timezoneTable.tableAlias = defaultTimezoneTableAlias
452 qc.Query.Joins = append(qc.Query.Joins, common.Join{
453 Table: timezoneTable,
454 Alias: defaultTimezoneTableAlias,
455 Conditions: []string{fmt.Sprintf("%s=%s.id", joinKey, defaultTimezoneTableAlias)},
456 })
457 }
458 } else {
459 loc, err := common.ParseTimezone(qc.Query.Timezone)
460 if err != nil {
461 qc.Error = utils.StackError(err, "timezone Failed to parse: %s", qc.Query.Timezone)
462 return
463 }
464 qc.fixedTimezone = loc
465 }
466}
467
468func (qc *AQLQueryContext) readSchema(tableSchemaReader memCom.TableSchemaReader, shardOwner topology.ShardOwner) {
469 qc.TableScanners = make([]*TableScanner, 1+len(qc.Query.Joins))

Callers 3

CompileMethod · 0.95

Calls 4

GetConfigFunction · 0.92
ParseTimezoneFunction · 0.92
StackErrorFunction · 0.92

Tested by

no test coverage detected