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

Fix panic #15

Closed
wants to merge 3 commits into from
Closed
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
46 changes: 17 additions & 29 deletions Cargo.lock

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

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ version = "0.1.0"
authors = ["IOx Project Developers"]
edition = "2021"
license = "MIT OR Apache-2.0"
resolver = "2"

[workspace.dependencies]
arrow = { version = "43.0.0" }
datafusion = { git = "https://github.com/CeresDB/arrow-datafusion.git", rev = "9c3a537e25e5ab3299922864034f67fb2f79805d", default-features = false }
datafusion = { git = "https://github.com/CeresDB/arrow-datafusion.git", rev = "053a42fa4", default-features = false }
hashbrown = { version = "0.13.2" }
2 changes: 1 addition & 1 deletion iox_query/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ snafu = "0.7"
tokio = { version = "1.27", features = ["macros", "parking_lot"] }
tokio-stream = "0.1"

[dev-dependencies]
[dev-dependencies]
insta = { version = "1", features = ["yaml"] }
7 changes: 6 additions & 1 deletion iox_query/src/logical_optimizer/handle_gapfill.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,12 @@ fn build_gapfill_node(
let time_column =
col(new_aggr_plan.schema().fields()[date_bin_gapfill_index].qualified_column());

let aggr = Aggregate::try_from_plan(&new_aggr_plan)?;
let LogicalPlan::Aggregate(aggr) = &new_aggr_plan else {
return Err(DataFusionError::Internal(format!(
"Expected Aggregate plan, got {}",
new_aggr_plan.display()
)));
};
let mut new_group_expr: Vec<_> = aggr
.schema
.fields()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use datafusion::{
DFSchema,
},
error::Result,
logical_expr::{expr::Alias, Between, BinaryExpr, LogicalPlan, Operator},
logical_expr::{Between, BinaryExpr, LogicalPlan, Operator},
optimizer::utils::split_conjunction,
prelude::{Column, Expr},
};
Expand Down Expand Up @@ -70,15 +70,6 @@ impl TreeNodeVisitor for TimeRangeVisitor {
}
}

fn unwrap_alias(mut e: &Expr) -> &Expr {
loop {
match e {
Expr::Alias(Alias { expr, .. }) => e = expr.as_ref(),
e => break e,
}
}
}

/// Encapsulates the upper and lower bounds of a time column
/// in a logical plan.
#[derive(Clone)]
Expand Down
9 changes: 7 additions & 2 deletions iox_query_influxql/src/plan/planner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use datafusion::logical_expr::logical_plan::Analyze;
use datafusion::logical_expr::utils::{expr_as_column_expr, find_aggregate_exprs};
use datafusion::logical_expr::{
binary_expr, col, date_bin, expr, expr::WindowFunction, lit, lit_timestamp_nano, now,
window_function, Aggregate, AggregateFunction, AggregateUDF, Between, BinaryExpr,
window_function, AggregateFunction, AggregateUDF, Between, BinaryExpr,
BuiltInWindowFunction, BuiltinScalarFunction, EmptyRelation, Explain, Expr, ExprSchemable,
Extension, LogicalPlan, LogicalPlanBuilder, Operator, PlanType, ScalarUDF, TableSource,
ToStringifiedPlan, WindowFrame, WindowFrameBound, WindowFrameUnits,
Expand Down Expand Up @@ -1230,7 +1230,12 @@ fn build_gap_fill_node(
)));
};

let aggr = Aggregate::try_from_plan(&input)?;
let LogicalPlan::Aggregate(aggr) = &input else {
return Err(DataFusionError::Internal(format!(
"Expected Aggregate plan, got {}",
input.display()
)));
};
let mut new_group_expr: Vec<_> = aggr
.schema
.fields()
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nightly-2023-02-02
nightly-2023-08-28
Loading