Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import org.apache.iceberg.SortOrder;
import org.apache.iceberg.relocated.com.google.common.base.Preconditions;
import org.apache.iceberg.relocated.com.google.common.collect.ImmutableSet;
import org.apache.iceberg.util.SortOrderUtil;

/**
* A rewrite strategy for data files which aims to reorder data with data files to optimally lay them out
Expand All @@ -48,7 +49,8 @@ public abstract class SortStrategy extends BinPackStrategy {
* @return this for method chaining
*/
public SortStrategy sortOrder(SortOrder order) {
this.sortOrder = order;
Preconditions.checkArgument(!order.isUnsorted(), "Cannot set strategy sort order: unsorted");
this.sortOrder = SortOrderUtil.buildSortOrder(table(), order);
return this;
}

Expand Down