Skip to content

update to SessionConfig #1234

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 11, 2025
Merged
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
9 changes: 8 additions & 1 deletion src/query/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ pub static QUERY_SESSION: Lazy<SessionContext> =
pub static QUERY_RUNTIME: Lazy<Runtime> =
Lazy::new(|| Runtime::new().expect("Runtime should be constructible"));


/// This function executes a query on the dedicated runtime, ensuring that the query is not isolated to a single thread/CPU
/// at a time and has access to the entire thread pool, enabling better concurrent processing, and thus quicker results.
pub async fn execute(
Expand Down Expand Up @@ -126,6 +125,14 @@ impl Query {
.execution
.use_row_number_estimates_to_optimize_partitioning = true;

//adding this config as it improves query performance as explained here -
// https://github.com/apache/datafusion/pull/13101
config
.options_mut()
.execution
.parquet
.schema_force_view_types = true;

let state = SessionStateBuilder::new()
.with_default_features()
.with_config(config)
Expand Down
Loading