Skip to content

Commit a9f890b

Browse files
committed
1
1 parent 1d45a6e commit a9f890b

3 files changed

Lines changed: 5 additions & 10 deletions

File tree

src/iceberg/update/update_properties.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,6 @@ class ICEBERG_EXPORT UpdateProperties : public PendingUpdate {
7171
Result<ApplyResult> Apply();
7272

7373
private:
74-
friend class Transaction;
75-
7674
explicit UpdateProperties(std::shared_ptr<Transaction> transaction);
7775

7876
std::unordered_map<std::string, std::string> updates_;

src/iceberg/update/update_sort_order.cc

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include <vector>
2525

2626
#include "iceberg/expression/term.h"
27+
#include "iceberg/result.h"
2728
#include "iceberg/sort_order.h"
2829
#include "iceberg/table_metadata.h"
2930
#include "iceberg/transaction.h"
@@ -52,24 +53,22 @@ UpdateSortOrder& UpdateSortOrder::AddSortField(const std::shared_ptr<Term>& term
5253
ICEBERG_BUILDER_CHECK(term->is_unbound(), "Term must be unbound");
5354

5455
ICEBERG_BUILDER_ASSIGN_OR_RETURN(auto schema, transaction_->current().Schema());
55-
56-
int32_t source_id;
57-
std::shared_ptr<Transform> transform;
58-
5956
if (term->kind() == Term::Kind::kReference) {
6057
// kReference is treated as identity transform
6158
auto named_ref = internal::checked_pointer_cast<NamedReference>(term);
6259
ICEBERG_BUILDER_ASSIGN_OR_RETURN(auto bound_ref,
6360
named_ref->Bind(*schema, case_sensitive_));
6461
sort_fields_.emplace_back(bound_ref->field_id(), Transform::Identity(), direction,
6562
null_order);
66-
} else {
67-
// kTransform - use the specified transform
63+
} else if (term->kind() == Term::Kind::kTransform) {
6864
auto unbound_transform = internal::checked_pointer_cast<UnboundTransform>(term);
6965
ICEBERG_BUILDER_ASSIGN_OR_RETURN(auto bound_term,
7066
unbound_transform->Bind(*schema, case_sensitive_));
7167
sort_fields_.emplace_back(bound_term->reference()->field_id(),
7268
unbound_transform->transform(), direction, null_order);
69+
} else {
70+
return AddError(ErrorKind::kNotSupported, "Not supported unbound term: {}",
71+
static_cast<int>(term->kind()));
7372
}
7473

7574
return *this;

src/iceberg/update/update_sort_order.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,6 @@ class ICEBERG_EXPORT UpdateSortOrder : public PendingUpdate {
7575
Result<ApplyResult> Apply();
7676

7777
private:
78-
friend class Transaction;
79-
8078
explicit UpdateSortOrder(std::shared_ptr<Transaction> transaction);
8179

8280
std::vector<SortField> sort_fields_;

0 commit comments

Comments
 (0)