I am trying to use SQL like version of tigergraph GSQL and having something weird whenever I use OFFSET it always returns an empty result set, while if I don’t use offset it works fine, any idea about that.
CREATE OR REPLACE DISTRIBUTED QUERY PostsQuery(/* Parameters here */) FOR GRAPH MyGraph{
SELECT p.id, p.body, p.created_at, p.featured_at INTO data
FROM Post:p
LIMIT 2 OFFSET 1;
PRINT data;
}
Outputs:
[
{
"data": []
}
]
while if offset is omitted
[
{
"data": [
{
"body": "sdadsa.",
"created_at": "2016-12-27 16:41:10",
"featured_at": "1970-01-01 00:00:00",
"id": 8
},
{
"body": "sdadsa.",
"created_at": "2016-12-28 01:22:05",
"featured_at": "1970-01-01 00:00:00",
"id": 9
}
]
}
]
As mentioned on their docs (EBNF for SQL-Like Select Statement) as it is mentioned limitClause is supported
EBNF for SQL-Like Select Statement
sqlSelectBlock := sqlSelectClause
fromClause
[whereClause]
[groupByClause]
[havingClause]
[orderClause]
[limitClause]
sqlSelectClause := SELECT [DISTINCT] columnExpr ("," columnExpr)*
INTO tableName
columnExpr := expr [AS columnName]
| aggregator "("[DISTINCT] expr ")" [AS columnName]
columnName := name
tableName := name
EBNF for LIMIT Clause
limitClause := LIMIT ( expr | expr "," expr | expr OFFSET expr )
Tried a lot of combinations of setting offset to 0 and I am sure that vertices getting queried is more than 20k
Any help would be appreciated! thanks