[
https://issues.redhat.com/browse/DROOLS-5910?page=com.atlassian.jira.plug...
]
Toshiya Kobayashi commented on DROOLS-5910:
-------------------------------------------
Note: Currently RuleUnitTest.testRuleUnitIdentity() randomly fails if range index is
enabled for JoinNode.
=========
* Why it randomly fails with JoinNode range index
RuleUnitGuardSystem.guardsByActivatingUnit holds HashSet<Guard> per RuleUnit. So
its order is not fixed.
[
https://github.com/kiegroup/drools/blob/master/drools-ruleunit/src/main/j...]
When the guarded RuleUnit is executed, only the first ruleUnit is inserted.
[
https://github.com/kiegroup/drools/blob/master/drools-ruleunit/src/main/j...]
[
https://github.com/kiegroup/drools/blob/master/drools-ruleunit/src/main/j...]
So in case of RuleUnitTest.testRuleUnitIdentity(), If it's AgeCheckUnit(4) is
inserted first, AgeCheckUnit(3) will not be inserted. Thus, "Sofia" will no
longer match in JoinNode.
* Why it constantly succeeds without JoinNode range index
If range index is not enabled for JoinNode, the constraint is evaluated by
MvelConstraint. In this case, "minAge" is resolved by GlobalResolver (not by
inserted AgeCheckUnit fact) so it works expectedly.
========
Enable range index for JoinNode
-------------------------------
Key: DROOLS-5910
URL:
https://issues.redhat.com/browse/DROOLS-5910
Project: Drools
Issue Type: Enhancement
Components: core engine
Affects Versions: 7.47.0.Final
Reporter: Toshiya Kobayashi
Assignee: Toshiya Kobayashi
Priority: Major
Currently, BetaNode range index works only for NotNode and ExistsNode. Inequality
constraints in JoinNode (e.g. $p2 : Person( age > $p1.age )) are not indexed in both
standard-drl and exec-model.
https://github.com/kiegroup/drools/blob/master/drools-core/src/main/java/...
* Enable range index for JoinNode
* Fix issues based on failed tests
** Type coercion
** executable-model specific errors
** maybe more
* Add more tests for join
* Add benchmark to confirm the effect
--
This message was sent by Atlassian Jira
(v8.13.1#813001)