Skip to content

Commit

Permalink
feat: Implement binding expression (apache#231)
Browse files Browse the repository at this point in the history
* feat: Implement binding expression
  • Loading branch information
liurenjie1024 authored and shaeqahmed committed Dec 9, 2024
1 parent 8d958b3 commit 7f1f9f6
Show file tree
Hide file tree
Showing 8 changed files with 667 additions and 27 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ chrono = "0.4"
derive_builder = "0.20.0"
either = "1"
env_logger = "0.11.0"
fnv = "1"
futures = "0.3"
iceberg = { version = "0.2.0", path = "./crates/iceberg" }
iceberg-catalog-rest = { version = "0.2.0", path = "./crates/catalog/rest" }
Expand Down
2 changes: 2 additions & 0 deletions crates/iceberg/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ keywords = ["iceberg"]
[dependencies]
anyhow = { workspace = true }
apache-avro = { workspace = true }
array-init = { workspace = true }
arrow-arith = { workspace = true }
arrow-array = { workspace = true }
arrow-schema = { workspace = true }
Expand All @@ -42,6 +43,7 @@ bytes = { workspace = true }
chrono = { workspace = true }
derive_builder = { workspace = true }
either = { workspace = true }
fnv = { workspace = true }
futures = { workspace = true }
itertools = { workspace = true }
lazy_static = { workspace = true }
Expand Down
10 changes: 10 additions & 0 deletions crates/iceberg/src/expr/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ use std::fmt::{Display, Formatter};

pub use term::*;
mod predicate;

use crate::spec::SchemaRef;
pub use predicate::*;

/// Predicate operators used in expressions.
Expand Down Expand Up @@ -147,6 +149,14 @@ impl PredicateOperator {
}
}

/// Bind expression to a schema.
pub trait Bind {
/// The type of the bound result.
type Bound;
/// Bind an expression to a schema.
fn bind(self, schema: SchemaRef, case_sensitive: bool) -> crate::Result<Self::Bound>;
}

#[cfg(test)]
mod tests {
use crate::expr::PredicateOperator;
Expand Down
Loading

0 comments on commit 7f1f9f6

Please sign in to comment.