You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Jaideep Dhok (JIRA)" <ji...@apache.org> on 2013/06/05 10:20:21 UTC

[jira] [Commented] (HIVE-4569) GetQueryPlan api in Hive Server2

    [ https://issues.apache.org/jira/browse/HIVE-4569?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13675698#comment-13675698 ] 

Jaideep Dhok commented on HIVE-4569:
------------------------------------

Update on the work done so far -

# h5. Added getQueryPlan API with Thrift
# h5. Added support for non-blocking queries.
## Right now I have done this by passing a boolean flag while calling executeStatement
## If the flag is set to true, query runs in non-blocking mode. The flag defaults to false.
## I've implemented this by adding a fixed size thread pool in the OperationManager, for running non-blocking operations. A reference to the future is kept in the operation, so that it can be cancelled.
## Once the query is running in the background, users can poll status using GetOperationStatus.
## Users can cancel the query by calling CancelOperation
# h5. Additions in GetOperationStatus
## OperationManager calls operation.getTaskStatuses(), Each operation can override this method to customize reporting
## SQLOperation returns the task statuses by calling getTaskStatuses() on the current driver.
## Driver reports task statuses by iterating through all tasks in the plan
## Changes in HS2 thrift API -
{code}
// GetOperationStatus()
//
// Get the status of an operation running on the server.
struct TGetOperationStatusReq {
  // Session to run this request against
  1: required TOperationHandle operationHandle
}

// State of a sub task in an operation
enum TTaskState {
  // The task has been initialized
  INITIALIZED_STATE,

  // Driver is currently running the task
  RUNNING_STATE,

  // Task is completed
  FINISHED_STATE,

  // Task is queued in the driver
  QUEUED_STATE,
  
  // State is unkown
  UNKOWN_STATE
}

// Status of a sub task in an operation
struct TTaskStatus {
 // Task ID
 1: required string taskId
 // External ID for this task, For example MapRedTask can return job ID of the Hadoop job
 2: optional string externalHandle
 // Current state of the task as seen by driver
 3: required TTaskState state
}

struct TGetOperationStatusResp {
  1: required TStatus status
  // State of the whole operation
  2: optional TOperationState operationState
  // List of statuses of sub tasks
  3: optional list<TTaskStatus> taskStatuses
}
{code}


h5. Things pending as of now
# If the Task runs in a sub-process, then external handle (job ID) is returned as null.
        
        
        
                
> GetQueryPlan api in Hive Server2
> --------------------------------
>
>                 Key: HIVE-4569
>                 URL: https://issues.apache.org/jira/browse/HIVE-4569
>             Project: Hive
>          Issue Type: Bug
>          Components: HiveServer2
>            Reporter: Amareshwari Sriramadasu
>            Assignee: Jaideep Dhok
>         Attachments: git-4569.patch, HIVE-4569.D10887.1.patch
>
>
> It would nice to have GetQueryPlan as thrift api. I do not see GetQueryPlan api available in HiveServer2, though the wiki https://cwiki.apache.org/confluence/display/Hive/HiveServer2+Thrift+API contains, not sure why it was not added.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira