Description
Using Contains with subquery works when subquery is inline:
var res = personsQry.Where(x => orgsQry.Where(o => o.Value.Size < 100000).Select(o => o.Key).Contains(x.Value.OrgId));
And fails when extracted into a variable:
var orgIds = orgsQry.Where(o => o.Value.Size < 100000).Select(o => o.Key); var res = personsQry.Where(x => orgIds.Contains(x.Value.OrgId));
Exception:
Failed to parse query: select _T0._key, _T0._val from "persons-linq".Person as _T0 where (_T0.OrgId IN (select _T1._key, _T1._val from "orgs-linq".Organization as _T1 )) Caused by: org.h2.jdbc.JdbcSQLException: Subquery is not a single column query
This can be reproduced in CacheLinqTest.TestContains by extracting a variable:
var foo = orgCache .Where(orgEntry => orgEntry.Value.Name == "Org_1") .Select(orgEntry => orgEntry.Key);
Attachments
Issue Links
- relates to
-
IGNITE-4425 .NET: Support "ICollection.Contains" in LINQ
- Resolved
- links to