Skip to content
This repository was archived by the owner on Nov 7, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions platform/model/metrics_aggregations/quantile.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@ func (query Quantile) processResult(colName string, percentileReturnedByClickhou
percentileIsNanOrInvalid = math.IsNaN(percentileTyped[0])
percentile = percentileTyped[0]
}
case float64:
// The data read out in apache doris is float64
percentileAsArrayLen = 1
percentileIsNanOrInvalid = math.IsNaN(percentileTyped)
percentile = percentileTyped
case []time.Time:
percentileAsArrayLen = len(percentileTyped)
if len(percentileTyped) > 0 {
Expand Down
3 changes: 2 additions & 1 deletion platform/model/metrics_aggregations/quantile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ func Test_processResult(t *testing.T) {
{"", math.NaN(), nil},
{"0", math.NaN(), nil},
{0, math.NaN(), nil},
{0.0, math.NaN(), nil},
{0.0, 0, nil},
{float64(1.0), 1.0, nil},
{[]string{"1.0"}, math.NaN(), nil},
{[]string{"1.0", "5"}, math.NaN(), nil},
{[]any{"1.0", "5"}, math.NaN(), nil},
Expand Down
2 changes: 2 additions & 0 deletions platform/model/typical_queries/hits.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,8 @@ func (query Hits) addAndHighlightHit(hit *model.SearchHit, resultRow *model.Quer
if valueAsString != nil {
hit.Highlight[columnName] = query.highlighter.HighlightValue(fieldName, *valueAsString)
}
case int64:
hit.Highlight[columnName] = query.highlighter.HighlightValue(fieldName, strconv.FormatInt(valueAsString, 10))
case []string:
for _, v := range valueAsString {
hit.Highlight[columnName] = append(hit.Highlight[columnName], query.highlighter.HighlightValue(fieldName, v)...)
Expand Down
13 changes: 10 additions & 3 deletions platform/parsers/elastic_query_dsl/aggregation_parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,10 +282,17 @@ func (cw *ClickhouseQueryTranslator) parseFieldField(shouldBeMap any, aggregatio

func (cw *ClickhouseQueryTranslator) parseIntField(queryMap QueryMap, fieldName string, defaultValue int) int {
if valueRaw, exists := queryMap[fieldName]; exists {
if asFloat, ok := valueRaw.(float64); ok {
return int(asFloat)
switch v := valueRaw.(type) {
case float64:
return int(v)
case string:
if intValue, err := strconv.Atoi(v); err == nil {
return intValue
}
logger.WarnWithCtx(cw.Ctx).Msgf("%s is a string but cannot be converted to int, value: %v. Using default: %d", fieldName, v, defaultValue)
default:
logger.WarnWithCtx(cw.Ctx).Msgf("%s is not an float64 or string, but %T, value: %v. Using default: %d", fieldName, valueRaw, valueRaw, defaultValue)
}
logger.WarnWithCtx(cw.Ctx).Msgf("%s is not an float64, but %T, value: %v. Using default: %d", fieldName, valueRaw, valueRaw, defaultValue)
}
return defaultValue
}
Expand Down
Loading