transactions#

relationalai.api
#transactions

A view with information about transactions processed by RelationalAI (RAI) engines. Transactions include queries from RAI Python models and data stream batch processing. Requires the eng_user application role.

Columns#

NameTypeDescription
IDSTRINGThe unique identifier of the transaction.
DATABASE_NAMESTRINGThe name of the RAI Python model from which the transaction was sent.
STATESTRINGThe current state of the transaction. May be one of:
  • CREATED
  • QUEUED
  • RUNNING
  • CANCELING
  • COMPLETED
  • ABORTED
ABORT_REASONSTRINGThe reason the transaction was aborted, if applicable.
READ_ONLYBOOLEANWhether the transaction is read-only.
CREATED_BYSTRINGThe user who created the transaction.
DURATIONSTRINGThe duration of the transaction in milliseconds.
CREATED_ONTIMESTAMPThe timestamp when the transaction was created.
FINISHED_ATTIMESTAMPThe timestamp when the transaction was completed.
ENGINE_NAMESTRINGThe name of the engine that processed the transaction.

Transactions States#

Transactions can have the following states:

StateDescription
CREATEDThe transaction has been accepted but is not yet in the engine queue. If it remains in this state, the engine’s resources are at capacity. Consider increasing the engine size or cancelling the transaction and running it on a different engine.
QUEUEDThe transaction is in the engine’s queue. If it remains in this state, the engine’s concurrency limit has been reached. Wait for the transaction to leave the queue or cancel it and rerun on a different engine.
RUNNINGThe transaction is being processed by the engine.
CANCELINGThe transaction is being cancelled.
COMPLETEDThe transaction has been successfully processed.
ABORTEDThe transaction was cancelled or aborted due to an error. Check the ABORT_REASON field for more details.

Example#

Use the api.transactions view to get details about transactions processed by RAI engines:

#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.

See Also#