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} (time is 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:

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:

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_output_stream

Append a stream to the output stream list.

omni_project_op_builder_append_input_stream

Append a stream to the input stream list.

omni_project_op_builder_filter_input_with_sql

Create a node to apply an SQL filter.

omni_project_op_builder_union_inputs

Create a node representing the union of two input nodes.

omni_project_op_builder_join_inputs

Create a node representing the join of two input nodes.

omni_project_op_builder_set_source_input

Set the input node used by the projection stage.

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.

omni_project_op_builder_get_name
No description available.

omni_project_op_builder_set_name
No description available.

Properties

Omni.ProjectOpBuilder:name

Set or get a friendly name to distinguish operators.

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
void (* append_output_stream) (
    OmniProjectOpBuilder* self,
    gint32 stream_handle,
    OmniProjectOutputStreamBuilder** builder
  )
 

No description available.

append_input_stream
guint (* append_input_stream) (
    OmniProjectOpBuilder* self,
    gint32 stream_handle,
    const gchar* time_field,
    OmniProjectInputStreamBuilder** builder
  )
 

No description available.

filter_input_with_sql
guint (* filter_input_with_sql) (
    OmniProjectOpBuilder* self,
    guint input_node,
    const gchar* sql,
    OmniProjectFilterBuilder** builder
  )
 

No description available.

union_inputs
guint (* union_inputs) (
    OmniProjectOpBuilder* self,
    guint input_node1,
    guint input_node2,
    OmniProjectUnionBuilder** builder
  )
 

No description available.

join_inputs
guint (* join_inputs) (
    OmniProjectOpBuilder* self,
    guint input_node1,
    guint input_node2,
    OmniProjectJoinBuilder** builder
  )
 

No description available.

set_source_input
void (* set_source_input) (
    OmniProjectOpBuilder* self,
    guint input_node
  )
 

No description available.

append_field_copy_all
void (* append_field_copy_all) (
    OmniProjectOpBuilder* self,
    guint input_stream_index
  )
 

No description available.

append_field_copy
void (* append_field_copy) (
    OmniProjectOpBuilder* self,
    guint input_stream_index,
    const gchar* name,
    OmniProjectFieldBuilder** builder
  )
 

No description available.

append_field_with_sql
void (* append_field_with_sql) (
    OmniProjectOpBuilder* self,
    const gchar* sql,
    OmniProjectFieldBuilder** builder
  )
 

No description available.

get_name
const gchar* (* get_name) (
    OmniProjectOpBuilder* self
  )
 

No description available.

set_name
void (* set_name) (
    OmniProjectOpBuilder* self,
    const gchar* value
  )
 

No description available.

Virtual methods

Omni.ProjectOpBuilder.append_output_stream

Append a stream to the output stream list.

Omni.ProjectOpBuilder.append_input_stream

Append a stream to the input stream list.

Omni.ProjectOpBuilder.filter_input_with_sql

Create a node to apply an SQL filter.

Omni.ProjectOpBuilder.union_inputs

Create a node representing the union of two input nodes.

Omni.ProjectOpBuilder.join_inputs

Create a node representing the join of two input nodes.

Omni.ProjectOpBuilder.set_source_input

Set the input node used by the projection stage.

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.

Omni.ProjectOpBuilder.get_name
No description available.

Omni.ProjectOpBuilder.set_name
No description available.