zhjwpku commented on code in PR #82: URL: https://github.com/apache/iceberg-cpp/pull/82#discussion_r2051417742
########## src/iceberg/sort_order.cc: ########## @@ -21,14 +21,21 @@ #include <format> +#include "iceberg/constants.h" #include "iceberg/util/formatter.h" // IWYU pragma: keep namespace iceberg { -SortOrder::SortOrder(int64_t order_id, std::vector<SortField> fields) +SortOrder::SortOrder(int32_t order_id, std::vector<SortField> fields) : order_id_(order_id), fields_(std::move(fields)) {} -int64_t SortOrder::order_id() const { return order_id_; } +const std::shared_ptr<SortOrder>& SortOrder::Unsorted() { + static const std::shared_ptr<SortOrder> unsorted = + std::make_shared<SortOrder>(kInitialSortOrderId, std::vector<SortField>{}); Review Comment: ```suggestion std::make_shared<SortOrder>(kInitialSortOrderId - 1, std::vector<SortField>{}); ``` Java impl use 0 as UNSORTED_ORDER order_id, so here should minus 1. -- 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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org