Skip to content

Commit

Permalink
fix: compile error after rebeasing
Browse files Browse the repository at this point in the history
  • Loading branch information
killme2008 committed May 28, 2024
1 parent 9184d68 commit 3efdea8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 17 deletions.
20 changes: 4 additions & 16 deletions src/cmd/src/cli/repl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -277,24 +277,12 @@ async fn create_query_engine(meta_addr: &str) -> Result<DatafusionQueryEngine> {
.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,
Expand Down
9 changes: 8 additions & 1 deletion src/cmd/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down Expand Up @@ -372,7 +379,7 @@ impl ErrorExt for Error {

Error::BuildRuntime { source, .. } => source.status_code(),

Error::BuildCacheRegistry { .. } => StatusCode::Internal,
Error::CacheRequired { .. } | Error::BuildCacheRegistry { .. } => StatusCode::Internal,
}
}

Expand Down

0 comments on commit 3efdea8

Please sign in to comment.