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


##########
schema.go:
##########
@@ -524,6 +524,33 @@ func (s *Schema) accessorForField(id int) (accessor, bool) 
{
        return acc, ok
 }
 
+// columnPathSegments returns the own-name path segments from the top-level 
column down to id, so a name containing '.' stays one segment.
+func (s *Schema) columnPathSegments(id int) []string {
+       idToField, err := s.lazyIDToField()

Review Comment:
   **major** — columnPathSegments — the actual dot-in-name fix — is guarded by 
no test, and the test that appears to guard it bypasses it
   
   The production fix for the dot-in-name bug lives in 
Schema.columnPathSegments (schema.go:528), which replaced 
strings.Split(FindColumnName(id), ".") at visitors.go:721. It has zero 
coverage. The new TestBuildExtractColumnDottedName 
(table/variant_shredded_write_test.go:1995) constructs `SourcePath: 
[]string{"a.b"}` by hand, so it never calls the producer; it only exercises 
descendByPath, which is unchanged in this delta. The fix is correct but free to 
silently regress, and the test name misrepresents what is covered. Ask: add a 
root-package test asserting columnPathSegments returns ["a.b"] for a top-level 
field named "a.b" and ["wrap.per","pay.load"] for the nested case (or assert 
SourcePath through TranslateColumnNamesForScan, which I confirmed yields 
["a.b"]).
   
   <details><summary>Evidence</summary>
   
   ```text
   Mutation 1: loop body -> 'return nil' unconditionally => `go test . 
-count=1` ok github.com/apache/iceberg-go 0.393s ; `go test ./table/ -count=1` 
ok github.com/apache/iceberg-go/table 8.266s. Mutation 2: body -> 
'strings.Split(s.FindColumnName(id), ".")' (old buggy behavior) => `go test .` 
ok 0.390s ; `go test ./table/` ok 6.916s. Both files restored; git status 
--porcelain empty.
   ```
   
   </details>



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