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

Class SQLContext

crates/integrations/datafusion/src/sql_context.rs:79–84  ·  view source on GitHub ↗

A SQL context that supports registering multiple Paimon catalogs and executing SQL. # Example ```ignore let mut ctx = SQLContext::new(); ctx.register_catalog("paimon", catalog).await?; ctx.set_current_catalog("paimon").await?; let df = ctx.sql("ALTER TABLE paimon.db.t ADD COLUMN age INT").await?; ```

Source from the content-addressed store, hash-verified

77/// let df = ctx.sql("ALTER TABLE paimon.db.t ADD COLUMN age INT").await?;
78/// ```
79pub struct SQLContext {
80 ctx: SessionContext,
81 catalogs: HashMap<String, Arc<dyn Catalog>>,
82 /// Session-scoped dynamic options set via `SET 'paimon.key' = 'value'`.
83 dynamic_options: DynamicOptions,
84}
85
86impl Default for SQLContext {
87 fn default() -> Self {

Calls

no outgoing calls