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

Method try_pushdown_projection

datafusion/datasource-json/src/source.rs:212–222  ·  view source on GitHub ↗
(
        &self,
        projection: &ProjectionExprs,
    )

Source from the content-addressed store, hash-verified

210 }
211
212 fn try_pushdown_projection(
213 &self,
214 projection: &ProjectionExprs,
215 ) -> Result<Option<Arc<dyn FileSource>>> {
216 let mut source = self.clone();
217 let new_projection = self.projection.source.try_merge(projection)?;
218 let split_projection =
219 SplitProjection::new(self.table_schema.file_schema(), &new_projection);
220 source.projection = split_projection;
221 Ok(Some(Arc::new(source)))
222 }
223
224 fn projection(&self) -> Option<&ProjectionExprs> {
225 Some(&self.projection.source)

Callers

nothing calls this directly

Calls 4

newFunction · 0.85
try_mergeMethod · 0.80
cloneMethod · 0.45
file_schemaMethod · 0.45

Tested by

no test coverage detected