Interface
OmniProjectOpBuilder
Description
interface Omni.ProjectOpBuilder : GObject.Object
Defines the details of a projection operator in OmniPipelineBuilder.
Point-wise Operation
This operator requires that the primary partitioning key (PPK) of every
output stream be an exact copy of an input PPK.
To enforce this, the operator requires that the output PPK value is defined
via omni_project_op_builder_append_field_copy(), and its value must originate
from an input PPK field in all cases.
Furthermore, the intermediate result from every node must have at least one field eligible as an output PPK.
Example: Suppose the union of two input streams
{time, foo}and{bar, time}(timeis the PPK in both) is used as the projection input. This yields two output fields, but neither is suitable as an output PPK.
Input Graph
Each instance of OmniProjectOpBuilder owns an input node graph,
where each node represents an input stream or a set of input streams
combined in a particular way.
The following methods create input nodes:
omni_project_op_builder_append_input_stream()omni_project_op_builder_filter_input_with_sql()omni_project_op_builder_union_inputs()omni_project_op_builder_join_inputs()
Each node is represented by an opaque handle value that is only valid inside
the OmniProjectOpBuilder in which the node was created.
Note: A node handle can take any value. There is no value reserved to represent an invalid handle.
Each node except for an input stream can only be used by a single node.
One node is designated as the input to the final projection stage by calling
omni_project_op_builder_set_source_input().
Projection
The projection stage derives each output field’s value using provided expressions. The following methods define output fields:
omni_project_op_builder_append_field_copy_all()omni_project_op_builder_append_field_copy()omni_project_op_builder_append_field_with_sql()
If there is a type mismatch in an output field, the projection expression is implicitly converted to the output field type. Planning will fail if the conversion is not supported.
Multi-Output
This operator can be configured with multiple output streams. It operates as if an independent instance of the operator is created for each output stream. However, intermediate computation results are reused among different instances to reduce duplicated work, so a single multi-output operator is more efficient than using multiple single-output operators to achieve the same effect.
Currently, this is implemented by expanding a multi-output projection operator into single-output ones, so there is no performance benefit. Native multi-output support is planned in the future.
All instances behave identically by default. Operator components can be disabled for specific instances using the following properties:
SQL Column References
Field references are resolved against the operand of a filter node, or
against the source node in projection expressions.
"table[i]"."field" names a column whose value is fed by input stream i. The "table[i]" qualifier can be omitted when the field name is unambiguous.
Identifiers in a column reference must be double-quoted.
Supported SQL Subset
The following features can be used in SQL expressions in field and filter definitions:
- Deterministic scalar functions and operators
- Column references
- Literals
The following are not supported:
- Aggregation functions
- Window functions
- Subqueries
- Wildcards
UNNEST
Return Type Conventions
For convenience in simple cases, these methods return builder objects through optional out parameters. .
Prerequisite
In order to implement ProjectOpBuilder, your type must inherit fromGObject.
Instance methods
omni_project_op_builder_append_field_copy_all
Append fields derived by copying all field values from an input stream.
omni_project_op_builder_append_field_copy
Append a field derived by copying a named field from the specified input stream.
omni_project_op_builder_append_field_with_sql
Append an output field derived from input fields using a provided SQL expression.
Interface structure
struct OmniProjectOpBuilderIface {
void (* append_output_stream) (
OmniProjectOpBuilder* self,
gint32 stream_handle,
OmniProjectOutputStreamBuilder** builder
);
guint (* append_input_stream) (
OmniProjectOpBuilder* self,
gint32 stream_handle,
const gchar* time_field,
OmniProjectInputStreamBuilder** builder
);
guint (* filter_input_with_sql) (
OmniProjectOpBuilder* self,
guint input_node,
const gchar* sql,
OmniProjectFilterBuilder** builder
);
guint (* union_inputs) (
OmniProjectOpBuilder* self,
guint input_node1,
guint input_node2,
OmniProjectUnionBuilder** builder
);
guint (* join_inputs) (
OmniProjectOpBuilder* self,
guint input_node1,
guint input_node2,
OmniProjectJoinBuilder** builder
);
void (* set_source_input) (
OmniProjectOpBuilder* self,
guint input_node
);
void (* append_field_copy_all) (
OmniProjectOpBuilder* self,
guint input_stream_index
);
void (* append_field_copy) (
OmniProjectOpBuilder* self,
guint input_stream_index,
const gchar* name,
OmniProjectFieldBuilder** builder
);
void (* append_field_with_sql) (
OmniProjectOpBuilder* self,
const gchar* sql,
OmniProjectFieldBuilder** builder
);
const gchar* (* get_name) (
OmniProjectOpBuilder* self
);
void (* set_name) (
OmniProjectOpBuilder* self,
const gchar* value
);
}
No description available.
Interface members
append_output_stream |
|
No description available. |
|
append_input_stream |
|
No description available. |
|
filter_input_with_sql |
|
No description available. |
|
union_inputs |
|
No description available. |
|
join_inputs |
|
No description available. |
|
set_source_input |
|
No description available. |
|
append_field_copy_all |
|
No description available. |
|
append_field_copy |
|
No description available. |
|
append_field_with_sql |
|
No description available. |
|
get_name |
|
No description available. |
|
set_name |
|
No description available. |
Virtual methods
Omni.ProjectOpBuilder.append_field_copy_all
Append fields derived by copying all field values from an input stream.
Omni.ProjectOpBuilder.append_field_copy
Append a field derived by copying a named field from the specified input stream.
Omni.ProjectOpBuilder.append_field_with_sql
Append an output field derived from input fields using a provided SQL expression.