Skip to content

Commit

Permalink
chore: bump proj4rs 0.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
b41sh committed Sep 19, 2024
1 parent 2c41faf commit 0b43e63
Show file tree
Hide file tree
Showing 9 changed files with 85 additions and 92 deletions.
153 changes: 64 additions & 89 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 @@ -332,6 +332,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 @@ -644,6 +645,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 @@ -655,6 +657,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

0 comments on commit 0b43e63

Please sign in to comment.