Instance

Last Updated: May 02, 2018

Show instances/Show P

The command format is as follows:

  1. SHOW INSTANCES [FROM startdate TO enddate] [number];
  2. SHOW P [FROM startdate TO enddate] [number];
  3. SHOW INSTANCES [-all];
  4. 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.
  • 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:

  1. StartTime RunTime Status InstanceID Query
  2. 2015-04-28 13:57:55 1s Success 20150428055754916grvd5vj4 select * from tab_pack_priv limit 20;
  3. ... ... ... ... ...
  4. ... ... ... ... ...

Six kinds of instance status are possible:

  • Running
  • Success
  • Waiting
  • Failed: It means that the operation has failed, but the target table data has not been modified.
  • Suspended
  • Cancelled

NOTE:

The commands from the preceding example run in MaxCompute client.

Instance status

The command format is as follows:

  1. 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:

  1. odps@ $project_name>status 20131225123302267gk3u6k4y2;
  2. 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:

  1. 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:

  1. 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:

  1. 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:

  1. 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:

  1. 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:

  1. odps@ $project_name> desc instance 20150715103441522gond1qa2;
  2. ID 20150715103441522gond1qa2
  3. Owner ALIYUN$maojing.mj@alibaba-inc.com
  4. StartTime 2015-07-15 18:34:41
  5. EndTime 2015-07-15 18:34:42
  6. Status Terminated
  7. console_select_query_task_1436956481295 Success
  8. 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:

  1. 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:

  1. wait 20170925161122379g357ldqp;
  2. ID = 20170925161122379g357ldqp
  3. Log view:
  4. http://logview.odps.aliyun.com/logview/?h=http://service.odps.aliyun.com/api&p=alian&i=20170925161122379g357ldqp&token=WnlzSGMwZG5vMUZxMGFTWk5hUElwYm1jb21VPSxPRFBTX09CTzoxMzI5MzgzMDA0NTQwNjUxLDE1MDcxOTE0MDYseyJTdGF0ZW1lbnQiOlt7IkFjdGlvbiI6WyJvZHBzOlJlYWQiXSwiRWZmZWN0IjoiQWxsb3ciLCJSZXNvdXJjZSI6WyJhY3M6b2RwczoqOnByb2plY3RzL2FsaWFuL2luc3RhbmNlcy8yMDE3MDkyNTE2MTEyMjM3OWczNTdsZHFwIl19XSwiVmVyc2lvbiI6IjEifQ==
  5. Job Queueing...
  6. Summary:
  7. resource cost: cpu 0.05 Core * Min, memory 0.05 GB * Min
  8. inputs:
  9. alian.bank_data: 41187 (588232 bytes)
  10. outputs:
  11. alian.result_table: 8 (640 bytes)
  12. Job run time: 2.000
  13. Job run mode: service job
  14. Job run engine: execution engine
  15. M1:
  16. instance count: 1
  17. run time: 1.000
  18. instance time:
  19. min: 1.000, max: 1.000, avg: 1.000
  20. input records:
  21. TableScan_REL5213301: 41187 (min: 41187, max: 41187, avg: 41187
  22. )
  23. output records:
  24. StreamLineWrite_REL5213305: 8 (min: 8, max: 8, avg: 8)
  25. R2_1:
  26. instance count: 1
  27. run time: 2.000
  28. instance time:
  29. min: 2.000, max: 2.000, avg: 2.000
  30. input records:
  31. StreamLineRead_REL5213306: 8 (min: 8, max: 8, avg: 8)
  32. output records:
  33. TableSink_REL5213309: 8 (min: 8, max: 8, avg: 8)
Thank you! We've received your feedback.