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


##########
catalog/rest/scan_task_partition_metadata_bench_test.go:
##########
@@ -0,0 +1,76 @@
+// 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 rest
+
+import (
+       "encoding/json"
+       "fmt"
+       "testing"
+
+       "github.com/apache/iceberg-go"
+)
+
+func BenchmarkDecodeScanTasksPrimitivePartitions(b *testing.B) {

Review Comment:
   Nit: both benchmarks in this file are copies of `BenchmarkDecodeScanTasks` 
in `scan_task_decoder_bench_test.go`, differing only in the spec/partition 
setup. Folding them into that benchmark as a partition-shape dimension (mixed / 
primitive / all-null × task count) keeps the decode benchmarks in the file that 
matches `scan_task_decoder.go`, avoids three copies of the same loop across two 
files, and keeps base-vs-PR comparisons under one benchmark name.



##########
catalog/rest/scan_task_decoder_test.go:
##########
@@ -740,12 +741,11 @@ func TestPartitionDecodePlanKeepsValuesIndependent(t 
*testing.T) {
        assert.Equal(t, []byte("ABCD"), second[1002])
        firstLogical[1001] = "changed"
        assert.NotContains(t, secondLogical, 1001)
-       firstFixed[1002] = 99
-       assert.NotContains(t, secondFixed, 1002)
+       assert.Nil(t, secondLogical)

Review Comment:
   Nit: with the lazy map, `secondLogical` is always nil for this input (its 
date is `null`), so mutating `firstLogical` and then checking `NotContains` 
can't detect aliasing anymore and is redundant with the `assert.Nil` below. 
Asserting the first map's contents is a more useful check here:
   
   ```suggestion
        assert.Equal(t, map[int]string{1001: atype.Date}, firstLogical)
        assert.Nil(t, secondLogical)
   ```



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