POST /entity/{id}/table/query/async/start

Asynchronously start a query. Use the returned job id and GET /entity/{id}/table/query/async/get to get the results of the query

Using a 'SQL like' syntax, query the current version of the rows in a single table. The following pseudo-syntax is the basic supported format:

[ALL | DISTINCT] select_expr [, select_expr ...]
FROM synapse_table_id
[WHERE where_condition]
[GROUP BY {col_name [, [col_name * ...] }
[ORDER BY {col_name [ [ASC | DESC] [, col_name [ [ASC | DESC]]}
[LIMIT row_count [ OFFSET offset ]]

Please see the following for samples: Table SQL Examples

Note: Sub-queries and joining tables is not supported.

This services depends on an index that is created/update asynchronously from table creation and update events. This means there could be short window of time when the index is inconsistent with the true state of the table. When a query is run with the isConsistent parameter set to true (the default) and the index is out-of-sych, then a status code of 202 (ACCEPTED) will be returned and the response body will be a TableStatus object. The TableStatus will indicates the current status of the index including how much work is remaining until the index is consistent with the truth of the table.

isConsistent Defaults to true. When true, a query will be run only if the index is up-to-date with all changes to the table and a read-lock is successfully acquired on the index. When set to false, the query will be run against the index regardless of the state of the index and without attempting to acquire a read-lock. When isConsistent is set to false the query results will not contain an etag so the results cannot be used as input to a table update.

The 'partsMask' is an integer "mask" that can be combined into to request any desired part. As of this writing, the mask is defined as follows:

  • Query Results (queryResults) = 0x1
  • Query Count (queryCount) = 0x2
  • Select Columns (selectColumns) = 0x4
  • Max Rows Per Page (maxRowsPerPage) = 0x8

For example, to request all parts, the request mask value should be:
0x1 OR 0x2 OR 0x4 OR 0x8 = 0xF.

Note: The caller must have the ACCESS_TYPE.READ permission on the TableEntity to make this call.

Resource URL{id}/table/query/async/start

Resource URL Variables
{id} The ID of the TableEntity.
Resource Information
Authentication Required
Request Object QueryBundleRequest
Response Object AsyncJobId