Skip to content
This repository was archived by the owner on Nov 7, 2025. It is now read-only.

Commit a8a2996

Browse files
committed
remove debug
1 parent 5481085 commit a8a2996

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

platform/parsers/elastic_query_dsl/query_parser.go

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,6 @@ func (cw *ClickhouseQueryTranslator) parseConstantScore(queryMap QueryMap) model
319319

320320
func (cw *ClickhouseQueryTranslator) parseIds(queryMap QueryMap) model.SimpleQuery {
321321
idsRaw, err := cw.parseArrayField(queryMap, "values")
322-
logger.InfoWithCtx(cw.Ctx).Msgf("KK parse ids: %v", idsRaw)
323322
if err != nil {
324323
logger.ErrorWithCtx(cw.Ctx).Msgf("parsing error: %v", err)
325324
return model.NewSimpleQueryInvalid()
@@ -338,28 +337,23 @@ func (cw *ClickhouseQueryTranslator) parseIds(queryMap QueryMap) model.SimpleQue
338337
// when our generated ID appears in query looks like this:
339338
// `<hex-encoded timestamp>qqq<hex-encoded source hash>`
340339
// Therefore we need to convert the hex-encoded timestamp to assemble the SQL query
341-
fmt.Println("KK ids:", ids)
342340
for i, id := range ids {
343341
idInHex := strings.Split(id, uuidSeparator)[0]
344342
if idAsStr, err := hex.DecodeString(idInHex); err != nil {
345343
logger.ErrorWithCtx(cw.Ctx).Msgf("error parsing document id %s: %v", id, err)
346344
return model.NewSimpleQueryInvalid()
347345
} else {
348-
fmt.Println("KK idAsStr", string(idAsStr))
349346
// Before:
350-
tsWithoutTZ := strings.TrimSuffix(string(idAsStr), " +0000 UTC")
347+
// tsWithoutTZ := strings.TrimSuffix(string(idAsStr), " +0000 UTC")
348+
// ids[i] = fmt.Sprintf("'%s'", tsWithoutTZ)
351349
//
352350
// Now we stop trimming, instead parse the date ourselves, and then output in UTC.
353-
fmt.Println("KK idAsStrTrimmed", tsWithoutTZ)
354-
ids[i] = fmt.Sprintf("'%s'", tsWithoutTZ)
355-
356351
dm := NewDateManager(cw.Ctx)
357352

358353
if tsAsTime, ok := dm.parseStrictDateOptionalTimeOrEpochMillis(string(idAsStr)); ok {
359354
tsUTC := tsAsTime.UTC()
360355
tsGoodFormat := tsUTC.Format("2006-01-02 15:04:05.000000000")
361356
tsTrimmedNano := strings.TrimRight(tsGoodFormat, "0")
362-
fmt.Println("NEW PARSER:", tsUTC, ok, "tsGoodFormat", tsGoodFormat, "trimmed", tsTrimmedNano)
363357
ids[i] = fmt.Sprintf("'%s'", tsTrimmedNano)
364358
} else {
365359
logger.ErrorWithCtx(cw.Ctx).Msgf("error parsing document id %s:, idAsStr: %v", id, idAsStr)
@@ -410,7 +404,6 @@ func (cw *ClickhouseQueryTranslator) parseIds(queryMap QueryMap) model.SimpleQue
410404
logger.ErrorWithCtx(cw.Ctx).Msgf("error converting id to sql: %v", err)
411405
return model.NewSimpleQueryInvalid()
412406
}
413-
fmt.Println("KKKK", sql, model.AsString(sql))
414407
whereStmt = model.NewInfixExpr(model.NewColumnRef(timestampColumnName), " = ", sql)
415408
default:
416409
idsAsExprs := make([]model.Expr, len(ids))

0 commit comments

Comments
 (0)