metamodel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kasper Sørensen (JIRA) <j...@apache.org>
Subject [jira] [Resolved] (METAMODEL-60) Error while using max rows with distinct for MSSQL in Metamodel.
Date Sat, 31 May 2014 10:11:01 GMT

     [ https://issues.apache.org/jira/browse/METAMODEL-60?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Kasper Sørensen resolved METAMODEL-60.
--------------------------------------

       Resolution: Fixed
    Fix Version/s: 4.1
         Assignee: Balendra Singh

Fix is pushed to master.

> Error while using max rows with distinct for MSSQL in Metamodel.
> ----------------------------------------------------------------
>
>                 Key: METAMODEL-60
>                 URL: https://issues.apache.org/jira/browse/METAMODEL-60
>             Project: Metamodel
>          Issue Type: Bug
>            Reporter: Balendra Singh
>            Assignee: Balendra Singh
>            Priority: Critical
>             Fix For: 4.1
>
>
> I am using MSSQL to fetch the records with max rows defined and distinct as true also
for the select clause as following - 
> Query q = new Query().from(table).selectDistinct().select(column).setMaxRows(20);
> So it is throwing Incorrect syntax near the keyword 'DISTINCT' error.
> I debugged the code and found that in SQLServerQueryRewriter.rewriteSelectClause(), we
are appending TOP 20 after the select keyword so with distinct it becomes select TOP 20 DISTINCT
<rest query> which is not correct. 
> It should be select DISTINCT TOP 20 <rest query>.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message