Executes an SQL query directly on the EventHouse associated with a Luma Agent and returns structured results. Unlike AskLuma, this operation executes the SQL provided by the caller without natural language rewriting.
Operation description
Executes an SQL query directly on the EventHouse associated with a Luma Agent and returns structured results. Unlike AskLuma, this operation executes the SQL provided by the caller without natural language rewriting.
Try it now
Test
RAM authorization
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| AgentName |
string |
Yes |
The name of the Agent. |
my_agent |
| Sql |
string |
Yes |
Only query statements are supported. |
SELECT * FROM my_table LIMIT 10 |
| MaxRows |
integer |
No |
Rows exceeding this limit are truncated. The IsTruncated field in the response indicates whether truncation occurred. |
100 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| Message |
string |
The message returned by the operation. The value is Operation success if the call succeeds, or a specific error description if the call fails. |
Operation success |
| RequestId |
string |
The unique identifier of the request. Use this ID for troubleshooting and when submitting a ticket. |
34AD682D-5B91-5773-8132-AA38C130**** |
| Data | ExecutionResult |
The execution result of the SQL query, including column definitions and row data. |
|
| Code |
string |
The response code of the operation. A value of Success indicates that the call succeeded. Otherwise, a specific error code is returned. |
Success |
| Success |
boolean |
Indicates whether the call is successful. A value of true indicates success. |
true |
Examples
Success response
JSON format
{
"Message": "Operation success",
"RequestId": "34AD682D-5B91-5773-8132-AA38C130****",
"Data": {
"IsTruncated": false,
"RowCount": 2,
"Rows": "[[\"Beijing\",120],[\"Shanghai\",98]]",
"Schema": [
{
"Name": "name",
"Type": "VARCHAR"
}
],
"TotalRows": 2
},
"Code": "Success",
"Success": true
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidParameter | The specified parameter is invalid | |
| 400 | ExecutionFailed | Query execution failed | |
| 403 | ServiceNotEnable | Service not enable | |
| 404 | AgentNotFound | Agent not found | |
| 404 | ResourceNotFound | The specified resource is not bound to the agent |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.