pub struct AggregateFunction {
pub function_reference: u32,
pub arguments: Vec<FunctionArgument>,
pub options: Vec<FunctionOption>,
pub output_type: Option<Type>,
pub phase: i32,
pub sorts: Vec<SortField>,
pub invocation: i32,
pub args: Vec<Expression>,
}
Expand description
An aggregate function.
Fields§
§function_reference: u32
Points to a function_anchor defined in this plan, which must refer to an aggregate function in the associated YAML file. Required; 0 is considered to be a valid anchor/reference.
arguments: Vec<FunctionArgument>
The arguments to be bound to the function. This must have exactly the number of arguments specified in the function definition, and the argument types must also match exactly:
- Value arguments must be bound using FunctionArgument.value, and the expression in that must yield a value of a type that a function overload is defined for.
- Type arguments must be bound using FunctionArgument.type, and a function overload must be defined for that type.
- Enum arguments must be bound using FunctionArgument.enum followed by Enum.specified, with a string that case-insensitively matches one of the allowed options.
- Optional enum arguments must be bound using FunctionArgument.enum followed by either Enum.specified or Enum.unspecified. If specified, the string must case-insensitively match one of the allowed options.
options: Vec<FunctionOption>
Options to specify behavior for corner cases, or leave behavior unspecified if the consumer does not need specific behavior in these cases.
output_type: Option<Type>
Must be set to the return type of the function, exactly as derived using the declaration in the extension.
phase: i32
Describes which part of the aggregation to perform within the context of distributed algorithms. Required. Must be set to INITIAL_TO_RESULT for aggregate functions that are not decomposable.
sorts: Vec<SortField>
If specified, the aggregated records are ordered according to this list before they are aggregated. The first sort field has the highest priority; only if a sort field determines two records to be equivalent is the next field queried. This field is optional.
invocation: i32
Specifies whether equivalent records are merged before being aggregated. Optional, defaults to AGGREGATION_INVOCATION_ALL.
args: Vec<Expression>
deprecated; use arguments instead
Implementations§
Source§impl AggregateFunction
impl AggregateFunction
Sourcepub fn phase(&self) -> AggregationPhase
pub fn phase(&self) -> AggregationPhase
Returns the enum value of phase
, or the default if the field is set to an invalid enum value.
Sourcepub fn set_phase(&mut self, value: AggregationPhase)
pub fn set_phase(&mut self, value: AggregationPhase)
Sets phase
to the provided enum value.
Sourcepub fn invocation(&self) -> AggregationInvocation
pub fn invocation(&self) -> AggregationInvocation
Returns the enum value of invocation
, or the default if the field is set to an invalid enum value.
Sourcepub fn set_invocation(&mut self, value: AggregationInvocation)
pub fn set_invocation(&mut self, value: AggregationInvocation)
Sets invocation
to the provided enum value.
Trait Implementations§
Source§impl Clone for AggregateFunction
impl Clone for AggregateFunction
Source§fn clone(&self) -> AggregateFunction
fn clone(&self) -> AggregateFunction
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for AggregateFunction
impl Debug for AggregateFunction
Source§impl Default for AggregateFunction
impl Default for AggregateFunction
§impl<'de> Deserialize<'de> for AggregateFunction
impl<'de> Deserialize<'de> for AggregateFunction
§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Source§impl Message for AggregateFunction
impl Message for AggregateFunction
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
.