You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kyuubi.apache.org by ya...@apache.org on 2022/11/09 07:47:16 UTC

[incubator-kyuubi] branch master updated: [KYUUBI #3039][DOCS] Add operation resource REST docs

This is an automated email from the ASF dual-hosted git repository.

yao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-kyuubi.git


The following commit(s) were added to refs/heads/master by this push:
     new 373835536 [KYUUBI #3039][DOCS] Add operation resource REST docs
373835536 is described below

commit 373835536e84052058066bfa11a6c138498e039d
Author: Luning Wang <wa...@gmail.com>
AuthorDate: Wed Nov 9 15:47:07 2022 +0800

    [KYUUBI #3039][DOCS] Add operation resource REST docs
    
    ### _Why are the changes needed?_
    Add operation resource REST docs
    
    ### _How was this patch tested?_
    - [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible
    
    - [ ] Add screenshots for manual tests if appropriate
    
    - [x] [Run test](https://kyuubi.apache.org/docs/latest/develop_tools/testing.html#running-tests) locally before make a pull request
    
    Closes #3709 from deadwind4/operation-rest-doc.
    
    Closes #3039
    
    437685c40 [Luning Wang] Fix descriptions of action
    eb9557d41 [Luning Wang] Fix descriptions
    60d038a43 [Luning Wang] [KYUUBI #3039][DOCS] Add operation resource REST docs
    
    Authored-by: Luning Wang <wa...@gmail.com>
    Signed-off-by: Kent Yao <ya...@apache.org>
---
 docs/client/rest/rest_api.md | 108 ++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 107 insertions(+), 1 deletion(-)

diff --git a/docs/client/rest/rest_api.md b/docs/client/rest/rest_api.md
index b95d908a8..ea331dc73 100644
--- a/docs/client/rest/rest_api.md
+++ b/docs/client/rest/rest_api.md
@@ -261,6 +261,71 @@ Create an operation with GET_SCHEMAS type
 |:-----------|:----------------------------|:-------|
 | identifier | The identifier of operation | String |
 
+## Operation Resource
+
+### GET /operations/${operationHandle}/event
+
+Get the current event of the operation by the specified operation handle.
+
+#### Response Body
+
+The [KyuubiOperationEvent](#kyuubioperationevent).
+
+### PUT /operations/${operationHandle}
+
+Perform an action to the pending or running operation.
+
+#### Request Body
+
+| Name   | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       [...]
+|:-------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+| action | The action that is performed to the operation. Currently, supported actions are 'cancel' and 'close'. <ul><li>Cancel: to cancel the operation, which means the operation and its corresponding background task will be stopped, and its state will be switched to CANCELED. A CANCELED operation's status can still be fetched by client requests.</li><li>Close: to close the operation, which means the operation and its corresponding background task will be stopped, and its state will be  [...]
+
+### GET /operations/${operationHandle}/resultsetmetadata
+
+Get the result set schema of the operation by the specified operation handle.
+
+#### Response Body
+
+| Name    | Description                 | Type               |
+|:--------|:----------------------------|:-------------------|
+| columns | The descriptions of columns | List of ColumnDesc |
+
+### GET /operations/${operationHandle}/log
+
+Get a list of operation log lines of the running operation by the specified operation handle.
+
+#### Request Parameters
+
+| Name    | Description                           | Type |
+|:--------|:--------------------------------------|:-----|
+| maxRows | The max row that are pulled each time | Int  |
+
+#### Response Body
+
+| Name      | Description              | Type            |
+|:----------|:-------------------------|:----------------|
+| logRowSet | The set of log set       | List of Strings |
+| rowCount  | The count of log row set | Int             |
+
+### GET /operations/${operationHandle}/rowset
+
+Get the operation result as a list of rows by the specified operation handle.
+
+#### Request Parameters
+
+| Name             | Description                                                                                                            | Type   |
+|:-----------------|:-----------------------------------------------------------------------------------------------------------------------|:-------|
+| maxrows          | The max rows that are pulled each time                                                                                 | Int    |
+| fetchorientation | The orientation of fetch, for example FETCH_NEXT, FETCH_PRIOR, FETCH_FIRST, FETCH_LAST, FETCH_RELATIVE, FETCH_ABSOLUTE | String |
+
+#### Response Body
+
+| Name     | Description       | Type         |
+|:---------|:------------------|:-------------|
+| rows     | The list of rows  | List of Rows |
+| rowCount | The count of rows | Int          |
+
 ## Batch Resource
 
 ### GET /batches
@@ -424,6 +489,47 @@ The [Engine](#engine) List.
 | exception       | The session exception, such as the exception that occur when opening session                                        | Throwable |
 | eventType       | The type of session event                                                                                           | String    |
 
+#### KyuubiOperationEvent
+
+| Name           | Description                                                     | Type      |
+|:---------------|:----------------------------------------------------------------|:----------|
+| statementId    | The unique identifier of a single operation                     | String    |
+| remoteId       | The unique identifier of a single operation at engine side      | String    |
+| statement      | The sql that you execute                                        | String    |
+| shouldRunAsync | The flag indicating whether the query runs synchronously or not | Boolean   |                       
+| state          | The current operation state                                     | String    |
+| eventTime      | The time when the event created & logged                        | Long      |
+| createTime     | The time for changing to the current operation state            | Long      |           
+| startTime      | The time the query start to time of this operation              | Long      |          
+| completeTime   | Time time the query ends                                        | Long      |
+| exception      | Caught exception if have                                        | Throwable |
+| sessionId      | The identifier of the parent session                            | String    |
+| sessionUser    | The authenticated client user                                   | String    |
+
+### ColumnDesc
+
+| Name        | Description                            | Type   |
+|:------------|:---------------------------------------|:-------|
+| columnName  | The name of the column                 | String |
+| dataType    | The type descriptor for this column    | String |
+| columnIndex | The index of this column in the schema | Int    |
+| precision   | The precision of the column            | Int    |  
+| scale       | The scale of the column                | Int    |  
+| comment     | The comment of the column              | String |
+
+### Row
+
+| Name   | Description       | Type           |
+|:-------|:------------------|:---------------|
+| fields | The fields of row | List of Fields |
+
+### Field
+
+| Name     | Description         | Type   |
+|:---------|:--------------------|:-------|
+| dataType | The type of column  | String |
+| value    | The value of column | Object |
+
 ### Engine
 
 | Name           | Description                                                        | Type   |
@@ -434,4 +540,4 @@ The [Engine](#engine) List.
 | sharelevel     | The engine share level                                             | String |
 | subdomain      | The engine subdomain                                               | String |
 | instance       | host:port for the engine node                                      | String |
-| namespace      | The namespace used to expose the engine to KyuubiServers           | String |
\ No newline at end of file
+| namespace      | The namespace used to expose the engine to KyuubiServers           | String |