MCPcopy Create free account
hub / github.com/apache/paimon-rust / scan

Method scan

crates/integrations/datafusion/src/system_tables/options.rs:69–91  ·  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

67 }
68
69 async fn scan(
70 &self,
71 _state: &dyn Session,
72 projection: Option<&Vec<usize>>,
73 _filters: &[Expr],
74 _limit: Option<usize>,
75 ) -> DFResult<Arc<dyn ExecutionPlan>> {
76 // Java uses LinkedHashMap insertion order; HashMap has none — sort for stable output.
77 let mut entries: Vec<(&String, &String)> = self.table.schema().options().iter().collect();
78 entries.sort_by(|a, b| a.0.cmp(b.0));
79
80 let keys = StringArray::from_iter_values(entries.iter().map(|(k, _)| k.as_str()));
81 let values = StringArray::from_iter_values(entries.iter().map(|(_, v)| v.as_str()));
82
83 let schema = options_schema();
84 let batch = RecordBatch::try_new(schema.clone(), vec![Arc::new(keys), Arc::new(values)])?;
85
86 Ok(MemorySourceConfig::try_new_exec(
87 &[vec![batch]],
88 schema,
89 projection.cloned(),
90 )?)
91 }
92}

Callers

nothing calls this directly

Calls 5

options_schemaFunction · 0.85
cmpMethod · 0.80
iterMethod · 0.45
optionsMethod · 0.45
schemaMethod · 0.45

Tested by

no test coverage detected