-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New table API endpoints for lower level table access #564
Conversation
0fa91ba
to
db88511
Compare
It looks like
Is that expected? |
@will-moore Yes, that is expected. The total number of results is not available, since the query is not run on the whole table, but only from Figuring out the total is left to the client, by adding up the number of returned rows for each call. For tables with less than
|
Everything is working just fine for E.g. If I make an invalid query like this: If I forget what needs to be in the query e.g.
if I use the range the wrong way around I get the whole table (regardless of the number of rows and columns):
If I go out of range,
I get |
@will-moore added better error handling and checks |
for more information, see https://pre-commit.ci
Made some more convenience changes:
{
"rows": [
2,
3,
"5-7",
9,
10,
"12-20",
"22-27",
"33-35"
],
"meta": {}
}
"meta": {
"partialCount": 25,
"rowCount": 14336,
"columnCount": 105,
"start": 0,
"end": 14336,
"maxCells": 1000000
} |
I don't think having Edit: Furthermore, I think it's a usability downgrade. The client then would need to decompress the result set of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error handling is improved thanks.
Looks good.
Removed the |
Before this goes in we definitely need to expand the |
This PR adds two new endpoints for lower level table access:
/webgateway/table/123/rows/
takes aquery
argument in the usual format and returns matching row numbers. No actual data is returned. Limited paging support by always returning up toMAX_TABLE_SLICE_SIZE
rows and taking astart
argument from where to start the search.rowCount
andend
are returned to easily detect the end of results or need for additional calls (with newstart
set to previousend
)./webgateway/table/123/slice/
takes numeric lists ofrows
andcolumns
and performs a slice. Data is returned in columnar format (vs. rows in the current table API). The number of requested rows times columns cannot exceedMAX_TABLE_SLICE_SIZE
, which defaults to 1 million. BothGET
andPOST
are supported to allow for large numbers of rows and columns (exceeding the possible query string length). For retrieval of consecutive rows or columns, ranges can be specified as e.g.1-5
instead of1,2,3,4,5
.Examples:
Notes:
json.dumps
, allowing e.g. for removing whitespace from the outputNaN
s are allowed in the output but not supported by plain JSON, clients can use JSON5 for parsing