From 3efdea8dd8172f90182a15c9d3ef8f6fe1d39ed9 Mon Sep 17 00:00:00 2001 From: Dennis Zhuang Date: Tue, 28 May 2024 09:52:19 -0700 Subject: [PATCH] fix: compile error after rebeasing --- src/cmd/src/cli/repl.rs | 20 ++++---------------- src/cmd/src/error.rs | 9 ++++++++- 2 files changed, 12 insertions(+), 17 deletions(-) diff --git a/src/cmd/src/cli/repl.rs b/src/cmd/src/cli/repl.rs index a9e2e21967f9..74184d523985 100644 --- a/src/cmd/src/cli/repl.rs +++ b/src/cmd/src/cli/repl.rs @@ -37,7 +37,7 @@ use query::datafusion::DatafusionQueryEngine; use query::logical_optimizer::LogicalOptimizer; use query::parser::QueryLanguageParser; use query::plan::LogicalPlan; -use query::query_engine::QueryEngineState; +use query::query_engine::{DefaultSerializer, QueryEngineState}; use query::QueryEngine; use rustyline::error::ReadlineError; use rustyline::Editor; @@ -185,7 +185,7 @@ impl Repl { .context(PlanStatementSnafu)?; let plan = DFLogicalSubstraitConvertor {} - .encode(&plan) + .encode(&plan, DefaultSerializer) .context(SubstraitEncodeLogicalPlanSnafu)?; self.database.logical_plan(plan.to_vec()).await @@ -277,24 +277,12 @@ async fn create_query_engine(meta_addr: &str) -> Result { .build(), ); - let table_cache = layered_cache_registry - .get() - .context(error::CacheRequiredSnafu { - name: TABLE_CACHE_NAME, - })?; - let table_route_cache = layered_cache_registry - .get() - .context(error::CacheRequiredSnafu { - name: TABLE_ROUTE_CACHE_NAME, - })?; let catalog_manager = KvBackendCatalogManager::new( Mode::Distributed, Some(meta_client.clone()), cached_meta_backend.clone(), - table_cache, - table_route_cache, - ) - .await; + layered_cache_registry, + ); let plugins: Plugins = Default::default(); let state = Arc::new(QueryEngineState::new( catalog_manager, diff --git a/src/cmd/src/error.rs b/src/cmd/src/error.rs index f9ed6c5a4e39..fa5371545fcb 100644 --- a/src/cmd/src/error.rs +++ b/src/cmd/src/error.rs @@ -312,6 +312,13 @@ pub enum Error { source: common_runtime::error::Error, }, + #[snafu(display("Failed to get cache from cache registry: {}", name))] + CacheRequired { + #[snafu(implicit)] + location: Location, + name: String, + }, + #[snafu(display("Failed to build cache registry"))] BuildCacheRegistry { #[snafu(implicit)] @@ -372,7 +379,7 @@ impl ErrorExt for Error { Error::BuildRuntime { source, .. } => source.status_code(), - Error::BuildCacheRegistry { .. } => StatusCode::Internal, + Error::CacheRequired { .. } | Error::BuildCacheRegistry { .. } => StatusCode::Internal, } }