Skip to content

Commit 506527d

Browse files
update to SessionConfig (#1234)
add `schema_force_view_types=true` in query session config as it improves query performance as explained here - apache/datafusion#13101
1 parent dbc2845 commit 506527d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/query/mod.rs

+8-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ pub static QUERY_SESSION: Lazy<SessionContext> =
6565
pub static QUERY_RUNTIME: Lazy<Runtime> =
6666
Lazy::new(|| Runtime::new().expect("Runtime should be constructible"));
6767

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

128+
//adding this config as it improves query performance as explained here -
129+
// https://github.com/apache/datafusion/pull/13101
130+
config
131+
.options_mut()
132+
.execution
133+
.parquet
134+
.schema_force_view_types = true;
135+
129136
let state = SessionStateBuilder::new()
130137
.with_default_features()
131138
.with_config(config)

0 commit comments

Comments
 (0)