NullPointerException while compiling the incremental update of a materialized property with a nested negated GROUP
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 42/100
Research direction
Start in the stored event query compilation path named in the stack trace: CompiledQuery$InnerSelect$QuerySelect.getSQLQuery, getEmptySelect, pushWhere, and GroupSelect.getSQLQuery, reached from DataSession.executeStoredEvent. Reproduce the materialized-property update using the described nested GROUP under NOT and inspect how the outer parameter is handled. Done means the incremental update compiles and any update error names the stored property.
Written by the indexing model from the issue text.
Description
Description
A MATERIALIZED property whose expression contains a nested GROUP under NOT, with an outer parameter used only inside the negated part, can fail on APPLY of unrelated changes with an internal error from the query compiler instead of updating the stored value:
// shape reported on 6.2; the object B picked per A depends on counts that use a doubly negated nested group
unchecked(A a, B b) = NOT (GROUP SUM 1 IF p(X x, C c) AND NOT q(b, lookup(c)));
last(A a) = GROUP LAST B b ORDER b WHERE cnt1(a, b) = cnt2(a, b) MATERIALIZED; // cnt2 uses unchecked(a, b)
// APPLY of changes to p / q with existing objects:
// java.lang.NullPointerException: Cannot invoke "lsfusion.server.data.type.Type.getCast(String, SQLSyntax, TypeEnvironment)" because "value" is null
// at CompiledQuery$InnerSelect$QuerySelect.getSQLQuery <- getEmptySelect <- pushWhere <- GroupSelect.getSQLQuery, in DataSession.executeStoredEvent
Reported on 6.2; the code path is the same on master. The error names no property, so the declaration responsible has to be found by bisecting the module. Rewriting the double negation as a comparison of two counts ((OVERRIDE (GROUP SUM 1 IF cond AND checked), 0) = (OVERRIDE (GROUP SUM 1 IF cond), 0)) avoids it.
Reason
A stored property stops updating with an internal error that gives no hint of the cause; the shape ("no unchecked element") is a natural way to write such a condition.
Fix
The incremental update compiles, and an error raised while updating a stored property names that property.
- Dominant language
- Java
- Stars
- 214
- Forks
- 46
- PR merge metrics
- No merged PRs in 30d
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from lsfusion/platform
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
-
Open a form with a TSQUERY propertyPossibly taken @ichavchavadze claimed this today. Open
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 76/100
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 35/100
All issues in lsfusion/platform
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
googleads/googleads-mobile-flutter#1541 ·
Maintainers usually reply within 4 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
Julow/Unexpected-Keyboard#1490 ·
Maintainers usually reply within 4 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
Vakore/ZappierGames#275 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
unitycatalog/unitycatalog#2148 ·
Maintainers usually reply within 2 days
-
enhancement priority: low
Difficulty 1/5 Under an hour Newbie friendliness 92/100
Riptide-Labs/riptide#1060 ·
Maintainers usually reply within 1 day