Executes a read-only SQL statement to query internal EventHouse data within a specified time range. The time range only constrains the internal EventHouse data referenced in the SQL statement and does not affect mounted external data sources. Returns a structured result set.
Operation description
Executes a single read-only SQL statement and returns a structured result set. BeginTime and EndTime only constrain the internal EventHouse data referenced in the SQL statement and do not affect mounted external data sources.
Try it now
Test
RAM authorization
Request syntax
POST HTTP/1.1
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| Query |
string |
Yes |
The single read-only SQL statement to execute. You can query internal EventHouse data or perform federated queries with mounted external data sources. |
SELECT * FROM my_catalog.my_namespace.my_table LIMIT 100 |
| BeginTime |
integer |
Yes |
The start time for querying internal EventHouse data. Specify a UNIX timestamp in seconds. The time range includes this point in time. |
1787587200 |
| EndTime |
integer |
Yes |
The end time for querying internal EventHouse data. Specify a UNIX timestamp in seconds. The time range excludes this point in time. The value must be greater than BeginTime. |
1787590800 |
| Limit |
integer |
No |
The maximum number of result rows that can be returned for this query. |
100 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| Message |
string |
A success message if the call succeeds, or a specific error message if the call fails. |
success |
| RequestId |
string |
The unique ID of the request. You can use this ID for troubleshooting. |
34AD682D-5B91-5773-8132-AA38C130**** |
| Data |
object |
The structured result data returned by the SQL query. |
|
| Rows |
array |
The list of result rows returned by the SQL query. |
|
| Row |
A single result row that contains the name, type, value, and null flag of each column in the row. |
||
| Total |
integer |
The number of result rows actually returned by the query. |
1 |
| Code |
string |
The return code of the operation. Success indicates a successful call. Other values indicate specific error codes. |
Success |
| Success |
boolean |
Indicates whether the call is successful. A value of true indicates success. A value of false indicates failure. |
true |
Examples
Success response
JSON format
{
"Message": "success",
"RequestId": "34AD682D-5B91-5773-8132-AA38C130****",
"Data": {
"Rows": [
{
"Columns": [
{
"Name": "index",
"Type": "text",
"Value": "product_info",
"IsNull": false
}
]
}
],
"Total": 1
},
"Code": "Success",
"Success": true
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 403 | ServiceNotEnable | Service not enable |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.