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 2018/03/14 13:13:00 UTC

[jira] [Commented] (IGNITE-7879) SQL query with group by and distinct in subquery produces JdbcSQLException

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

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

GitHub user tledkov-gridgain opened a pull request:

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

    IGNITE-7879: Don't push down expressions with aggregate function

    

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

    $ git pull https://github.com/gridgain/apache-ignite ignite-7879

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

    https://github.com/apache/ignite/pull/3634.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 #3634
    
----
commit 7b5a3423886fe0de68362fce679d7bc32f0c78f6
Author: tledkov-gridgain <tl...@...>
Date:   2018-03-07T13:35:21Z

    IGNITE-7879: Don't push down expressions with aggregate function

----


> SQL query with group by and distinct in subquery produces JdbcSQLException
> --------------------------------------------------------------------------
>
>                 Key: IGNITE-7879
>                 URL: https://issues.apache.org/jira/browse/IGNITE-7879
>             Project: Ignite
>          Issue Type: Bug
>          Components: sql
>    Affects Versions: 2.1, 2.3
>            Reporter: Pavel Vinokurov
>            Assignee: Taras Ledkov
>            Priority: Major
>
> SQL initial script:
> CREATE TABLE Person(id INTEGER PRIMARY KEY, company_id INTEGER);
> CREATE TABLE Company(id INTEGER PRIMARY KEY, name VARCHAR);
> INSERT INTO Person(id,company_id) VALUES (1, 1), (2, 2), (3, 3);
> INSERT INTO Company(id,name) VALUES (1,'n1'), (2,'n2'), (3,'n3');
> SQL query:
> SELECT p.id,sum(p.id) FROM person p
> LEFT JOIN (select DISTINCT id from company) as c on c.id=p.company_id
> group by p.id
> Result:
> Caused by: org.h2.jdbc.JdbcSQLException: Column "P__Z0.ID" must be in the GROUP BY list; SQL statement:
> SELECT
> P__Z0.ID __C0_0,
> P__Z0.COMPANY_ID __C0_1,
> SUM(P__Z0.ID) __C0_2
> FROM PUBLIC.PERSON P__Z0 [90016-195]
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)