Skip to content

Commit 83cdff4

Browse files
feat: Implement binding expression (#231)
* feat: Implement binding expression
1 parent 7a1cb12 commit 83cdff4

File tree

8 files changed

+668
-27
lines changed

8 files changed

+668
-27
lines changed

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ rust-version = "1.75.0"
3636
[workspace.dependencies]
3737
anyhow = "1.0.72"
3838
apache-avro = "0.16"
39+
array-init = "2"
3940
arrow-arith = { version = ">=46" }
4041
arrow-array = { version = ">=46" }
4142
arrow-schema = { version = ">=46" }
@@ -48,6 +49,7 @@ chrono = "0.4"
4849
derive_builder = "0.20.0"
4950
either = "1"
5051
env_logger = "0.11.0"
52+
fnv = "1"
5153
futures = "0.3"
5254
iceberg = { version = "0.2.0", path = "./crates/iceberg" }
5355
iceberg-catalog-rest = { version = "0.2.0", path = "./crates/catalog/rest" }

crates/iceberg/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ keywords = ["iceberg"]
3131
[dependencies]
3232
anyhow = { workspace = true }
3333
apache-avro = { workspace = true }
34+
array-init = { workspace = true }
3435
arrow-arith = { workspace = true }
3536
arrow-array = { workspace = true }
3637
arrow-schema = { workspace = true }
@@ -42,6 +43,7 @@ bytes = { workspace = true }
4243
chrono = { workspace = true }
4344
derive_builder = { workspace = true }
4445
either = { workspace = true }
46+
fnv = { workspace = true }
4547
futures = { workspace = true }
4648
itertools = { workspace = true }
4749
lazy_static = { workspace = true }

crates/iceberg/src/expr/mod.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ use std::fmt::{Display, Formatter};
2323

2424
pub use term::*;
2525
mod predicate;
26+
27+
use crate::spec::SchemaRef;
2628
pub use predicate::*;
2729

2830
/// Predicate operators used in expressions.
@@ -147,6 +149,14 @@ impl PredicateOperator {
147149
}
148150
}
149151

152+
/// Bind expression to a schema.
153+
pub trait Bind {
154+
/// The type of the bound result.
155+
type Bound;
156+
/// Bind an expression to a schema.
157+
fn bind(self, schema: SchemaRef, case_sensitive: bool) -> crate::Result<Self::Bound>;
158+
}
159+
150160
#[cfg(test)]
151161
mod tests {
152162
use crate::expr::PredicateOperator;

0 commit comments

Comments
 (0)