[
https://issues.apache.org/jira/browse/IGNITE-8072?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16423967#comment-16423967
]
Taras Ledkov commented on IGNITE-8072:
--------------------------------------
On version 1.9 if you query on replicated cache it is equal to
{{SqlFieldsQuery#setLocal(true)}}
It might produce wrong results in some cases.
But if 1.9 behavior is needed {{SqlFieldsQuery#setLocal(true)}} - is proper
workaround.
> SQL query with multiple JOIN and subquery with UNION produces "Column not
> found" exception
> ------------------------------------------------------------------------------------------
>
> Key: IGNITE-8072
> URL: https://issues.apache.org/jira/browse/IGNITE-8072
> Project: Ignite
> Issue Type: Bug
> Components: sql
> Affects Versions: 2.1, 2.3, 2.4
> Reporter: Pavel Vinokurov
> Priority: Major
>
> Initial script:
> CREATE TABLE Person(id INTEGER PRIMARY KEY, company_id INTEGER);
> CREATE TABLE Company(id INTEGER PRIMARY KEY, name VARCHAR);
> CREATE TABLE Department(id INTEGER PRIMARY KEY, company_id INTEGER);
> Query:
> select * from
> (
> select
> p.id as id,
> p.company_id as company_id
> from person p
> union
> select
> p.id as id,
> p.company_id as company_id
> from person p
> ) p
> left join company c on p.company_id=c.id
> left join department d on p.company_id=d.id
> Result:
> SEVERE: Failed to run map query on local node.
> class org.apache.ignite.IgniteCheckedException: Failed to parse SQL query:
> SELECT
> C__Z3.NAME __C2_0,
> D__Z4.ID __C2_1,
> D__Z4.COMPANY_ID __C2_2,
> C__Z3.ID __C2_3
> FROM PUBLIC.COMPANY C__Z3
> LEFT OUTER JOIN PUBLIC.DEPARTMENT D__Z4
> ON P__Z2.COMPANY_ID = D__Z4.ID
> ORDER BY 4
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)