You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/06/20 15:16:02 UTC

[jira] [Commented] (IGNITE-4926) .NET: Join fails in LINQ when subquery is using Select clause

    [ https://issues.apache.org/jira/browse/IGNITE-4926?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16055920#comment-16055920 ] 

ASF GitHub Bot commented on IGNITE-4926:
----------------------------------------

GitHub user gurustron opened a pull request:

    https://github.com/apache/ignite/pull/2166

    IGNITE-4926: .NET: Join fails in LINQ when subquery is using Select clause

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/gurustron/ignite IGNITE-4926

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/ignite/pull/2166.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #2166
    
----
commit a27b4aa67c074a9a653e1306ed79970d38c273ad
Author: gurustron <gu...@gmail.com>
Date:   2017-06-17T16:59:00Z

    analyze joinclause in VisitQuerySourceReference

commit f517131581bf305108687f32df3927a98a56be31
Author: gurustron <gu...@gmail.com>
Date:   2017-06-20T15:09:53Z

    some fixes

----


> .NET: Join fails in LINQ when subquery is using Select clause
> -------------------------------------------------------------
>
>                 Key: IGNITE-4926
>                 URL: https://issues.apache.org/jira/browse/IGNITE-4926
>             Project: Ignite
>          Issue Type: Bug
>          Components: platforms
>            Reporter: Sergey Stronchinskiy
>            Assignee: Sergey Stronchinskiy
>            Priority: Minor
>              Labels: .NET, LINQ
>             Fix For: 2.1
>
>
> Using {{Join}} with subquery works when subquery does not contain {{Select}} clause:
> {code}
> var persons = GetPersonCache().AsCacheQueryable().Where(x => x.Key >= 0);
> var orgs = GetOrgCache().AsCacheQueryable().Where(x => x.Key > 10);
> var res = persons.Join(orgs,
>                 p => p.Value.OrganizationId,
>                 o => o.Value.Id, (p, o) => p)
>                 .Where(x => x.Key >= 0)
>                 .ToList();
> {code}
> And fails when subquery is using {{Select}}:
> {code}
> var res = persons
>     .Join(
>         orgs.Where(orgEntry => orgEntry.Value.Name == "Org_1")
>             .Select(orgEntry => orgEntry.Key),
>         e => e.Value.OrganizationId,
>         i => i,
>         (e, i) => e)
>     .ToList();
> {code}
> Exception:
> {code}
> Failed to parse SQL query: select _T0._key, _T0._val from "".Person as _T0 inner join (select _T1._key from "".Organization as _T1 where (_T1._key > ?) and (_T1.Name = ?) ) as _T2 on (_T2._key, _T2._val = _T0.OrganizationId) where (_T0._key >= ?)
> Caused by: org.h2.jdbc.JdbcSQLException: Column "_T2._VAL" not found;
> {code}
> This can be reproduced in {{CacheLinqTest.TestSubqueryJoin}} by adding next:
> {code}
> var foo = persons
>     .Join(
>         orgs.Where(orgEntry => orgEntry.Value.Name == "Org_1")
>             .Select(orgEntry => orgEntry.Key),
>         e => e.Value.OrganizationId,
>         i => i,
>         (e, i) => e)
>     .ToArray();
> {code}
> or
> {code}
> var foo = orgs
>     .Where(orgEntry => orgEntry.Value.Name == "Org_1")
>     .Select(orgEntry => orgEntry.Key);
> var bar = persons
>     .Join(foo, e => e.Value.OrganizationId, i => i, (e, i) => e)
>     .ToArray();
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)