498b235461
Build and test / Build and test AMD64 Ubuntu 22.04 (push) Failing after 0s
Publish Builder / amazonlinux2023 (push) Failing after 1s
Build and test / UT for Go (push) Has been skipped
Publish KRTE Images / KRTE (push) Failing after 1s
Build and test / Integration Test (push) Has been skipped
Build and test / Upload Code Coverage (push) Has been skipped
Publish Builder / rockylinux9 (push) Failing after 1s
Publish Builder / ubuntu22.04 (push) Failing after 0s
Publish Builder / ubuntu24.04 (push) Failing after 0s
Publish Gpu Builder / publish-gpu-builder (push) Failing after 1s
Publish Test Images / PyTest (push) Failing after 0s
Build and test / UT for Cpp (push) Has been cancelled
41 lines
789 B
Go
41 lines
789 B
Go
package tasks
|
|
|
|
import (
|
|
"fmt"
|
|
"strconv"
|
|
"strings"
|
|
|
|
"github.com/milvus-io/milvus/internal/util/function/chain"
|
|
)
|
|
|
|
const groupByColumnPrefix = "$group_by_"
|
|
|
|
func groupByColumnName(fieldID int64) string {
|
|
return fmt.Sprintf("%s%d", groupByColumnPrefix, fieldID)
|
|
}
|
|
|
|
func isGroupByColumnName(name string) bool {
|
|
if !strings.HasPrefix(name, groupByColumnPrefix) {
|
|
return false
|
|
}
|
|
fieldID := strings.TrimPrefix(name, groupByColumnPrefix)
|
|
if fieldID == "" {
|
|
return false
|
|
}
|
|
_, err := strconv.ParseInt(fieldID, 10, 64)
|
|
return err == nil
|
|
}
|
|
|
|
func groupByColumnNames(df *chain.DataFrame) []string {
|
|
if df == nil {
|
|
return nil
|
|
}
|
|
names := make([]string, 0)
|
|
for _, name := range df.ColumnNames() {
|
|
if isGroupByColumnName(name) {
|
|
names = append(names, name)
|
|
}
|
|
}
|
|
return names
|
|
}
|