zeroshade commented on code in PR #2749:
URL: https://github.com/apache/iceberg-go/pull/2749#discussion_r4743480951


##########
table/compaction/eq_delete_decision.go:
##########
@@ -42,7 +40,13 @@ type SurvivorSurvey struct {
        PartMinSeq      map[string]int64

Review Comment:
   nit: the key format of this exported map changes (`1000=val;` → 
`1000:s:3:val;`). `DecideDeadEqualityDeletes` only takes the minimum over all 
buckets, so behavior is unchanged. But this is documented as the "original 
survey layout", so external code that reads or fills keys would see different 
strings. Either say here that the keys are opaque, or mention the change in the 
release note.



##########
website/src/releases.md:
##########
@@ -87,6 +87,7 @@ Per-release notes (highlights, breaking changes, 
contributors) are published on
 - **Out-of-range nanosecond timestamp strings are rejected.** String literals 
for `timestamp_ns` and `timestamptz_ns` outside the signed 64-bit nanosecond 
range now fail expression binding with `ErrBadCast`. Scans and 
`ExpressionEvaluator` return the error for these filters instead of comparing a 
wrapped value.
 - **`VisitBoundPredicateRef` is removed.** It was meant only for evaluators 
inside iceberg-go. Visitors in other modules should call `VisitBoundPredicate`, 
which passes `VisitIn` and `VisitNotIn` a detached copy of the predicate's 
literal set, as before.
 - **Empty string partition bounds are written as non-null bytes.** New 
manifests preserve empty string lower and upper bounds, fixing filtered scans 
on identity partitions. Manifests written before this fix may retain null 
bounds for an empty string and can continue to skip matching rows until 
rewritten.
+- **Bin-pack compaction rejects mixed partition groups.** 
`ExecuteCompactionGroup` returns `table.ErrInvalidOperation` if a bin-pack 
group contains files from different partitions or partition specs.

Review Comment:
   nit: this covers the new `ExecuteCompactionGroup` error, but not that 
`PlanCompaction` now groups partitions differently (previously colliding 
partitions are split) or that it can now return an error for unsupported 
partition value types. Worth a sentence.



##########
table/compaction/partition_key_collision_external_test.go:
##########
@@ -0,0 +1,148 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package compaction_test
+
+import (
+       "math"
+       "testing"
+
+       "github.com/apache/iceberg-go"
+       "github.com/apache/iceberg-go/table"
+       "github.com/apache/iceberg-go/table/compaction"
+       "github.com/stretchr/testify/assert"
+       "github.com/stretchr/testify/require"
+)
+
+func TestPlanCompactionSeparatesAmbiguousPartitionKeys(t *testing.T) {

Review Comment:
   nit: this file and `partition_tuple_test.go` both test that keys don't 
collide. Now that the encoding lives in `table/internal`, its key-level tests 
(`AppendPartitionTuple`/`CanonicalPartitionKey`) belong there, and the 
compaction tests only need to cover planner and survey behavior.



-- 
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]

Reply via email to