Summary
When the planner walks a filter expression to decide whether an index applies, match_restriction (crates/toasty/src/engine/index/index_match.rs:49) hits todo!() on a BinaryOp { lhs: ExprProject { .. }, op: =, rhs: String(..) }. This is the shape produced by lifting a belongs-to filter onto an embedded-field equality. Surfaces on the DynamoDB scan path; should likely be handled (or rejected with an error) instead of panicking.
Reproducer
crates/toasty-driver-integration-suite/src/tests/lift_belongs_to_complex_filter.rs:14 (lift_belongs_to_preserves_embedded_field_filter). Switch requires(sql) to requires(scan). Runs on DynamoDB and panics.
Additional context
panicked at crates/toasty/src/engine/index/index_match.rs:49:22:
not yet implemented: expr=ExprBinaryOp {
lhs: ExprProject {
base: [Column(ExprColumn { nesting: 0, table: 0, column: 1 })],
projection: Projection(0),
},
op: =,
rhs: String("Seattle"),
}
Backtrace:
2: match_restriction
at crates/toasty/src/engine/index/index_match.rs:49:22
3: build_index_matches
at crates/toasty/src/engine/index.rs:179:29
4: plan_index_path
Summary
When the planner walks a filter expression to decide whether an index applies,
match_restriction(crates/toasty/src/engine/index/index_match.rs:49) hitstodo!()on aBinaryOp { lhs: ExprProject { .. }, op: =, rhs: String(..) }. This is the shape produced by lifting a belongs-to filter onto an embedded-field equality. Surfaces on the DynamoDB scan path; should likely be handled (or rejected with an error) instead of panicking.Reproducer
crates/toasty-driver-integration-suite/src/tests/lift_belongs_to_complex_filter.rs:14(lift_belongs_to_preserves_embedded_field_filter). Switchrequires(sql)torequires(scan). Runs on DynamoDB and panics.Additional context
Backtrace: