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

Method set

datafusion/expr/src/execution_props.rs:214–232  ·  view source on GitHub ↗

Stores `value` in the slot at `index`.

(&self, index: SubqueryIndex, value: ScalarValue)

Source from the content-addressed store, hash-verified

212
213 /// Stores `value` in the slot at `index`.
214 pub fn set(&self, index: SubqueryIndex, value: ScalarValue) -> Result<()> {
215 let Some(slot) = self.slots.get(index.as_usize()) else {
216 return internal_err!(
217 "ScalarSubqueryResults: result index {} is out of bounds",
218 index.as_usize()
219 );
220 };
221
222 let mut slot = slot.lock().unwrap();
223 if slot.is_some() {
224 return internal_err!(
225 "ScalarSubqueryResults: result for index {} was already populated",
226 index.as_usize()
227 );
228 }
229 *slot = Some(value);
230
231 Ok(())
232 }
233
234 /// Clears all populated results so the container can be reused.
235 pub fn clear(&self) {

Calls 2

getMethod · 0.45
as_usizeMethod · 0.45

Tested by 2