iceberg-go
iceberg-go copied to clipboard
can you support delete table with param purge
Feature Request / Improvement
now ,i use the catalog of rest to drop table , got error:DropTable operation failed. S3 Tables only supports dropping tables with purge enabled.
You should be able to use catalog::PurgeTable instead:
func (r *Catalog) PurgeTable(ctx context.Context, identifier table.Identifier) error {
ns, tbl, err := splitIdentForPath(identifier)
if err != nil {
return err
}
uri := r.baseURI.JoinPath("namespaces", ns, "tables", tbl)
v := url.Values{}
v.Set("purgeRequested", "true")
uri.RawQuery = v.Encode()
_, err = doDelete[struct{}](ctx, uri, []string{}, r.cl,
map[int]error{http.StatusNotFound: catalog.ErrNoSuchTable})
return err
}