MS SQL offset parsing error
- Dominant language
- Rust
- Stars
- 20.8k
- Forks
- 2.1k
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 181
Description
**Describe the bug**
When I query with an non 0 offset, I get the following error:
```
{
"error": "Error: Parse error at line: 4, column: 184: Incorrect syntax near 'OFFSET'.",
"requestId": "0a7bbbea-f722-4fe2-b587-ef30eb619559-span-1"
}
```
**To Reproduce**
Steps to reproduce the behavior:
Cube server is connected with a MS SQL db. A sample query is below:
```
curl --location 'http://xxxxxxxx:4000/cubejs-api/v1/load' \
--header 'Content-Type: application/json' \
--data '{
"query": {
"measures": [
"transactions.count"
],
"offset": 1
}
}'
```
This query will generate the following sql statement when hit `/sql` endpoint
```
"sql": [
"SELECT\n count(\"transactions\".transaction_id) \"transactions__count\"\n FROM\n analytics_learn.transactions AS \"transactions\" OFFSET 1 ROWS FETCH NEXT 10000 ROWS ONLY",
[]
],
```
If I set offset to 0, the sql statement becomes
```
"sql": [
"SELECT TOP 10000\n count(\"transactions\".transaction_id) \"transactions__count\"\n FROM\n analytics_learn.transactions AS \"transactions\" ",
[]
],
```
**Expected behavior**
Be able to parse non 0 offset
**Version:**
latest docker image: `cubejs/cube:latest`
Contributor guide
Assessment
This issue has not been assessed yet.