Alibaba Cloud Query

Alibaba Cloud Query

Certified

Execute a MaxCompute SQL query

Runs a SQL statement on Alibaba Cloud MaxCompute and retrieves or stores the result set. Supports cancellation via instance termination.

yaml
type: io.kestra.plugin.alibaba.maxcompute.Query

Run a MaxCompute query and store the result

yaml
id: maxcompute_query
namespace: company.team

tasks:
  - id: query
    type: io.kestra.plugin.alibaba.maxcompute.Query
    accessKeyId: "{{ secret('ALIBABA_ACCESS_KEY_ID') }}"
    accessKeySecret: "{{ secret('ALIBABA_ACCESS_KEY_SECRET') }}"
    region: cn-shanghai
    project: analytics
    sql: |
      SELECT region, SUM(amount) AS total
      FROM orders
      WHERE ds = '{{ now() | date('yyyyMMdd') }}'
      GROUP BY region
    fetchType: STORE

Execute a query and fetch rows

yaml
id: maxcompute_fetch
namespace: company.team

tasks:
  - id: fetch_data
    type: io.kestra.plugin.alibaba.maxcompute.Query
    accessKeyId: "{{ secret('ALIBABA_ACCESS_KEY_ID') }}"
    accessKeySecret: "{{ secret('ALIBABA_ACCESS_KEY_SECRET') }}"
    region: cn-hangzhou
    project: my_project
    sql: "SELECT id, name FROM users LIMIT 100"
    fetchType: FETCH
Properties

AccessKey ID

The AccessKey ID used to authenticate against Alibaba Cloud.

AccessKey secret

The AccessKey secret paired with the AccessKey ID.

Project

The MaxCompute project name.

SQL query

The SQL query to execute.

Assets this task consumes as inputs or produces as outputs, for lineage tracking and the asset graph (Enterprise Edition). A flow declaring this property on a task is rejected in the open-source edition.

Definitions
assetFailureBehaviorstring
Possible Values
IGNOREFAILWARN

Asset failure behavior

Behavior applied to the task state when a declared asset fails to render, emit, or be persisted (e.g. a lock conflict): FAIL escalates it to FAILED, WARN (default) warns it if it would otherwise succeed, IGNORE leaves the state untouched.

enableAutobooleanstring

Whether to auto-register assets referenced dynamically at runtime that are not statically declared in inputs or outputs.

inputsarray

The assets consumed as inputs.

id*string
Min length1
typestring
outputs

The assets produced as outputs.

id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*string
Min length1

Custom asset type

descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150

Endpoint override

Custom http or https endpoint URL. When set, it takes precedence over the endpoint derived from region.

DefaultNONE
Possible Values
STOREFETCHFETCH_ONENONE

Result handling mode

FETCH_ONE, FETCH, STORE, or NONE. Defaults to NONE.

Region

The Alibaba Cloud region ID, for example cn-hangzhou. The service endpoint is derived from it unless endpointOverride is set.

Security token

Optional Security Token Service (STS) token, required when using temporary credentials.

Tunnel endpoint override

Custom tunnel endpoint URL. If omitted, default tunnel routing is used.

The MaxCompute instance ID

Map containing the first row

Only populated if fetchType is FETCH_ONE

SubTypeobject

List containing fetched rows

Only populated if fetchType is FETCH

The total number of rows returned

Formaturi

The URI of the stored result in internal storage

Only populated if fetchType is STORE