Commands frame/sorted_k¶
[ALPHA] Get a sorted subset of the data.
POST /v1/commands/¶
GET /v1/commands/:id¶
Request¶
Route
POST /v1/commands/
Body
name: | frame/sorted_k |
---|---|
arguments: | frame : Frame
k : int32
column_names_and_ascending : list
reduce_tree_depth : int32 (default=None)
|
Headers
Authorization: test_api_key_1
Content-type: application/json
Description
Take a number of rows and return them sorted in either ascending or descending order.
Sorting a subset of rows is more efficient than sorting the entire frame when the number of sorted rows is much less than the total number of rows in the frame.
Notes¶
The number of sorted rows should be much smaller than the number of rows in the original frame.
In particular:
- The number of sorted rows returned should fit in Spark driver memory. The maximum size of serialized results that can fit in the Spark driver is set by the Spark configuration parameter spark.driver.maxResultSize.
- If you encounter a Kryo buffer overflow exception, increase the Spark configuration parameter spark.kryoserializer.buffer.max.mb.
- Use Frame.sort() instead if the number of sorted rows is very large (in other words, it cannot fit in Spark driver memory).
Response¶
Status
200 OK
Body
Returns information about the command. See the Response Body for Get Command here below. It is the same.