-
Notifications
You must be signed in to change notification settings - Fork 113
Open
Description
Conditions or actions containing multiple statements fail to evaluate, even though MVEL supports multiple statements.
For example:
a = new String("asdf"); "asdf".equals(a)
or including functions
def isNullOrEmpty(s) { s == null || s.isEmpty() }
isNullOrEmpty(a) && isNullOrEmpty(b)
The above conditions fail during evaluation because MVELRoutingRule uses an immutable map.
java.lang.UnsupportedOperationException
at com.google.common.collect.ImmutableMap.put(ImmutableMap.java:813)
at org.mvel2.integration.impl.CachingMapVariableResolverFactory.externalize(CachingMapVariableResolverFactory.java:101)
at org.mvel2.MVEL.executeExpression(MVEL.java:988)
at io.trino.gateway.ha.router.MVELRoutingRule.evaluateCondition(MVELRoutingRule.java:116)
at io.trino.gateway.ha.router.FileBasedRoutingGroupSelector.lambda$findRoutingDestination$1(FileBasedRoutingGroupSelector.java:83)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1597)
at io.trino.gateway.ha.router.FileBasedRoutingGroupSelector.findRoutingDestination(FileBasedRoutingGroupSelector.java:82)
at io.trino.gateway.ha.router.TestRoutingGroupSelector.testTrinoQueryPropertiesNoRouting(TestRoutingGroupSelector.java:168)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1597)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1597)
Metadata
Metadata
Assignees
Labels
No labels