Show instances/Show P

The command format is as follows:
SHOW INSTANCES [FROM startdate TO enddate] [number];
SHOW P [FROM startdate TO enddate] [number];
SHOW INSTANCES [-all];
SHOW P [-all];

Action: 

The information of instances created by current users is displayed.

Parameters information is as follows:
  • Startdate, enddate: returns the information about the instances during specified period (from startdate to enddate). The following format must be met: yyyy-mm-dd, precision to the day.  Optional parameter, if not specified, returns the information of instances you submitted within three days.
  • Number: Specify the number of instance to be showed.In accordance with the time scheduling, return N (number) instances nearest to the current time. If it is not specified, all instances that meet the requirements are shown. In chronological order, the specified number of instances most recently preceding the current time are returned. The information of all instances meeting requirements is returned.
  • -all:Returns all instances performed under the current project. Note: The user executing the command needs to have list permission for the project.
  • The output items: Include StartTime (the time accurate to seconds), RunTime (s), Status (including Waiting, Success, Failed, Running, Cancelled, and Suspended).
InstanceID and corresponding SQL are as following:
StartTime RunTime Status InstanceID Query
2015-04-28 13:57:55 1s Success 20150428055754916grvd5vj4 select * from tab_pack_priv limit 20;

Six kinds of instance status are possible:
  • Running
  • Success
  • Waiting
  • Failed, but the data of the target table have not been modified.
  • Suspended
  • Canceled
Note
The commands from the preceding example run in MaxCompute client.

Instance status

The command format is as follows:
STATUS <instance_id>; -- instance_id: The unique identifier of an instance,  to specify which instance to be queried.
Action:
  • Query the status of specified instance, such as Success, Failed, Running, and Cancelled.
  • If this instance is not created by current user, exception is returned.
Example:
odps@ $project_name>status 20131225123302267gk3u6k4y2;
Success
Query the status of an instance which ID is 20131225123302267gk3u6k4y2, and the result is Success.
Note
The commands from the preceding example run in MaxCompute client.

Top instance

The command format is as follows:
TOP INSTANCE;

Action:

The job information that is running in the current project is displayed, including ISNTANCEID, Owner, Type, StartTime, Progress, Status,  Priority, RuntimeUsage (CPU/MEM), TotalUsage (CPU/MEM), QueueingInfo (POS/LEN) and so on.

Example:
odps@ $project_name>top instance;
Note
The commands from the preceding example run in MaxCompute client (version 0.29.0 or later).

Delete an instance

The command format is as follows:
kill <instance_id>; -- instance_id: The unique identifier of an instance,  which must be ID of an instance whose status is 'Running', otherwise, an error is returned.

Action:

Stop specified instance. Instance status must be Running.

Example:
odps@ $project_name>kill 20131225123302267gk3u6k4y2;
Stop the instance which ID is 20131225123302267gk3u6k4y2.
Note
  • The commands from the preceding example run in MaxCompute client.
  • This is an asynchronous process. It does not mean that the distributed task has stopped after the system accepts the request and returns result. To check whether the instance is deleted, use the status command.

Describe an instance

The command format is as folllows:
desc instance <instance_id>; -- instance_id: The unique identifier of an instance.

Action:

Get the job information according to instance ID, including SQL, owner, startime, endtime, status.

Example:
odps@ $project_name> desc instance 20150715103441522gond1qa2;
ID 20150715103441522gond1qa2
Owner ALIYUN$maojing.mj@alibaba-inc.com
StartTime 2015-07-15 18:34:41
EndTime 2015-07-15 18:34:42
Status Terminated
console_select_query_task_1436956481295 Success
Query select * from mj_test;
Query all the job information related to the instance which ID is 20150715103441522gond1qa2.
Note
The commands from the preceding example run in MaxCompute client.

Wait instance

The command format is as follows:
wait <instance_id>; -- instance_id: The unique identifier of an instance.

Action:

Get running task information, including logs according to instance ID, and logview link. You can view task details by accessing logview link.

Example:
wait 20170925161122379g357ldqp;
ID = 20170925161122379g357ldqp
Log view:
http://logview.odps.aliyun.com/logview/?h=http://service.odps.aliyun.com/api&p=alian&i=20170925161122379g357ldqp&token=WnlzSGMwZG5vMUZxMGFTWk5hUElwYm1jb21VPSxPRFBTX09CTzoxMzI5MzgzMDA0NTQwNjUxLDE1MDcxOTE0MDYseyJTdGF0ZW1lbnQiOlt7IkFjdGlvbiI6WyJvZHBzOlJlYWQiXSwiRWZmZWN0IjoiQWxsb3ciLCJSZXNvdXJjZSI6WyJhY3M6b2RwczoqOnByb2plY3RzL2FsaWFuL2luc3RhbmNlcy8yMDE3MDkyNTE2MTEyMjM3OWczNTdsZHFwIl19XSwiVmVyc2lvbiI6IjEifQ==
Job Queueing...
Summary:
resource cost: cpu 0.05 Core * Min, memory 0.05 GB * Min
inputs:
        alian.bank_data: 41187 (588232 bytes)
outputs:
        alian.result_table: 8 (640 bytes)
Job run time: 2.000
Job run mode: service job
Job run engine: execution engine
M1:
        instance count: 1
        run time: 1.000
        instance time:
                min: 1.000, max: 1.000, avg: 1.000
        input records:
                TableScan_REL5213301: 41187 (min: 41187, max: 41187, avg: 41187

        output records:
                StreamLineWrite_REL5213305: 8 (min: 8, max: 8, avg: 8)
R2_1:
        instance count: 1
        run time: 2.000
        instance time:
                min: 2.000, max: 2.000, avg: 2.000
        input records:
                StreamLineRead_REL5213306: 8 (min: 8, max: 8, avg: 8)
        output records:
                TableSink_REL5213309: 8 (min: 8, max: 8, avg: 8)