MySQL HeatWave User Guide

10.1.4.5 app_task

The app_task routine returns information about a single application task.

This topic contains the following sections:

Syntax
mysql> SELECT mysql_tasks.app_task(
  IN 'app_user_id' VARCHAR(255), 
  IN 'task_id' VARCHAR(36));

Following are app_task parameters:

  • app_user_id (VARCHAR(255)): specifies the unique ID of the application user who owns the task.

  • task_id (VARCHAR(36)): specifies the unique task ID (UUID) of the application task whose information is required.

Syntax Example
mysql> SELECT JSON_PRETTY(mysql_tasks.app_task('app_user_01',@task_id));

The output is similar to the following:

| {
  "id": "a516b352-574c-11f0-9604-020017205654",
  "data": {
    "sleep": 5,
    "mysqlMetadata": {
      "autoGc": true,
      "events": [
        "`demo_db`.`a516a336-574c-11f0-9604-020017205654`",
        "`demo_db`.`a516a3f8-574c-11f0-9604-020017205654`"
      ]
    },
    "refresh_period": 1
  },
  "name": "demo task name",
  "alias": "Wed-3",
  "task_type": "demo task type",
  "connection_id": 1650,
  "data_json_schema": {
    "type": "object",
    "required": null,
    "properties": {
      "sleep": {
        "type": "integer"
      },
      "mysqlMetadata": {
        "type": "object",
        "required": [
          "events",
          "autoGc"
        ],
        "properties": {
          "autoGc": {
            "type": "boolean"
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "minItems": 1,
            "uniqueItems": true
          }
        }
      },
      "refresh_period": {
        "type": "integer"
      }
    }
  },
  "log_data_json_schema": {
    "type": "object",
    "oneOf": [
      {
        "required": [
          "iteration"
        ]
      },
      {
        "required": [
          "Task result"
        ]
      },
      {
        "required": [
          "connection_id"
        ]
      }
    ],
    "properties": {
      "iteration": {
        "type": "integer"
      },
      "Task result": {
        "type": "string"
      },
      "connection_id": {
        "type": "integer"
      }
    },
    "additionalProperties": false
  }
} |

This example retrieves all the information associated with the specified application-managed user ID and task ID stored in the session variable @task_id.

See Also

Running tasks Asynchronously.