From ac12a626abe68d4afe6df35ffce10edf952cafe4 Mon Sep 17 00:00:00 2001
From: discord9 <55937128+discord9@users.noreply.github.com>
Date: Sat, 10 Oct 2026 11:40:45 +0800
Subject: [PATCH] fix: pass through native DataFusion optimizer options
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
---
docs/how-to/query-options.md | 4 +-
src/query/src/query_engine/state.rs | 8 +++-
src/query/src/sql.rs | 2 +-
src/session/src/query_options.rs | 58 ++++++++++++++++-------------
4 files changed, 42 insertions(+), 30 deletions(-)
diff --git a/docs/how-to/query-options.md b/docs/how-to/query-options.md
index e34c4e16d62..3fdaa55979d 100644
--- a/docs/how-to/query-options.md
+++ b/docs/how-to/query-options.md
@@ -7,9 +7,9 @@ Query options adjust selected behavior for a connection or request; they are not
| `query.parallelism` | `query_parallelism`, `query.parallelism` | Integer `1`–`1024`; server default `0` means automatic CPU-based parallelism. This is not a resource-pool limit. |
| `query.allow_query_fallback` | `query_fallback`, `allow_query_fallback`, `query.allow_query_fallback` (legacy `ALLOW_QUERY_FALLBACK` syntax / `query_fallback` hint also work) | `true` or `false` |
| `query.enable_remote_dynamic_filter_pushdown` | canonical name | `true` or `false` |
-| `datafusion.optimizer.*` | canonical name | Boolean; only `repartition_joins`, `repartition_aggregations`, `repartition_sorts`, `repartition_windows`, `enable_round_robin_repartition`, `prefer_existing_sort`, `prefer_hash_join`, `join_reordering`, `enable_topk_aggregation`, and `enable_dynamic_filter_pushdown` are supported. |
+| `datafusion.optimizer.*` | canonical name | Keys, types, defaults, and validation come from the linked DataFusion version (for example, numeric `max_passes` and Boolean `filter_null_join_keys`). |
-Use `SET query_parallelism = 4` or `SET query.parallelism TO 4`; `SHOW VARIABLES query.parallelism` works in MySQL and PostgreSQL, which also accepts `SHOW query.parallelism`. `SHOW VARIABLES