mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-12 02:29:03 +08:00
fix: update clauses
Signed-off-by: Shivanshu Raj Shrivastava <shivanshu1333@gmail.com>
This commit is contained in:
parent
e65fcab186
commit
1c8a6e77cc
@ -9,11 +9,15 @@ import (
|
||||
"github.com/SigNoz/signoz/pkg/types/tracefunneltypes"
|
||||
)
|
||||
|
||||
// sanitizeClause adds AND prefix to non-empty clauses
|
||||
// sanitizeClause adds AND prefix to non-empty clauses if not already present
|
||||
func sanitizeClause(clause string) string {
|
||||
if clause == "" {
|
||||
return ""
|
||||
}
|
||||
// Check if clause already starts with AND
|
||||
if strings.HasPrefix(strings.TrimSpace(clause), "AND") {
|
||||
return clause
|
||||
}
|
||||
return "AND " + clause
|
||||
}
|
||||
|
||||
|
@ -153,7 +153,6 @@ func BuildTracesFilter(fs *v3.FilterSet) (string, error) {
|
||||
|
||||
if fs != nil && len(fs.Items) != 0 {
|
||||
for _, item := range fs.Items {
|
||||
|
||||
val := item.Value
|
||||
// generate the key
|
||||
columnName := getColumnName(item.Key)
|
||||
@ -199,9 +198,7 @@ func BuildTracesFilter(fs *v3.FilterSet) (string, error) {
|
||||
}
|
||||
}
|
||||
}
|
||||
queryString := strings.Join(conditions, " AND ")
|
||||
|
||||
return queryString, nil
|
||||
return strings.Join(conditions, " AND "), nil
|
||||
}
|
||||
|
||||
func handleEmptyValuesInGroupBy(groupBy []v3.AttributeKey) (string, error) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user