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

Method scan

datafusion-examples/examples/data_io/remote_catalog.rs:234–260  ·  view source on GitHub ↗
(
        &self,
        _state: &dyn Session,
        projection: Option<&Vec<usize>>,
        _filters: &[Expr],
        _limit: Option<usize>,
    )

Source from the content-addressed store, hash-verified

232 }
233
234 async fn scan(
235 &self,
236 _state: &dyn Session,
237 projection: Option<&Vec<usize>>,
238 _filters: &[Expr],
239 _limit: Option<usize>,
240 ) -> Result<Arc<dyn ExecutionPlan>> {
241 // Note that `scan` is called once the plan begin execution, and thus is
242 // async. When interacting with remote data sources, this is the place
243 // to begin establishing the remote connections and interacting with the
244 // remote storage system.
245 //
246 // As this example is just modeling the catalog API interface, we buffer
247 // the results locally in memory for simplicity.
248 let batches = self
249 .remote_catalog_interface
250 .read_data(&self.name)
251 .await?
252 .try_collect()
253 .await?;
254 let exec = MemorySourceConfig::try_new_exec(
255 &[batches],
256 self.schema.clone(),
257 projection.cloned(),
258 )?;
259 Ok(exec)
260 }
261}

Callers

nothing calls this directly

Calls 3

read_dataMethod · 0.80
cloneMethod · 0.45
clonedMethod · 0.45

Tested by

no test coverage detected