tanmayrauth commented on code in PR #1524:
URL: https://github.com/apache/iceberg-go/pull/1524#discussion_r3650593554
##########
catalog/hadoop/hadoop_test.go:
##########
@@ -1062,15 +1062,22 @@ func (s *HadoopCatalogTestSuite)
TestListNamespacesEmpty() {
}
func (s *HadoopCatalogTestSuite) TestListNamespacesNested() {
- parentDir := filepath.Join(s.warehouse, "a")
- s.Require().NoError(os.MkdirAll(filepath.Join(parentDir, "child1"),
0o755))
- s.Require().NoError(os.MkdirAll(filepath.Join(parentDir, "child2"),
0o755))
+ ctx := context.Background()
+ parent := table.Identifier{"a"}
+ expected := []table.Identifier{{"a", "child1"}, {"a", "child2"}}
Review Comment:
This only exercises a depth-1 parent, so it can't tell "prepend the full
parent" apart from "prepend just the last parent component" — both yield
["a","child1"]. A future change that qualified with parent[len-1] instead of
the whole slice would keep this test green while breaking any 2+level namespace
(listing ["a","child1"] would return ["child1","grandchild"] instead of
["a","child1","grandchild"], and the CheckNamespaceExists round-trip would then
fail against the real tree). Add a two-level case: create
["a","child1","grandchild"], then assert ListNamespaces(ctx, ["a","child1"])
returns exactly [["a","child1","grandchild"]] and round-trips through
CheckNamespaceExists. That ocks down the full-prefix behavior the fix on
hadoop.go:1064 introduces.
--
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]