You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Vladimir Ozerov (JIRA)" <ji...@apache.org> on 2018/10/09 09:18:00 UTC

[jira] [Comment Edited] (IGNITE-6501) select distinct exception in simple sqlQuery request.

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

Vladimir Ozerov edited comment on IGNITE-6501 at 10/9/18 9:17 AM:
------------------------------------------------------------------

[~Artem Budnikov],

We should explain users that {{SqlQuery}} is a sugar on top {{SqlFieldsQuery}}. It is convenient in some cases, as it returns key-value pairs, but on the other hand in can be used only in two forms:

1) {{FROM ...}} - i.e. without SELECT at all
2) {{SELECT * FROM ...}} - i.e. only asterisk inside a select. If there are several tables, then an alias could be used with an asterisk as well: {{SELECT p.* FROM Person p INNER JOIN Department d ON p.deptId = d.id}}

All other forms, e.g. aforementioned {{DISTINCT}} are illegal. {{SqlFieldsQuery}} should be used in this case.


was (Author: vozerov):
We should explain users that {{SqlQuery}} is a sugar on top {{SqlFieldsQuery}}. It is convenient in some cases, as it returns key-value pairs, but on the other hand in can be used only in two forms:

1) {{FROM ...}} - i.e. without SELECT at all
2) {{SELECT * FROM ...}} - i.e. only asterisk inside a select. If there are several tables, then an alias could be used with an asterisk as well: {{SELECT p.* FROM Person p INNER JOIN Department d ON p.deptId = d.id}}

All other forms, e.g. aforementioned {{DISTINCT}} are illegal. {{SqlFieldsQuery}} should be used in this case.

> select distinct exception in simple sqlQuery request.
> -----------------------------------------------------
>
>                 Key: IGNITE-6501
>                 URL: https://issues.apache.org/jira/browse/IGNITE-6501
>             Project: Ignite
>          Issue Type: Bug
>          Components: documentation, sql
>    Affects Versions: 2.0, 2.1
>            Reporter: Stanilovsky Evgeny
>            Assignee: Vladimir Ozerov
>            Priority: Major
>             Fix For: 2.7
>
>         Attachments: DistinctTest.java
>
>
> SqlQuery throws exception
> {code}
> Failed to parse query: SELECT distinct Value._KEY, distinct Value._VAL from Value
> {code}
> while SqlFieldsQuery works properly well.



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