Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 5 additions & 107 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 0 additions & 8 deletions src/binaries/query/cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,4 @@ impl Cmd {
pub enum Commands {
#[command(about = "Print version and quit")]
Ver,
Local {
#[clap(long, short = 'q', default_value_t)]
query: String,
#[clap(long, default_value_t)]
output_format: String,
#[clap(long, short = 'c')]
config: String,
},
}
20 changes: 0 additions & 20 deletions src/binaries/query/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ use databend_common_version::DATABEND_GIT_SHA;
use databend_common_version::DATABEND_SEMVER;
use databend_query::clusters::ClusterDiscovery;
use databend_query::history_tables::GlobalHistoryLog;
use databend_query::local;
use databend_query::servers::admin::AdminService;
use databend_query::servers::flight::FlightService;
use databend_query::servers::metrics::MetricService;
Expand All @@ -53,31 +52,12 @@ use super::cmd::Commands;
pub struct MainError;

pub async fn run_cmd(cmd: &Cmd) -> Result<bool, MainError> {
let make_error = || "failed to run cmd";

match &cmd.subcommand {
None => return Ok(false),
Some(Commands::Ver) => {
println!("version: {}", *DATABEND_SEMVER);
println!("min-compatible-metasrv-version: {}", MIN_METASRV_SEMVER);
}
Some(Commands::Local {
query,
output_format,
config,
}) => {
let mut cmd = cmd.clone();
if !config.is_empty() {
cmd.config_file = config.to_string();
}
let conf = cmd
.init_inner_config(false)
.await
.with_context(make_error)?;
local::query_local(conf, query, output_format)
.await
.with_context(make_error)?
}
}

Ok(true)
Expand Down
8 changes: 4 additions & 4 deletions src/query/expression/src/evaluator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2127,7 +2127,7 @@ impl<'a, Index: ColumnIndex> ConstantFolder<'a, Index> {
let block = DataBlock::empty_with_rows(1);
let evaluator = Evaluator::new(&block, self.func_ctx, self.fn_registry);
// Since we know the expression is constant, it'll be safe to change its column index type.
let cast_expr = cast_expr.project_column_ref(|_| unreachable!());
let cast_expr = cast_expr.project_column_ref(|_| unreachable!()).unwrap();
if let Ok(Value::Scalar(scalar)) = evaluator.run(&cast_expr) {
return (
Expr::Constant(Constant {
Expand Down Expand Up @@ -2260,7 +2260,7 @@ impl<'a, Index: ColumnIndex> ConstantFolder<'a, Index> {
let block = DataBlock::empty_with_rows(1);
let evaluator = Evaluator::new(&block, self.func_ctx, self.fn_registry);
// Since we know the expression is constant, it'll be safe to change its column index type.
let func_expr = func_expr.project_column_ref(|_| unreachable!());
let func_expr = func_expr.project_column_ref(|_| unreachable!()).unwrap();
if let Ok(Value::Scalar(scalar)) = evaluator.run(&func_expr) {
return (
Expr::Constant(Constant {
Expand Down Expand Up @@ -2411,7 +2411,7 @@ impl<'a, Index: ColumnIndex> ConstantFolder<'a, Index> {
let block = DataBlock::empty_with_rows(1);
let evaluator = Evaluator::new(&block, self.func_ctx, self.fn_registry);
// Since we know the expression is constant, it'll be safe to change its column index type.
let func_expr = func_expr.project_column_ref(|_| unreachable!());
let func_expr = func_expr.project_column_ref(|_| unreachable!()).unwrap();
if let Ok(Value::Scalar(scalar)) = evaluator.run(&func_expr) {
return (
Expr::Constant(Constant {
Expand Down Expand Up @@ -2458,7 +2458,7 @@ impl<'a, Index: ColumnIndex> ConstantFolder<'a, Index> {
let block = DataBlock::empty_with_rows(1);
let evaluator = Evaluator::new(&block, self.func_ctx, self.fn_registry);
// Since we know the expression is constant, it'll be safe to change its column index type.
let func_expr = func_expr.project_column_ref(|_| unreachable!());
let func_expr = func_expr.project_column_ref(|_| unreachable!()).unwrap();
if let Ok(Value::Scalar(scalar)) = evaluator.run(&func_expr) {
return (
Expr::Constant(Constant {
Expand Down
Loading