shangxinli commented on code in PR #284:
URL: https://github.com/apache/iceberg-cpp/pull/284#discussion_r2485066826
##########
src/iceberg/sort_order.cc:
##########
@@ -38,10 +39,48 @@ int32_t SortOrder::order_id() const { return order_id_; }
std::span<const SortField> SortOrder::fields() const { return fields_; }
+bool SortOrder::Satisfies(const SortOrder& other) const {
+ // any ordering satisfies an unsorted ordering
+ if (other.IsUnsorted()) {
+ return true;
+ }
+
+ // this ordering cannot satisfy an ordering with more sort fields
+ if (fields_.size() < other.fields().size()) {
+ return false;
+ }
+
+ // this ordering has either more or the same number of sort fields
+ for (const auto& [field, other_field] : std::views::zip(fields_,
other.fields_)) {
Review Comment:
OK. Then we are good
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]