fix(coordinator): avoid unnecessary copy of FieldDimensions result data (#21390)

pull/21611/head^2
Yun Zhao 2021-06-05 01:09:42 +08:00 committed by GitHub
parent fd9a08862e
commit c22fe2f0d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 10 deletions

View File

@ -130,9 +130,6 @@ func (a *LocalShardMapping) FieldDimensions(ctx context.Context, m *influxql.Mea
return
}
fields = make(map[string]influxql.DataType)
dimensions = make(map[string]struct{})
var measurements []string
if m.Regex != nil {
measurements = sg.MeasurementsByRegex(m.Regex.Val)
@ -144,13 +141,8 @@ func (a *LocalShardMapping) FieldDimensions(ctx context.Context, m *influxql.Mea
if err != nil {
return nil, nil, err
}
for k, typ := range f {
fields[k] = typ
}
for k := range d {
dimensions[k] = struct{}{}
}
return
return f, d, nil
}
func (a *LocalShardMapping) MapType(ctx context.Context, m *influxql.Measurement, field string) influxql.DataType {