You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "zeroshade (via GitHub)" <gi...@apache.org> on 2026/07/03 18:22:49 UTC
Re: [PR] fix(catalog/hadoop): load discovered metadata files [iceberg-go]
zeroshade commented on code in PR #1292:
URL: https://github.com/apache/iceberg-go/pull/1292#discussion_r3521378480
##########
catalog/hadoop/hadoop.go:
##########
@@ -457,27 +558,41 @@ func (c *Catalog) CreateTable(ctx context.Context, ident table.Identifier, sc *i
return tbl, nil
}
-func (c *Catalog) LoadTable(ctx context.Context, ident table.Identifier) (*table.Table, error) {
+func (c *Catalog) loadTable(ctx context.Context, ident table.Identifier) (*table.Table, int, error) {
if err := validateTableIdentifier(ident); err != nil {
- return nil, err
+ return nil, 0, err
}
- ver, err := c.findVersion(ident)
+ metaPath, version, err := c.findMetadataLocation(ident)
if err != nil {
- return nil, err
+ return nil, 0, err
+ }
+
+ tbl, err := table.NewFromLocation(ctx, ident, metaPath, io.LoadFSFunc(c.props, metaPath), c)
+ if err != nil {
+ return nil, 0, err
}
- metaPath := c.metadataFilePath(ident, ver)
+ return tbl, version, nil
+}
- return table.NewFromLocation(ctx, ident, metaPath, io.LoadFSFunc(c.props, metaPath), c)
+func (c *Catalog) LoadTable(ctx context.Context, ident table.Identifier) (*table.Table, error) {
+ tbl, _, err := c.loadTable(ctx, ident)
+
+ return tbl, err
}
func (c *Catalog) CheckTableExists(_ context.Context, ident table.Identifier) (bool, error) {
if err := validateTableIdentifier(ident); err != nil {
return false, nil
}
- return isTableDir(c.filesystem, c.isLocal, c.tableToPath(ident)), nil
+ exists, err := isTableDir(c.filesystem, c.isLocal, c.tableToPath(ident))
Review Comment:
Optional (non-blocking): `CheckTableExists` now propagates `isTableDir` errors, while `ListTables`/`ListNamespaces` intentionally swallow permission errors via `isTableDirForListing`. That strict-vs-tolerant split is defensible, but a one-line comment here explaining the distinction would save the next reader a double-take.
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org