Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: bump proj4rs 0.1.4 #16474

Merged
merged 3 commits into from
Sep 21, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
157 changes: 66 additions & 91 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ iceberg = { version = "0.3.0" }
iceberg-catalog-hms = { version = "0.3.0" }
iceberg-catalog-rest = { version = "0.3.0" }
poem = { version = "3.0", features = ["openssl-tls", "multipart", "compression"] }
proj4rs = { version = "0.1.3", features = ["geo-types", "crs-definitions"] }
proj4rs = { version = "0.1.4", features = ["geo-types", "crs-definitions"] }
prometheus-client = "0.22"
prost = { version = "0.12.1" }
prost-build = { version = "0.12.1" }
Expand Down
1 change: 1 addition & 0 deletions src/query/sql/src/planner/binder/aggregate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ impl<'a> AggregateRewriter<'a> {
);

let replaced_agg = AggregateFunction {
span: aggregate.span,
display_name: aggregate.display_name.clone(),
func_name: aggregate.func_name.clone(),
distinct: aggregate.distinct,
Expand Down
1 change: 1 addition & 0 deletions src/query/sql/src/planner/binder/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ impl<'a> WindowRewriter<'a> {
replaced_args.push(replaced_arg.into());
}
WindowFuncType::Aggregate(AggregateFunction {
span: agg.span,
display_name: agg.display_name.clone(),
func_name: agg.func_name.clone(),
distinct: agg.distinct,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ impl SubqueryRewriter {
args.push(self.flatten_scalar(arg, correlated_columns)?);
}
Ok(ScalarExpr::AggregateFunction(AggregateFunction {
span: agg.span,
display_name: agg.display_name.clone(),
func_name: agg.func_name.clone(),
distinct: agg.distinct,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,7 @@ impl SubqueryRewriter {
group_items: vec![],
aggregate_functions: vec![ScalarItem {
scalar: AggregateFunction {
span: subquery.span,
display_name: "count(*)".to_string(),
func_name: "count".to_string(),
distinct: false,
Expand Down Expand Up @@ -641,6 +642,7 @@ impl SubqueryRewriter {
// For some cases, empty result set will be occur, we should return null instead of empty set.
// So let wrap an expression: `if(count()=0, null, any(subquery.output_column)`
let count_func = ScalarExpr::AggregateFunction(AggregateFunction {
span: subquery.span,
func_name: "count".to_string(),
distinct: false,
params: vec![],
Expand All @@ -652,6 +654,7 @@ impl SubqueryRewriter {
display_name: "count".to_string(),
});
let any_func = ScalarExpr::AggregateFunction(AggregateFunction {
span: subquery.span,
func_name: "any".to_string(),
distinct: false,
params: vec![],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ fn create_count_aggregate(mode: AggregateMode) -> Aggregate {
group_items: vec![],
aggregate_functions: vec![ScalarItem {
scalar: ScalarExpr::AggregateFunction(AggregateFunction {
span: None,
func_name: "count".to_string(),
distinct: false,
params: vec![],
Expand Down
14 changes: 12 additions & 2 deletions src/query/sql/src/planner/plans/scalar_expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,14 @@ impl ScalarExpr {
.into_option()?;
Some(Range { start, end })
}),
ScalarExpr::WindowFunction(expr) => expr.span,
ScalarExpr::AggregateFunction(expr) => expr.span,
ScalarExpr::LambdaFunction(expr) => expr.span,
ScalarExpr::CastExpr(expr) => expr.span.or(expr.argument.span()),
ScalarExpr::SubqueryExpr(expr) => expr.span,
ScalarExpr::UDFCall(expr) => expr.span,
ScalarExpr::UDFLambdaCall(expr) => expr.span,
_ => None,
ScalarExpr::AsyncFunctionCall(expr) => expr.span,
}
}

Expand Down Expand Up @@ -225,6 +228,10 @@ impl ScalarExpr {
self.evaluable = false;
Ok(())
}
fn visit_async_function_call(&mut self, _: &'a AsyncFunctionCall) -> Result<()> {
self.evaluable = false;
Ok(())
}
}

let mut visitor = EvaluableVisitor { evaluable: true };
Expand Down Expand Up @@ -595,8 +602,11 @@ impl<'a> TryFrom<&'a BinaryOperator> for ComparisonOp {
}
}

#[derive(Clone, PartialEq, Eq, Hash, Debug)]
#[derive(Clone, Debug, Educe)]
#[educe(PartialEq, Eq, Hash)]
pub struct AggregateFunction {
#[educe(PartialEq(ignore), Eq(ignore), Hash(ignore))]
pub span: Span,
pub func_name: String,
pub distinct: bool,
pub params: Vec<Scalar>,
Expand Down
1 change: 1 addition & 0 deletions src/query/sql/src/planner/semantic/type_check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1763,6 +1763,7 @@ impl<'a> TypeChecker<'a> {

let display_name = format!("{:#}", expr);
let new_agg_func = AggregateFunction {
span,
display_name,
func_name,
distinct: false,
Expand Down
Loading