Repository navigation
Description
Description
Adapt BKN structured like / not_like handling and Cypher string-predicate pushdown to Vega's complete SQL LIKE pattern contract from #3018 and #3074.
Vega now treats foo as a complete pattern and %foo% as containment. BKN still validates LIKE inputs as literal substrings and rejects an unescaped %; its Cypher adapter lowers CONTAINS 'foo' to like: "foo" without surrounding wildcards. When paired with the new Vega implementation, containment silently becomes an exact match. BKN local evaluation and Vega pushdown can therefore disagree.
This is the independent BKN follow-up explicitly split from #3018. Its completion is a prerequisite for rolling out the new Vega LIKE contract to BKN consumers; creating this issue does not resolve that compatibility risk.
Steps to reproduce
- Bind an existing Table string field to a BKN object property, with values
foo,prefixfoo,foosuffix, andprefixfoosuffix. - Use Vega with the SQL LIKE behavior in feat(vega): add connector-aware field filterability #3074 and the current BKN adapter.
- Execute a Cypher predicate such as
MATCH (n:Person) WHERE n.name CONTAINS 'foo' RETURN nwith Vega filter pushdown enabled. - Inspect the outgoing condition: it is
likewith valuefoo. Vega matches only the complete value instead of all four values. - Submit a BKN structured LIKE condition with
%foo%; the old BKN literal-substring validator rejects the wildcard before it reaches Vega.
Expected behavior
- BKN structured
like/not_likeshare Vega's complete SQL LIKE contract:%matches any string,_matches one character, backslash escapes the following character, and an incomplete trailing escape is rejected.foois not automatically wrapped as%foo%. - Cypher
CONTAINSretains literal-substring semantics, including literal%,_, backslash, quotes, and Unicode. Lowering it must produce an equivalent Vega condition rather than forwarding the literal as a complete LIKE pattern. The implementation may use correctly escaped SQL LIKE patterns or an equivalent supported operator without changing the public Cypher meaning. - Pushdown and local execution agree, including negation and NULL/missing-value behavior.
Actual behavior
adp/bkn/bkn-backend/server/common/condition/condition_like.gostill implements the old literal-substring contract and rejects bare%.adp/bkn/bkn-backend/server/logics/cypher/filter_dsl.golowersCONTAINStolike, and its escaper neither adds containment wildcards nor handles underscore as a LIKE metacharacter.- Upgrading Vega alone can silently narrow BKN query results.
Environment
- OS: platform-independent backend query translation.
- Browser: not applicable.
- Version: Vega behavior in Foundry PR feat(vega): add connector-aware field filterability #3074, reviewed at commit
4a1a52113a609bfa379432e73ae53ecb1f7eaf82; BKN consumer code in that same tree. This report is based on code-path verification, not live-service acceptance.
Acceptance Criteria (Definition of Done)
- Audit BKN object-query validation, local SQL/DSL evaluation, Vega forwarding, and Cypher lowering so structured LIKE uses one complete-pattern contract.
-
foo,%foo%,foo%,%foo,_, escaped%/_/ backslash, empty text, Unicode, and dangling-escape cases have focused regression coverage. - Cypher
CONTAINSand its negation preserve literal meaning and agree between pushed and local execution, including values containing LIKE or regex metacharacters and NULL/missing values. - Existing
STARTS WITH,ENDS WITH, regex, and unrelated predicates retain their intended behavior; no condition is silently dropped. - Tests verify the actual generated Vega condition and exercise the paired Vega SQL LIKE conversion, with source and managed-index routes covered where supported.
- Document the behavior of existing saved LIKE conditions and caller inputs, the required BKN/Vega version pairing, and coordinated rollout guidance. Do not silently rewrite persisted conditions.
- Relevant BKN and Vega checks and remote CI pass, with real-service acceptance recorded separately.
Boundaries / Risk
- Keep Vega's SQL LIKE contract; do not restore literal-substring semantics or add legacy/trusted execution flags to Vega.
- This issue owns BKN adaptation. Vega field filterability, IP activation, new query operators, and unrelated Cypher optimizations are outside scope.
- No deployment or production-data rewrite is authorized by this issue. Any proposed migration must describe affected data and rollback and obtain the existing required approval.
- Complete this follow-up before a coordinated release enables the new Vega behavior for BKN callers.
Additional context
- Parent capability: feat(vega): add editable field filterability with type-aware defaults #3018.
- Companion implementation: feat(vega): add connector-aware field filterability #3074.
- Review finding:
9513023ein feat(vega): add connector-aware field filterability #3074 (review). - Confirmed scope split and LIKE contract: https://github.com/openbkn-ai/bkn-docs/blob/main/docs/foundry/vega/testing/issue-3018-field-filterability-validation.md#like-算子语义修正.
Activity
rongwei-liu commentedon Nov 12, 2026
Development tracking
fix/3079-bkn-likeThe implementation and local tests are complete. The rollout still requires reviewing saved bare
likepatterns and deploying compatible BKN, Vega, and Studio versions together. No test environment was modified.