Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
trzysiek committed Jan 19, 2025
1 parent 7484086 commit 9199b88
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion quesma/queryparser/aggregation_parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ func (cw *ClickhouseQueryTranslator) parseFieldFromScriptField(queryMap QueryMap
return model.NewFunction("toHour", model.NewColumnRef(matches[1])), true
}

// b) TODO (if more such expressions will be needed, not only "a==b") - use painless parser
// b) source: "if (doc['field_name_1'].value == doc['field_name_2'].value") { return 1; } else { return 0; }"
wantedRegex = regexp.MustCompile(`^if \(doc\['(.*)\.value']\.value == doc\['(.*)\.value'].value\) \{ \n return 1; \n} else \{ \n return 0; \n}$`)
matches = wantedRegex.FindStringSubmatch(source)
if len(matches) == 3 {
Expand Down

0 comments on commit 9199b88

Please sign in to comment.