Hi Naser Thanks for your question. I believe this was fixed in the latest version of Drill (1.20) which will be released any day now.
Sent from my iPhone > On Feb 9, 2022, at 17:07, Naser Khodabin > <naser.khoda...@intraservice.goteborg.se> wrote: > > Hi! > > I'm wondering if there is a way to query MSSQL in apache drill (version > 1.19) to get a given number of rows. > For instance I tried this select-statement: > > SELECT * FROM bp.BPASession order by startdatetime desc limit 2 > > Which cause the following error: > > org.apache.drill.common.exceptions.UserRemoteException: DATA_READ ERROR: The > JDBC storage plugin failed while trying setup the SQL query. Sql: SELECT * > FROM "dbo"."BPASession" ORDER BY CASE WHEN "startdatetime" IS NULL THEN 0 > ELSE 1 END, "startdatetime" DESC FETCH NEXT 2 ROWS ONLY Plugin: bp Fragment: > 0:0 > > Without Limit 2, it work correctly: > SELECT * FROM bp.BPASession order by startdatetime desc > > I appreciate any kind of help! > > > Med vänliga hälsningar > > Naser Khodabin > > GÖTEBORGS STAD > Intraservice, enheten IT-projekt och -portfölj > Mobil: 076 -2060289 > E-post: > naser.khoda...@intraservice.goteborg.se<mailto:naser.khoda...@intraservice.goteborg.se> > Postadress: 403 31 Göteborg > Besök: Rosenlundsgatan 4 > www.goteborg.se<http://www.goteborg.se/> >