Skip to content

Fix FilterExpressionTextParser for keys starting with the where letters - #6912

Open
harrisleesh wants to merge 1 commit into
spring-projects:mainfrom
harrisleesh:bughunt/filter-parser-where-prefix
Open

Fix FilterExpressionTextParser for keys starting with the where letters#6912
harrisleesh wants to merge 1 commit into
spring-projects:mainfrom
harrisleesh:bughunt/filter-parser-where-prefix

Conversation

@harrisleesh

Copy link
Copy Markdown

Motivation

FilterExpressionTextParser prepends the compulsory WHERE keyword using a plain string prefix check, so an expression whose first key merely starts with the letters where — e.g. whereabouts == 'BG' or where_clause == 'BG' — never gets the keyword prepended and fails with an InputMismatchException.

Changes

  • Only skip prepending when the expression actually starts with the standalone WHERE keyword (^\s*where\b, case-insensitive), not any identifier starting with those letters.
  • Added a regression test covering whereabouts and where_clause keys. It fails on main and passes with the fix; the full spring-ai-vector-store module test suite passes (163 tests).

Fixes #6909

…etters

The compulsory WHERE keyword was only prepended when the expression did
not start with the letters "where", using a plain string prefix check.
A key such as `whereabouts` satisfied that check, so WHERE was never
prepended and parsing failed with an InputMismatchException.

Only skip prepending when the expression starts with the standalone
WHERE keyword.

Fixes spring-projects#6909

Signed-off-by: seonghun lee <harrisleesh@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FilterExpressionTextParser fails to parse expressions whose first key starts with the letters where

2 participants