NullPointerException compiling a GROUP that reaches one query through joins built under different statistics
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
Direzione di ricerca
Start by tracing GroupExpr.getInnerJoin and how group joins are matched and compiled into subqueries; the issue identifies GroupSelect.getSQLQuery and CompiledQuery$InnerSelect$QuerySelect.getSQLQuery in the failure path. Reproduce the empty select with group joins built under different statistics, then confirm those joins compile to one subquery and the query succeeds.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Description
In one compiled query the same GROUP can come through two group joins that differ only in the joins GroupExpr.getInnerJoin builds from the current statistics. This happens, for example, when changes in the session alter the statistics between the moments two instances of the same GROUP expression get their join. One of them is an inner join of the query and the expression goes through the other. They are not matched, so the select made for the inner join gets no expressions, compiles to an empty select with untyped keys and fails:
active (Item i, Store s, DATE d) = GROUP LAST Rule r ORDER group(r), r
WHERE dateFrom(group(r)) <= d AND in(group(r), s) AND in(r, i);
active (Batch b, Shop sh, DATE d) = active(item(b), store(sh), d);
price (Batch b, Shop sh) += value(active(b, sh, currentDate())) IF active(b, sh, currentDate());
// in a session where dateFrom(Group) was changed (no APPLY), EXPORT of a form filtered by price:
// 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 Property.readChangeTable
Seen on 6.3 with a real database. Whether it fails depends on the change made in the session and differs from one server restart to another. The same stack is reported in #1958.
Reason
A query that reads correct data fails with an internal error, depending on the statistics, which the developer neither controls nor sees.
Fix
Group joins that differ only in the statistics-built joins compile to one subquery.
- Lingua principale
- Java
- Stelle
- 214
- Fork
- 46
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di lsfusion/platform
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
-
bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
-
bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 62/100
Tutte le issue di lsfusion/platform
Issue simili
-
account assessment course feature lecture
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
I maintainer di solito rispondono entro 1 giorno
-
app:learninggoalhub enhancement good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 86/100
I maintainer di solito rispondono entro 1 giorno
-
PropertyResolver fails on JDK classes with a non-public field named like the propertyForse già presa @vaibhavgupta443 l’ha presa oggi. Apertagood first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
apache/wicket#1991 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100