mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-31 15:06:26 +00:00
wip
This commit is contained in:
parent
d9fdbf907c
commit
6339cae5de
2 changed files with 4 additions and 4 deletions
|
@ -145,7 +145,7 @@ func (fpp *fieldsPipeProcessor) writeBlock(workerID uint, timestamps []int64, co
|
||||||
brs := getBlockRows()
|
brs := getBlockRows()
|
||||||
cs := brs.cs
|
cs := brs.cs
|
||||||
for _, f := range fpp.fp.fields {
|
for _, f := range fpp.fp.fields {
|
||||||
values := getValuesForBlockColumn(columns, f, len(timestamps))
|
values := getBlockColumnValues(columns, f, len(timestamps))
|
||||||
cs = append(cs, BlockColumn{
|
cs = append(cs, BlockColumn{
|
||||||
Name: f,
|
Name: f,
|
||||||
Values: values,
|
Values: values,
|
||||||
|
@ -352,7 +352,7 @@ func (spp *statsPipeProcessor) writeBlock(workerID uint, timestamps []int64, col
|
||||||
}
|
}
|
||||||
if len(byFields) == 1 {
|
if len(byFields) == 1 {
|
||||||
// Special case for grouping by a single column.
|
// Special case for grouping by a single column.
|
||||||
values := getValuesForBlockColumn(columns, byFields[0], len(timestamps))
|
values := getBlockColumnValues(columns, byFields[0], len(timestamps))
|
||||||
if isConstValue(values) {
|
if isConstValue(values) {
|
||||||
// Fast path for column with constant value.
|
// Fast path for column with constant value.
|
||||||
shard.keyBuf = encoding.MarshalBytes(shard.keyBuf[:0], bytesutil.ToUnsafeBytes(values[0]))
|
shard.keyBuf = encoding.MarshalBytes(shard.keyBuf[:0], bytesutil.ToUnsafeBytes(values[0]))
|
||||||
|
@ -830,7 +830,7 @@ func getFieldsIgnoreStar(fields []string) []string {
|
||||||
|
|
||||||
func appendBlockColumnValues(dst [][]string, columns []BlockColumn, fields []string, rowsCount int) [][]string {
|
func appendBlockColumnValues(dst [][]string, columns []BlockColumn, fields []string, rowsCount int) [][]string {
|
||||||
for _, f := range fields {
|
for _, f := range fields {
|
||||||
values := getValuesForBlockColumn(columns, f, rowsCount)
|
values := getBlockColumnValues(columns, f, rowsCount)
|
||||||
dst = append(dst, values)
|
dst = append(dst, values)
|
||||||
}
|
}
|
||||||
return dst
|
return dst
|
||||||
|
|
|
@ -171,7 +171,7 @@ func getBlockColumnIndex(columns []BlockColumn, columnName string) int {
|
||||||
return -1
|
return -1
|
||||||
}
|
}
|
||||||
|
|
||||||
func getValuesForBlockColumn(columns []BlockColumn, columnName string, rowsCount int) []string {
|
func getBlockColumnValues(columns []BlockColumn, columnName string, rowsCount int) []string {
|
||||||
for _, c := range columns {
|
for _, c := range columns {
|
||||||
if c.Name == columnName {
|
if c.Name == columnName {
|
||||||
return c.Values
|
return c.Values
|
||||||
|
|
Loading…
Reference in a new issue