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

Function from_table_source

datafusion/proto/src/logical_plan/mod.rs:369–385  ·  view source on GitHub ↗

converts [TableSource] to [LogicalPlan::TableScan] using [LogicalPlan::TableScan] was the best approach to serialize [TableSource] to [LogicalPlan::TableScan]

(
    table_name: TableReference,
    target: Arc<dyn TableSource>,
    extension_codec: &dyn LogicalExtensionCodec,
)

Source from the content-addressed store, hash-verified

367/// using [LogicalPlan::TableScan] was the best approach to
368/// serialize [TableSource] to [LogicalPlan::TableScan]
369fn from_table_source(
370 table_name: TableReference,
371 target: Arc<dyn TableSource>,
372 extension_codec: &dyn LogicalExtensionCodec,
373) -> Result<LogicalPlanNode> {
374 let projected_schema = target.schema().to_dfschema_ref()?;
375 let r = LogicalPlan::TableScan(TableScan {
376 table_name,
377 source: target,
378 projection: None,
379 projected_schema,
380 filters: vec![],
381 fetch: None,
382 });
383
384 LogicalPlanNode::try_from_logical_plan(&r, extension_codec)
385}
386
387impl AsLogicalPlan for LogicalPlanNode {
388 fn try_decode(buf: &[u8]) -> Result<Self>

Callers 1

try_from_logical_planMethod · 0.85

Calls 3

TableScanClass · 0.85
to_dfschema_refMethod · 0.80
schemaMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…