mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-01-04 12:22:55 +00:00
@@ -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);
|
||||
|
||||
@@ -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",
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user