mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-11 22:39:01 +08:00
fix: lagInFrame and leadInFrame nullable (#1089)
https://github.com/ClickHouse/ClickHouse/pull/26521
This commit is contained in:
parent
7cf567792a
commit
6fb6a576aa
@ -2484,7 +2484,7 @@ func (r *ClickHouseReader) GetErrorForId(ctx context.Context, queryParams *model
|
||||
var getErrorWithSpanReponse []model.ErrorWithSpan
|
||||
|
||||
// TODO: Optimize this query further
|
||||
query := fmt.Sprintf("SELECT spanID, traceID, errorID, timestamp, serviceName, exceptionType, exceptionMessage, excepionStacktrace, exceptionEscaped, olderErrorId, newerErrorId FROM (SELECT *, lagInFrame(errorID) over w as olderErrorId, leadInFrame(errorID) over w as newerErrorId FROM %s.%s window w as (ORDER BY exceptionType, serviceName, timestamp rows between unbounded preceding and unbounded following)) WHERE errorID = @errorID", r.traceDB, r.errorTable)
|
||||
query := fmt.Sprintf("SELECT spanID, traceID, errorID, timestamp, serviceName, exceptionType, exceptionMessage, excepionStacktrace, exceptionEscaped, olderErrorId, newerErrorId FROM (SELECT *, lagInFrame(toNullable(errorID)) over w as olderErrorId, leadInFrame(toNullable(errorID)) over w as newerErrorId FROM %s.%s window w as (ORDER BY exceptionType, serviceName, timestamp rows between unbounded preceding and unbounded following)) WHERE errorID = @errorID", r.traceDB, r.errorTable)
|
||||
args := []interface{}{clickhouse.Named("errorID", queryParams.ErrorID)}
|
||||
|
||||
err := r.db.Select(ctx, &getErrorWithSpanReponse, query, args...)
|
||||
|
Loading…
x
Reference in New Issue
Block a user