Skip to content

Query Executors

Query node executors implements the business logic of the execution of a query node, the part or the full command that was produced by the query planner.

amsdal_glue.executors.SchemaQueryNodeExecutor

Executes a node in the schema query tree.

This class implements the business logic for executing a single node of a schema query tree.

Methods:

Name Description
execute

SchemaQueryNode, transaction_id: str | None, lock_id: str | None) -> None: Executes the given schema query node.

execute

execute(query_node, transaction_id, lock_id)

Executes the given schema query node.

Parameters:

Name Type Description Default
query_node SchemaQueryNode

The schema query node to be executed.

required
transaction_id str | None

The transaction ID to be used during execution.

required
lock_id str | None

The lock ID to be used during execution.

required

amsdal_glue.executors.DataQueryNodeExecutor

Executes a node in the data query tree.

This class implements the business logic for executing a single node of a data query tree.

Methods:

Name Description
execute

DataQueryNode, transaction_id: str | None, lock_id: str | None) -> None: Executes the given data query node.

execute

execute(query, transaction_id, lock_id)

Executes the given data query node.

Parameters:

Name Type Description Default
query DataQueryNode

The data query node to be executed.

required
transaction_id str | None

The transaction ID to be used during execution.

required
lock_id str | None

The lock ID to be used during execution.

required

resolve_connection

resolve_connection(table, transaction_id)

Resolves the connection for the given table.

Parameters:

Name Type Description Default
table SchemaReference | SubQueryStatement

The table for which to resolve the connection.

required
transaction_id str | None

The transaction ID to be used during execution.

required

Returns:

Name Type Description
ConnectionBase ConnectionBase

The resolved connection.

amsdal_glue.executors.PolarsFinalQueryDataExecutor

Bases: PolarsFinalQueryDataExecutorMixin, FinalDataQueryExecutor

PolarsFinalQueryDataExecutor is responsible for executing final data queries using Polars.

This executor is used when the DefaultDataQueryPlanner splits the query to several subqueries and the FinalDataQueryTask is created.

Methods:

Name Description
execute

FinalDataQueryNode, transaction_id: str | None, lock_id: str | None) -> None: Executes the final data query node.

execute

execute(query_node, transaction_id, lock_id)

Executes the final data query using Polars.

Parameters:

Name Type Description Default
query_node FinalDataQueryNode

The node representing the final data query.

required
transaction_id str | None

The ID of the transaction.

required
lock_id str | None

The ID of the lock.

required