TOO LONG QUERY error should name the materialized property whose update produced the query
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
Research direction
Start by tracing where SQLTooLongQueryException is created and how the apply execution stack identifies the property being written or materialized. Use the reported materialized-property updates, such as ProbeMat.totalSpan[] and ProbeMat.span[Catalog.Category], to follow the relevant execution path. Done when the error message names the property whose stored values the failing query updates; including expanded non-materialized properties is an additional goal.
Written by the indexing model from the issue text.
Description
Description
When the text of a query exceeds queryLengthLimit, the apply fails with
SQLTooLongQueryException TOO LONG QUERY ROWS, LENGTH : 3597686, QUERY : INSERT INTO lsfpool.n0_t_44 (k0,p00) SELECT ... CASE WHEN (... = 2 AND ... = 0 AND ...
The message carries only the length and the first characters of the SQL. When the query is the incremental update of a materialized property that reads non-materialized properties — for example a GROUP MIN ... BY key(x) MATERIALIZED whose grouping key key is a multi-branch OVERRIDE over properties of another aggregate — the definitions of those properties are expanded into the update query, so its length does not depend on the number of changed rows: a write of a few objects fails exactly like a write of thousands, and the developer has to work out from the generated SQL which property's definition made the query long.
key (Event e) = OVERRIDE kind1(e), kind2(e), kind3(e); // not materialized, several branches
head (STRING[10] k) = GROUP MIN date(Event e) BY key(e) MATERIALIZED; // its update expands key(e) into the query
// a write of 100 new events: TOO LONG QUERY ROWS, LENGTH : 3597686, QUERY : INSERT INTO lsfpool...
// expected: the error names head[STRING[10]] as the property being updated (and, ideally, key[Event] as the expanded one)
The same happens with a materialized sum over a non-materialized condition that contains a multi-branch selection switched by a data property changed in the same session: the module loads and a dry run passes, and the first apply that changes the switch fails with the same message. The server log already has what the message lacks: the execution stack printed under the error lists the apply steps with the properties, for example
Applying changes: 351 of 827
Writing materialized property changes : ProbeMat.oldIn[Catalog.Category,INTEGER] 'Old in' [ProbeMat(8:9)]
Materializing property changes : ProbeMat.totalSpan[] 'Total span' [ProbeMat(19:16)]
Materializing property changes : ProbeMat.span[Catalog.Category] 'Span' [ProbeMat(16:21)]
but through the HTTP API and in the client only the message arrives.
Fix
Add to the error the materialized property whose stored values the failing query updates — at least the property that is being updated, ideally also the non-materialized properties whose definitions were expanded into the query. The apply step from the execution stack (the property being written or materialized) is the minimum.
Reason
The failure broke a scheduled writer, and finding the property to materialize required reasoning about the dependency chain by hand, because the error names none; in the second case the time went into locating the materialized property and its dependency from the SQL prefix, while the server log had the names all along.
- 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 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 45/100
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 30/100
-
Difficulty 3/5 1-2 days Newbie friendliness 62/100
All issues in lsfusion/platform
Similar issues
-
account assessment course feature lecture
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
app:learninggoalhub enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 86/100
Maintainers usually reply within 1 day
-
PropertyResolver fails on JDK classes with a non-public field named like the propertyPossibly taken @vaibhavgupta443 claimed this today. Opengood first issue
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
apache/wicket#1991 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100