-
[OPIK-7499] [BE] fix: build parseable JSONPaths for dictionary filter keys (#7626)
发布于
2026-07-28 07:57:27 +00:00 | -1619 次提交 在此版本后已推送到 1.10.43/hotfixFiltering a dictionary field on a key containing characters outside
[A-Za-z0-9_] built an invalid ClickHouse JSONPath. ClickHouse parses that
argument while analysing the query, so the statement aborted with
BAD_ARGUMENTS rather than returning no rows, surfacing as a 500.
JSON_VALUE requires the path to be a constant, so it has to be correct by
construction.Such a key is now quoted segment by segment into bracket notation, which
can express any character and therefore always parses. A key whose every
segment is expressible in dot notation still produces the exact path it
produced before, and an expression the caller authored is passed through
untouched so that shapes such as wildcard indices keep working.Brackets only count as path syntax when their content is an index, a
wildcard or a quoted key, so a literal key like feature[beta] is quoted
rather than handed over as a subscript. A leading dollar only roots an
expression when what follows continues the path, so ordinary keys such as
$schema and $ref are quoted instead of aborting the query.An authored expression too damaged to parse under any grammar is quoted
into a literal key no document carries, so the query runs and matches
nothing instead of aborting.Construction cannot cover an authored expression that survives it but the
server still refuses, so the recovery introduced for dataset items in
OPIK-264 now guards the span and trace reads too. Its two copies are
replaced by a single ErrorUtils.handleMalformedJsonPath used by all four
DAOs, keeping the endpoints from returning 500 for any filter key.Co-authored-by: Claude Opus 5 (1M context) noreply@anthropic.com
下载附件