-
Notifications
You must be signed in to change notification settings - Fork 93
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
Implement project
for Transform
.
#264
Comments
@liurenjie1024 Here is what I would (high-level):
In order to implement the some pseudo-implementation to illustrate: impl Transform {
// ...
pub fn project(&self, name: String, pred: &BoundPredicate) -> Option<Predicate> {
match self {
Transform::Bucket(_) => match pred {
BoundPredicate::Unary(expr) => Some(Predicate::Unary(UnaryExpression::new(
expr.op(),
Reference::new(name),
))),
_ => unimplemented!(),
},
_ => unimplemented!(),
}
}
} #[test]
fn test_bucket_project() {
let trans = Transform::Bucket(8);
let name = "projected_name".to_string();
let field = NestedField::required(1, "a", Type::Primitive(PrimitiveType::Int));
let pred = BoundPredicate::Unary(UnaryExpression::new(
PredicateOperator::IsNull,
BoundReference::new("original_name", Arc::new(field)),
));
let result = trans.project(name, &pred).unwrap();
assert_eq!(format!("{result}"), "projected_name IS NULL");
} |
@marvinlanhenke Sorry for late reply. Yeah, this is exactly what I'm thinking about, thanks! |
thank you, once #283 is ready, I will continue here. |
@liurenjie1024 @ZENOTME Any suggestions/ preferences where to put those?
thanks for your thoughts on this EDIT: |
Hi, @marvinlanhenke Thanks for raising this. I prefer option no. 3 too with similar reason: putting related codes together helps to organize things better. |
+1 for no. 3 too |
See java implementation.
What's project used for? Say we have row filter
a = 10
, and we have a partition specbucket(a, 37) as bs
, if one row matchesa=10
, then its partition value should matchbucket(10, 37) as bs
, and we projecta=10
tobs = bucket(10, 37)
.Blocked by #283
The text was updated successfully, but these errors were encountered: