mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-06-01 04:40:39 +00:00
refactor: query config options (#6781)
* feat: refactor columnar and vector conversion Signed-off-by: Dennis Zhuang <killme2008@gmail.com> * feat: initialize config options from query context Signed-off-by: Dennis Zhuang <killme2008@gmail.com> * fix: failure tests Signed-off-by: Dennis Zhuang <killme2008@gmail.com> * chore: revert ColumnarValue::try_from_vector Signed-off-by: Dennis Zhuang <killme2008@gmail.com> --------- Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
This commit is contained in:
@@ -22,6 +22,7 @@ common-recordbatch.workspace = true
|
||||
common-session.workspace = true
|
||||
common-telemetry.workspace = true
|
||||
common-time.workspace = true
|
||||
datafusion-common.workspace = true
|
||||
derive_builder.workspace = true
|
||||
derive_more = { version = "1", default-features = false, features = ["debug"] }
|
||||
snafu.workspace = true
|
||||
|
||||
@@ -28,6 +28,7 @@ use common_recordbatch::cursor::RecordBatchStreamCursor;
|
||||
use common_telemetry::warn;
|
||||
use common_time::timezone::parse_timezone;
|
||||
use common_time::Timezone;
|
||||
use datafusion_common::config::ConfigOptions;
|
||||
use derive_builder::Builder;
|
||||
use sql::dialect::{Dialect, GenericDialect, GreptimeDbDialect, MySqlDialect, PostgreSqlDialect};
|
||||
|
||||
@@ -221,6 +222,13 @@ impl QueryContext {
|
||||
Arc::new(QueryContextBuilder::default().build())
|
||||
}
|
||||
|
||||
/// Create a new datafusion's ConfigOptions instance based on the current QueryContext.
|
||||
pub fn create_config_options(&self) -> ConfigOptions {
|
||||
let mut config = ConfigOptions::default();
|
||||
config.execution.time_zone = self.timezone().to_string();
|
||||
config
|
||||
}
|
||||
|
||||
pub fn with(catalog: &str, schema: &str) -> QueryContext {
|
||||
QueryContextBuilder::default()
|
||||
.current_catalog(catalog.to_string())
|
||||
|
||||
Reference in New Issue
Block a user