MCPcopy Create free account
hub / github.com/apache/datafusion / update

Method update

datafusion/expr/src/window_state.rs:86–102  ·  view source on GitHub ↗
(
        &mut self,
        out_col: &ArrayRef,
        partition_batch_state: &PartitionBatchState,
    )

Source from the content-addressed store, hash-verified

84 }
85
86 pub fn update(
87 &mut self,
88 out_col: &ArrayRef,
89 partition_batch_state: &PartitionBatchState,
90 ) -> Result<()> {
91 self.last_calculated_index += out_col.len();
92 // no need to use concat if the current `out_col` is empty
93 if self.out_col.is_empty() {
94 self.out_col = Arc::clone(out_col);
95 } else {
96 self.out_col = concat(&[&self.out_col, &out_col])?;
97 }
98 self.n_row_result_missing =
99 partition_batch_state.record_batch.num_rows() - self.last_calculated_index;
100 self.is_end = partition_batch_state.is_end;
101 Ok(())
102 }
103
104 pub fn new(out_type: &DataType) -> Result<Self> {
105 let empty_out_col = ScalarValue::try_from(out_type)?.to_array_of_size(0)?;

Callers 4

mainFunction · 0.45
spark_crc32_digestFunction · 0.45
invoke_with_argsMethod · 0.45
sha2_binary_bitlen_iterFunction · 0.45

Calls 3

concatFunction · 0.50
lenMethod · 0.45
is_emptyMethod · 0.45

Tested by

no test coverage detected