-
Notifications
You must be signed in to change notification settings - Fork 70
feat: implement transform ResultType #132
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
Conversation
We have seen quite a lot timeout from downloading thrift-0.20.0. Should we fix this in the Arrow repo to use more stable URL? @lidavidm @raulcd |
|
cc @gty404 |
src/iceberg/transform_function.cc
Outdated
| case TypeId::kUuid: | ||
| case TypeId::kFixed: | ||
| case TypeId::kBinary: | ||
| return std::make_shared<IntType>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you need to define a static variable to avoid creating a new object every time, or add a singleton to the corresponding type? The following return values are also similar.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 Sorry - I had also meant to but as you can see recently I don't have the time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to the singleton way, please take a look. @gty404
3511cdf to
d56f432
Compare
gty404
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The type objects in test can also be modified to singleton.
d56f432 to
bb47fb5
Compare
Yeah, that's an oversight, fixed. |
bb47fb5 to
41c92a6
Compare
src/iceberg/transform_function.cc
Outdated
| Result<std::shared_ptr<Type>> BucketTransform::ResultType() const { | ||
| return NotImplemented("BucketTransform::result_type"); | ||
| auto src_type = source_type(); | ||
| switch (src_type->type_id()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we check this in the Make function and blindly return int32() here? We can add static bool BucketTransform::Accepts(const std::shared_ptr<Type>& source_type). I'm open to discuss this but not a blocker for this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, changed to suggested, I didn't not add Accepts though.
No description provided.