relationalai.api.transactions
transactionsA view with information about transactions processed by RelationalAI (RAI) reasoners.
Transactions include queries from PyRel semantic models and data stream batch processing.
Requires the eng_user application role.
Columns
Section titled “Columns”| Name | Type | Description |
|---|---|---|
ID | STRING | The unique identifier of the transaction. |
DATABASE_NAME | STRING | The name of the RAI Python model from which the transaction was sent. |
STATE | STRING | The current state of the transaction. May be one of:
|
ABORT_REASON | STRING | The reason the transaction was aborted, if applicable. |
READ_ONLY | BOOLEAN | Whether the transaction is read-only. |
CREATED_BY | STRING | The user who created the transaction. |
DURATION | STRING | The duration of the transaction in milliseconds. |
CREATED_ON | TIMESTAMP | The timestamp when the transaction was created. |
FINISHED_AT | TIMESTAMP | The timestamp when the transaction was completed. |
ENGINE_NAME | STRING | The name of the reasoner that processed the transaction. |
Transactions States
Section titled “Transactions States”Transactions can have the following states:
| State | Description |
|---|---|
CREATED | The transaction has been accepted but is not yet in the reasoner queue. If it remains in this state, the reasoner’s resources are at capacity. Consider increasing the reasoner size or cancelling the transaction and running it on a different reasoner. |
QUEUED | The transaction is in the reasoner’s queue. If it remains in this state, the reasoner’s concurrency limit has been reached. Wait for the transaction to leave the queue or cancel it and rerun on a different reasoner. |
RUNNING | The transaction is being processed by the reasoner. |
CANCELING | The transaction is being cancelled. |
COMPLETED | The transaction has been successfully processed. |
ABORTED | The transaction was cancelled or aborted due to an error. Check the ABORT_REASON field for more details. |
Example
Section titled “Example”Use the api.transactions view to get details about transactions processed by RAI reasoners:
SELECT * FROM relationalai.api.transactions;/*+--------------------------------------+---------------+-----------+--------------+-----------+--------------------------+----------+-------------------------------+-------------------------------+--------------+ | ID | DATABASE_NAME | STATE | ABORT_REASON | READ_ONLY | CREATED_BY | DURATION | CREATED_ON | FINISHED_AT | ENGINE_NAME | |--------------------------------------+---------------+-----------+--------------+-----------+--------------------------+----------+-------------------------------+-------------------------------+--------------| | 02c8fa31-1234-5678-90ab-abcdef123456 | MyModel | COMPLETED | NULL | TRUE | john.doe@company.com | 7643 | 2024-10-28 08:00:12.123 -0700 | 2024-10-28 08:00:19.766 -0700 | john_doe | | 03d9ab41-2345-6789-01bc-bcdef2345678 | HRModel | COMPLETED | NULL | TRUE | maria.garcia@company.com | 500 | 2024-10-28 08:02:15.456 -0700 | 2024-10-28 08:02:15.956 -0700 | maria_garcia | | 04e8bc52-3456-7890-12cd-cdef34567890 | FinanceModel | ABORTED | Cancelled | FALSE | alex.smith@company.com | 3200 | 2024-10-28 08:05:00.789 -0700 | 2024-10-28 08:05:03.989 -0700 | alex_smith | +--------------------------------------+---------------+-----------+--------------+-----------+--------------------------+----------+-------------------------------+-------------------------------+--------------+ */To view transactions for a specific engine, filter the results by the ENGINE_NAME column:
SELECT * FROM relationalai.api.transactions WHERE ENGINE_NAME = 'john_doe';/*+--------------------------------------+---------------+-----------+--------------+-----------+--------------------------+----------+-------------------------------+-------------------------------+--------------+ | ID | DATABASE_NAME | STATE | ABORT_REASON | READ_ONLY | CREATED_BY | DURATION | CREATED_ON | FINISHED_AT | ENGINE_NAME | |--------------------------------------+---------------+-----------+--------------+-----------+--------------------------+----------+-------------------------------+-------------------------------+--------------| | 02c8fa31-1234-5678-90ab-abcdef123456 | MyModel | COMPLETED | NULL | TRUE | john.doe@company.com | 7643 | 2024-10-28 08:00:12.123 -0700 | 2024-10-28 08:00:19.766 -0700 | john_doe | +--------------------------------------+---------------+-----------+--------------+-----------+--------------------------+----------+-------------------------------+-------------------------------+--------------+ */See Compute Resources for more information on managing engines and transactions.