-
Notifications
You must be signed in to change notification settings - Fork 38.5k
SpelCompiler is unable to compile too often #23963
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Yeah, it is optimizing itself based on the shape of data it sees. I feel like there is a bug to investigate here but I am thinking about ways to workaround that for now. You could:
If you shared a bit more on the object types being evaluated against, I might be able to come up with other options. |
If you cannot register a custom function, you can always invoke a static method from one of your classes or a method on a bean in the |
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed. |
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue. |
I need to allow allow a user to build an expression that will be used to evaluate a boolean result against millions of records per second, so I need to ensure the expression is compiled. There is an apparent problem with the way the spring expression framework attempts to compile the expression.
Let's say I have this expression:
productType == 'Firewall' and categoryId == 400
The issue is: If the first 100 records that are sent through this expression never contain
productType="Firewall"
, thencategoryId
is never evaluated by the parser due to short-circuiting of the boolean "and" operator. Deep in the code, inPropertyOrFieldReference
,this.cachedReadAccessor
is always null for thecategoryId
field. Because of this, the spring expression parser will never be able to compile this expression.Does anyone have any recommendations for me?
I'd like to use this framework for this use case, but I need to ensure these expressions are compiled.
The text was updated successfully, but these errors were encountered: