Please do a quick search on GitHub issues first, there might be already a duplicate issue for the one you are about to create. If the bug is trivial, just go ahead and create the issue. Otherwise, please take a few moments and fill in the following sections:
Bug description
Environment Spring-ai 1.0.0
Steps to reproduce @Test public void testEQ() { // country == "BG" Expression exp2 = this.parser.parse("biz_id == 3L"); assertThat(exp2).isEqualTo(new Expression(EQ, new Key("biz_id"), new Value(3L)));
}
Expected behavior Support long type parsing
Minimal Complete Reproducible example @Test public void testEQ() { // country == "BG"
Expression exp2 = this.parser.parse("biz_id == 3L");
assertThat(exp2).isEqualTo(new Expression(EQ, new Key("biz_id"), new Value(3L)));
}
Temporary solution I am not familiar with antlr4, and the temporary solution is as follows:
org.springframework.ai.vectorstore.filter.FilterExpressionTextParser.FilterExpressionVisitor#visitIntegerConstant
public Filter.Operand visitIntegerConstant(FiltersParser.IntegerConstantContext ctx) {
long value = Long.parseLong(ctx.getText());
if (value > Integer.MAX_VALUE || value < Integer.MIN_VALUE) {
return new Filter.Value(value);
}
return new Filter.Value((int)value);
}
Comment From: sunyuhan1998
Hi @mucheng2035 thanks for the report, it's true that it doesn't have specific support for the Long type right now, I've submitted a PR to support it: https://github.com/spring-projects/spring-ai/pull/3516
Comment From: mucheng2035
@sunyuhan1998 thanks