system.interfaces.query_processing.operators module

Abstract interface for query-processing operators.

class system.interfaces.query_processing.operators.Operator(parent: Self | None, children: list[Self] | None)[source]

Bases: ABC

Abstract operator interface to construct QEPs.

set_parent(parent: Self) → None[source]

Set the parent operator that this operator pushes its output tuples to.

Parameters:

parent – The parent operator to attach.

abstractmethod interpret_open() → None[source]

Interpreter: open() method in push-based iterator model, i.e., initializes the operator.

abstractmethod interpret_next(tup: dict) → None[source]

Interpreter: next() method in push-based iterator model, i.e., processes the given tuple and optionally pushes the next tuple to the parent operator. :param tup: Pushed tuple to process.

abstractmethod interpret_close() → None[source]

Interpreter: close() method in push-based iterator model, i.e., closes the operator. This may be used to free resources like temporary files.

abstractmethod compile(emit: str = None) → str[source]

Compiler: Compiles the QEP rooted at self into Python code. :param emit: Parent code to emit. :return: Compiled QEP.

abstractmethod dump(indent: int = 0) → None[source]

Prints the QEP rooted at self. :param indent: Indentation level.

static indent_emit_(emit: str, n: int = 1) → str[source]

Indents the given code to emit. :param emit: Code to emit. :param n: Indentation level. :return: Indented code to emit.

static indent_(n: int = 1) → str[source]

Creates an indentation. :param n: Indentation level. :return: Indentation.