Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions datafusion-postgres-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use datafusion::execution::options::{
ArrowReadOptions, AvroReadOptions, CsvReadOptions, NdJsonReadOptions, ParquetReadOptions,
};
use datafusion::prelude::{SessionConfig, SessionContext};
use datafusion_postgres::pg_catalog::PgCatalogSchemaProvider;
use datafusion_postgres::{serve, ServerOptions}; // Assuming the crate name is `datafusion_postgres`
use structopt::StructOpt;

Expand Down Expand Up @@ -169,6 +170,13 @@ async fn setup_session_context(
println!("Loaded {} as table {}", table_path, table_name);
}

// Register pg_catalog
let pg_catalog = PgCatalogSchemaProvider::new(session_context.state().catalog_list().clone());
session_context
.catalog("datafusion")
.unwrap()
.register_schema("pg_catalog", Arc::new(pg_catalog))?;

Ok(())
}

Expand Down
1 change: 1 addition & 0 deletions datafusion-postgres/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
mod datatypes;
mod encoder;
mod handlers;
pub mod pg_catalog;

use std::sync::Arc;

Expand Down
Loading
Loading