chore: per review

Signed-off-by: discord9 <discord9@163.com>
This commit is contained in:
discord9
2025-06-12 17:29:36 +08:00
parent 0eca6333e5
commit 41e97a0657
2 changed files with 3 additions and 3 deletions

View File

@@ -478,6 +478,8 @@ impl QueryEngine for DatafusionQueryEngine {
fn engine_context(&self, query_ctx: QueryContextRef) -> QueryEngineContext {
let mut state = self.state.session_state();
state.config_mut().set_extension(query_ctx.clone());
// note that hints in "x-greptime-hints" is automatically parsed
// and set to query context's extension, so we can get it from query context.
if let Some(parallelism) = query_ctx.extension("query_parallelism") {
if let Ok(n) = parallelism.parse::<u64>() {
let new_cfg = state.config().clone().with_target_partitions(n as usize);

View File

@@ -18,7 +18,7 @@ pub const HINTS_KEY_PREFIX: &str = "x-greptime-hint-";
pub const READ_PREFERENCE_HINT: &str = "read_preference";
pub const HINT_KEYS: [&str; 8] = [
pub const HINT_KEYS: [&str; 7] = [
"x-greptime-hint-auto_create_table",
"x-greptime-hint-ttl",
"x-greptime-hint-append_mode",
@@ -26,6 +26,4 @@ pub const HINT_KEYS: [&str; 8] = [
"x-greptime-hint-physical_table",
"x-greptime-hint-skip_wal",
"x-greptime-hint-read_preference",
// same as `query.parallelism` in query options, but only for this query
"x-greptime-hint-query_parallelism",
];