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

feat: Project transform #309

Merged
merged 48 commits into from
Apr 5, 2024
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
8d014b1
add project bucket_unary
marvinlanhenke Mar 27, 2024
507caa2
add project bucket_binary
marvinlanhenke Mar 27, 2024
09eda3f
add project bucket_set
marvinlanhenke Mar 27, 2024
41f90f7
add project identity
marvinlanhenke Mar 27, 2024
73f1e3d
add project truncate
marvinlanhenke Mar 27, 2024
fd79c14
fixed array boundary
marvinlanhenke Mar 27, 2024
7885483
add project void
marvinlanhenke Mar 27, 2024
bb84d2b
add project unknown
marvinlanhenke Mar 27, 2024
a5dc6ef
add docs + none projections
marvinlanhenke Mar 27, 2024
bba3629
docs
marvinlanhenke Mar 27, 2024
066a69c
docs
marvinlanhenke Mar 27, 2024
ac86baa
remove trait + impl boundary on Datum
marvinlanhenke Mar 28, 2024
4f113b6
fix: clippy
marvinlanhenke Mar 28, 2024
3f99f38
fix: test Transform::Unknown
marvinlanhenke Mar 28, 2024
32aef76
add: transform_literal_result
marvinlanhenke Mar 28, 2024
736bb91
add: transform_literal_result
marvinlanhenke Mar 28, 2024
d476993
remove: whitespace
marvinlanhenke Mar 28, 2024
9385084
move `boundary` to transform.rs
marvinlanhenke Mar 28, 2024
9738416
add check if transform can be applied to data_type
marvinlanhenke Mar 28, 2024
912b195
add check
marvinlanhenke Mar 28, 2024
22c3f96
add: java-testsuite Transform::Bucket
marvinlanhenke Mar 28, 2024
44065a7
fix: clippy
marvinlanhenke Mar 28, 2024
27d5df8
add: timestamps to boundary
marvinlanhenke Mar 28, 2024
7bd5747
change: return bool from can_transform
marvinlanhenke Mar 29, 2024
5c66f96
fix: clippy
marvinlanhenke Mar 29, 2024
a8a7da6
refactor: fn project match structure
marvinlanhenke Mar 29, 2024
35d2699
add: java-testsuite Transform::Truncate
marvinlanhenke Mar 29, 2024
91cb1d4
add: java-testsuite Transform::Dates + refactor
marvinlanhenke Mar 30, 2024
4ccc3b2
fix: doc
marvinlanhenke Mar 30, 2024
1455ad3
add: timestamp test + refactor
marvinlanhenke Mar 30, 2024
868108c
refactor: simplify projected_boundary
marvinlanhenke Mar 30, 2024
e2b6e3f
add: java-testsuite Transform::Timestamp
marvinlanhenke Mar 30, 2024
7a4eb60
refactor tests
marvinlanhenke Mar 30, 2024
18a6db2
fix: timestamp conversion
marvinlanhenke Mar 31, 2024
b390d4b
fix: temporal test_result
marvinlanhenke Mar 31, 2024
a123fc1
basic fix
marvinlanhenke Apr 1, 2024
3483f33
change to Result<i32>
marvinlanhenke Apr 1, 2024
a55be8f
use try_unary
marvinlanhenke Apr 1, 2024
7ec4c79
Merge branch 'fix_day_timestamp_micro' into project_transform
marvinlanhenke Apr 1, 2024
014d793
add: java-testsuite Transform::Timestamp Hours
marvinlanhenke Apr 1, 2024
ab06022
refactor: split and move tests
marvinlanhenke Apr 1, 2024
d78e269
refactor: move transform tests
marvinlanhenke Apr 1, 2024
4f84a0e
remove self
marvinlanhenke Apr 2, 2024
eaacaa8
refactor: structure fn project + helpers
marvinlanhenke Apr 2, 2024
2bb2f95
fix: clippy
marvinlanhenke Apr 2, 2024
976d8c9
fix: typo
marvinlanhenke Apr 2, 2024
2961f98
Merge branch 'main' into project_transform
marvinlanhenke Apr 5, 2024
82e6244
fix: naming + generics
marvinlanhenke Apr 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 15 additions & 0 deletions crates/iceberg/src/expr/predicate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ impl<T> UnaryExpression<T> {
debug_assert!(op.is_unary());
Self { op, term }
}
pub(crate) fn op(&self) -> PredicateOperator {
self.op
}
}

/// Binary predicate, for example, `a > 10`.
Expand Down Expand Up @@ -144,6 +147,12 @@ impl<T> BinaryExpression<T> {
debug_assert!(op.is_binary());
Self { op, term, literal }
}
pub(crate) fn op(&self) -> PredicateOperator {
self.op
}
pub(crate) fn literal(&self) -> &Datum {
&self.literal
}
}

impl<T: Display> Display for BinaryExpression<T> {
Expand Down Expand Up @@ -191,6 +200,12 @@ impl<T> SetExpression<T> {
debug_assert!(op.is_set());
Self { op, term, literals }
}
pub(crate) fn op(&self) -> PredicateOperator {
self.op
}
pub(crate) fn literals(&self) -> &FnvHashSet<Datum> {
&self.literals
}
}

impl<T: Bind> Bind for SetExpression<T> {
Expand Down