All Products
Search
Document Center

PolarDB:QueryColumnarLog

Last Updated:Sep 10, 2026

Queries column store audit logs.

Operation description


Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

polardbx:QueryColumnarLog

get

*All Resource

*

None None

Request syntax

POST / HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

The region ID of the request. The value must match the region where the SQLQuery service is deployed.

cn-hangzhou

DBInstanceName

string

Yes

The ID of the PolarDB-X instance for which you want to query column store audit logs.

pxc-********

SQL

string

Yes

The read-only query statement to execute. Only a single MySQL SELECT statement is supported. Query tables must use the fully qualified form polardbx_sls.<table_name>, and only the following tables are allowed: polardbx_sls.polardbx_log (kernel logs), polardbx_sls.slow_detail_log (slow query logs), polardbx_sls.slow_trans_log (slow transaction logs), and polardbx_sls.sql_audit_log (audit logs). Multi-statement queries, write operations, locks, user variables, dynamic placeholders, and reserved hints are not supported.

SELECT * FROM polardbx_sls.sql_audit_log LIMIT 100

MaxResultRows

integer

No

The maximum number of result rows to return for this request. Valid values: 1 to 1000. Default value: 100. The actual number of returned rows is also subject to the top-level LIMIT clause in the SQL statement and the current service policy.

1000

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID. This ID is used throughout the entire process from access, authentication, and routing to query completion, which facilitates end-to-end troubleshooting.

9B2F3840-****-475C-B269-2D5C3A31797C

QueryId

string

The unique identifier generated by the service for this JDBC query.

{\"NodeId\":\"n_7844571364614995969\"}

AccessDeniedDetail

object

The details about the access denial.

AuthAction

string

The authentication action.

polardbx:QueryColumnarLog

AuthPrincipalType

string

The type of the authentication principal.

222

AuthPrincipalOwnerId

string

The owner ID of the authentication principal.

111

AuthPrincipalDisplayName

string

The display name of the authentication principal.

Sample RAM user

PolicyType

string

The policy type.

PRIORITY

NoPermissionType

string

The type of the missing permission.

ImplicitDeny

EncodedDiagnosticMessage

string

The diagnostic information.

AQEAAAAAaKPfwjY0MzMyODRGLUZCQkQtNTA1RS04MUUxLTc5NTkzODk2MUIzMg==

Records

array<object>

The list of query results. Each row is a JSON key-value object that maps column names to text values. All scalars are returned as strings. SQL NULL is encoded as the string null, and empty strings remain as empty strings.

object

The list of download records.

string

A single column value in the query result. All scalars are returned as strings. SQL NULL is encoded as the string null. An empty string remains an empty string.

null

AppliedOffset

integer

The top-level SQL LIMIT offset that the service actually applied. The value is 0 if the SQL statement does not specify an offset.

0

AppliedRowLimit

integer

The maximum number of rows that the service actually returns after evaluating the top-level SQL LIMIT clause, MaxResultRows, the default value of the synchronous API, and the current service policy. This value does not include the extra row used to detect HasMore.

1000

ReturnedRowCount

integer

The actual number of result rows returned in this synchronous response.

100

HasMore

boolean

Indicates whether the service or API row limit truncated the SQL statement submitted by the caller. The value is false when the SQL statement with a smaller LIMIT clause is fully executed, which does not indicate that no more data exists in the underlying table.

False

RecordsSizeBytes

integer

The total number of UTF-8 bytes of the JSON objects across all returned rows, excluding the array and fixed response fields. The complete JSON response of the synchronous API is also subject to a 16 MiB upper limit.

8192

QueryElapsedTimeMilliseconds

integer

The elapsed time from the start of the JDBC statement execution to the completion of reading the last result row or probe row. Unit: milliseconds.

125

Examples

Success response

JSON format

{
  "RequestId": "9B2F3840-****-475C-B269-2D5C3A31797C",
  "QueryId": "{\\\"NodeId\\\":\\\"n_7844571364614995969\\\"}",
  "AccessDeniedDetail": {
    "AuthAction": "xxx",
    "AuthPrincipalType": "222",
    "AuthPrincipalOwnerId": "111",
    "AuthPrincipalDisplayName": "xxx",
    "PolicyType": "PRIORITY",
    "NoPermissionType": "ImplicitDeny",
    "EncodedDiagnosticMessage": "AQEAAAAAaKPfwjY0MzMyODRGLUZCQkQtNTA1RS04MUUxLTc5NTkzODk2MUIzMg=="
  },
  "Records": [
    {
      "key": "null"
    }
  ],
  "AppliedOffset": 0,
  "AppliedRowLimit": 1000,
  "ReturnedRowCount": 100,
  "HasMore": true,
  "RecordsSizeBytes": 8192,
  "QueryElapsedTimeMilliseconds": 125
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.