fdb-record-layer icon indicating copy to clipboard operation
fdb-record-layer copied to clipboard

For each quantifiers with null on empty only work as input to SelectExpressions

Open alecgrieser opened this issue 5 months ago • 0 comments

There's currently a limitation on for each quantifiers with null-on-empty, which is that they are only implemented when they sit below a select expression. If a quantifier is directly placed somewhere, then we can end up dropping the null-on-empty behavior, as demonstrated in this test:

https://github.com/FoundationDB/fdb-record-layer/blob/29cfcd0c8de0ebbd0b4be339fe169d1c1e0dcd44/fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/provider/foundationdb/query/FDBSimpleQueryGraphTest.java#L220-L250

Note the "bug" mentioned here where the null-on-emptiness is dropped. This gets worse with #3426, where we now get type errors as we try and mix nullable and non-nullable types in the same reference, a direct consequence of the the non-handling of this quantifier type in graphs like this.

There are probably two work items here. The first is to ban these kinds of expressions in query graphs. The second is to make it so that we can handle them correctly.

alecgrieser avatar Jun 25 '25 13:06 alecgrieser