This is an automated email from the ASF dual-hosted git repository.
laskoviymishka pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iceberg-go.git
The following commit(s) were added to refs/heads/main by this push:
new fd7cf3d16 docs: make Getting Started runnable on a released version
(#2682)
fd7cf3d16 is described below
commit fd7cf3d16c182b7ed384352dd4a65d38fb3eb5dd
Author: kurtoskalac <[email protected]>
AuthorDate: Wed Nov 25 09:04:33 2026 +0100
docs: make Getting Started runnable on a released version (#2682)
Signed-off-by: Chimney Cake <[email protected]>
Co-authored-by: Chimney Cake
<[email protected]>
---
README.md | 2 +-
dev/release/README.md | 15 +-
website/src/api.md | 51 ++++++-
website/src/cli.md | 76 ++++++++--
website/src/getting-started.md | 312 ++++++++++++++---------------------------
website/src/how-to-release.md | 6 +-
website/src/install.md | 27 ++--
website/src/verify-release.md | 28 ++--
8 files changed, 261 insertions(+), 256 deletions(-)
diff --git a/README.md b/README.md
index ebe90193d..1ebcdc29f 100644
--- a/README.md
+++ b/README.md
@@ -25,7 +25,7 @@
### Prerequisites
-* Go 1.26 or later
+* Go 1.26.3 or later for builds from `main`. For a tagged release, see the Go
requirement in that tag's `go.mod`.
### Build
diff --git a/dev/release/README.md b/dev/release/README.md
index 6244a9131..1ab338d70 100644
--- a/dev/release/README.md
+++ b/dev/release/README.md
@@ -47,6 +47,7 @@ Requirements to run `release_rc.sh`:
* You must be an Apache Iceberg committer or PMC member
* You must prepare your PGP key for signing
+ * Install GitHub CLI, Subversion, and `sha512sum`.
If you don't have a PGP key,
https://infra.apache.org/release-signing.html#generate
may be helpful.
@@ -73,7 +74,8 @@ We need to do the following to publish a new release:
* Publish to apache.org
-Run `dev/release/release.sh` to publish to apache.org:
+Install a `sort` that supports `--version-sort`. Run
+`dev/release/release.sh` to publish to apache.org:
```console
$ GH_TOKEN=${YOUR_GITHUB_TOKEN} dev/release/release.sh ${VERSION} ${RC}
@@ -91,14 +93,17 @@ You must install the following to run the script:
* `gpg`
* `shasum` or `sha512sum`
* `tar`
+ * Java and Python 3 for the RAT license check
+ * `jq` if the script downloads Go
-You don't need to have Go installed, if it isn't on the system the latest Go
will be
-automatically downloaded and used only for verification.
+Use a Go toolchain that meets the requirement in the candidate's `go.mod`.
+If Go is unavailable, the script downloads a toolchain for verification.
-To verify a RC, run the following:
+To verify an RC, use a disposable module cache and keep `GITHUB_TOKEN` unset
+so it stays out of shell traces:
```console
-$ dev/release/verify_rc.sh ${VERSION} ${RC}
+$ env -u GITHUB_TOKEN GOMODCACHE="$(mktemp -d)" dev/release/verify_rc.sh
${VERSION} ${RC}
```
If the verification is successful, the message `RC looks good!` is shown.
diff --git a/website/src/api.md b/website/src/api.md
index 141e21630..d66eae2bc 100644
--- a/website/src/api.md
+++ b/website/src/api.md
@@ -19,7 +19,7 @@
# API
-The Go API surface for Apache Iceberg Go. New to the project? Walk through the
[Getting Started](./getting-started.md) tutorial first - the recipes here
assume you already have a catalog and a table.
+This reference follows the development branch of Apache Iceberg Go. New to the
project? Walk through the [Getting Started](./getting-started.md) tutorial
first - the recipes here assume you already have a catalog and a table.
For configuration knobs (catalog options, FileIO credentials, table
properties), see [Configuration](./configuration.md). For predicate
construction details, see [Row Filter Syntax](./row-filter-syntax.md) and
[Expression DSL](./expression-dsl.md).
@@ -40,12 +40,15 @@ import (
cat, err := rest.NewCatalog(context.Background(), "rest",
"http://localhost:8181",
rest.WithOAuthToken("your-token"))
+if err != nil { panic(err) }
+defer cat.Close()
```
#### SQL (SQLite, Postgres, MySQL, Oracle, MSSQL)
```go
import (
+ "context"
"database/sql"
"github.com/apache/iceberg-go"
@@ -54,29 +57,38 @@ import (
)
db, err := sql.Open(sqliteshim.ShimName, "file:catalog.db")
-// handle err
+if err != nil { panic(err) }
+defer db.Close()
cat, err := sqlcat.NewCatalog(context.Background(), "default", db,
sqlcat.SQLite, iceberg.Properties{
"warehouse": "file:///tmp/warehouse",
})
+if err != nil { panic(err) }
+defer cat.Close()
```
#### Glue
```go
import (
+ "context"
+
"github.com/apache/iceberg-go/catalog/glue"
"github.com/aws/aws-sdk-go-v2/config"
)
awsCfg, err := config.LoadDefaultConfig(context.TODO())
-// handle err
-cat := glue.NewCatalog(glue.WithAWSConfig(awsCfg))
+if err != nil { panic(err) }
+cat, err := glue.NewCatalog(glue.WithAWSConfig(awsCfg))
+if err != nil { panic(err) }
+defer cat.Close()
```
#### Hive
```go
import (
+ "context"
+
"github.com/apache/iceberg-go"
"github.com/apache/iceberg-go/catalog/hive"
)
@@ -84,18 +96,23 @@ import (
cat, err := hive.NewCatalog(context.Background(), iceberg.Properties{},
hive.WithURI("thrift://localhost:9083"),
hive.WithWarehouse("s3://my-bucket/warehouse"))
+if err != nil { panic(err) }
+defer cat.Close()
```
#### Hadoop
```go
import (
+ "context"
+
"github.com/apache/iceberg-go"
"github.com/apache/iceberg-go/catalog/hadoop"
- "context"
)
cat, err := hadoop.NewCatalog(context.Background(), "default",
"file:///tmp/warehouse", iceberg.Properties{})
+if err != nil { panic(err) }
+defer cat.Close()
```
#### Via the registry
@@ -106,6 +123,7 @@ cat, err := hadoop.NewCatalog(context.Background(),
"default", "file:///tmp/ware
import (
"github.com/apache/iceberg-go"
"github.com/apache/iceberg-go/catalog"
+ _ "github.com/apache/iceberg-go/catalog/rest"
)
cat, err := catalog.Load(ctx, "default", iceberg.Properties{
@@ -139,6 +157,9 @@ err = cat.DropNamespace(ctx, ns)
`table.Identifier` is `[]string`; use `catalog.ToIdentifier("sales",
"orders")` (or `catalog.ToIdentifier("sales.orders")`) to build one from string
parts.
+Use `errors.Is(err, catalog.ErrNamespaceAlreadyExists)` to recognize an
+existing namespace when retrying creation.
+
### Tables
#### Defining a schema
@@ -661,7 +682,10 @@ and [manifest
specification](https://iceberg.apache.org/spec/#manifests).
### Branches and tags
-The CLI's `branch create` and `tag create` commands ([CLI](./cli.md)) are the
most ergonomic surface today. Programmatically, ref creation goes through
`Catalog.CommitTable` with a `SetSnapshotRef` update:
+To create a branch or tag at an existing snapshot, use `branch create` or
+`tag create` in the [CLI](./cli.md). In Go, call `Catalog.CommitTable` with
+`table.NewSetSnapshotRefUpdate` to choose the starting snapshot and any
retention
+settings. This example uses the table's current snapshot:
```go
import "github.com/apache/iceberg-go/table"
@@ -683,7 +707,20 @@ reqs := []table.Requirement{
_, _, err := cat.CommitTable(ctx, tbl.Identifier(), reqs,
[]table.Update{update})
```
-Constants `table.MainBranch`, `table.BranchRef`, `table.TagRef` live in
[`table/refs.go`](https://github.com/apache/iceberg-go/blob/main/table/refs.go).
A higher-level builder is on the roadmap.
+To create a branch with its first append, target it with
+`tbl.NewTransactionOnBranch`. The append starts from `main` if the branch is
+missing and creates the branch on commit. An append to an existing branch
+builds on that branch's head:
+
+```go
+txn, err := tbl.NewTransactionOnBranch("audit")
+if err != nil { /* ... */ }
+if err := txn.AppendTable(ctx, arrowTbl, 1024, nil); err != nil { /* ... */ }
+updated, err := txn.Commit(ctx)
+```
+
+See [reading from a branch or tag](#reading-from-a-branch-or-tag) to scan
+the updated ref.
### Branch promotion and replacement
diff --git a/website/src/cli.md b/website/src/cli.md
index 637125c6e..e1cce8e9e 100644
--- a/website/src/cli.md
+++ b/website/src/cli.md
@@ -19,10 +19,23 @@
# CLI
-Run `go build ./cmd/iceberg` from the root of this repository to build the CLI
executable, alternately you can run `go install
github.com/apache/iceberg-go/cmd/iceberg` to install it to the `bin` directory
of your `GOPATH`.
+Install the latest released CLI:
-The `iceberg` CLI usage is very similar to [pyiceberg
CLI](https://py.iceberg.apache.org/cli/). \
-You can pass the catalog URI with the `--uri` argument.
+```sh
+go install github.com/apache/iceberg-go/cmd/iceberg@latest
+```
+
+This page follows `main`. To run the examples against that branch, use:
+
+```sh
+go install github.com/apache/iceberg-go/cmd/iceberg@main
+iceberg --version
+```
+
+Go installs the binary in `GOBIN` or, by default, in `$(go env GOPATH)/bin`.
+Add that directory to `PATH` to use the examples below. From a source
+checkout, `go build ./cmd/iceberg` builds a local binary. For v0.7.0, see
+[the CLI guide at that
tag](https://github.com/apache/iceberg-go/blob/v0.7.0/website/src/cli.md).
## Connecting to a catalog
@@ -33,7 +46,7 @@ docker run -p 8181:8181 apache/iceberg-rest-fixture:latest
```
and run the `iceberg` CLI pointing to the REST API server:
```
- ./iceberg --uri http://0.0.0.0:8181 list
+iceberg --uri http://localhost:8181 list
┌─────┐
| IDs |
| --- |
@@ -88,12 +101,12 @@ All commands accept `--output text` (default,
human-readable) or `--output json`
**Create namespace**
```
-./iceberg --uri http://0.0.0.0:8181 create namespace taxitrips
+iceberg --uri http://localhost:8181 create namespace taxitrips
```
**List namespaces**
```
- ./iceberg --uri http://0.0.0.0:8181 list
+iceberg --uri http://localhost:8181 list
┌───────────┐
| IDs |
| --------- |
@@ -106,7 +119,7 @@ All commands accept `--output text` (default,
human-readable) or `--output json`
Note: only the identity transform is supported for `--partition-spec` at this
moment.
```shell
# Create a simple table with REST catalog and object store
-./iceberg create table default.table-1 \
+iceberg create table default.table-1 \
--properties write.format.default=parquet \
--partition-spec foo \
--sort-order foo:desc:nulls-last \
@@ -116,7 +129,7 @@ Note: only the identity transform is supported for
`--partition-spec` at this mo
Table default.table-1 created successfully
# Describe the newly created table
-./iceberg describe --catalog rest --uri http://localhost:8181 default.table-1
+iceberg describe --catalog rest --uri http://localhost:8181 default.table-1
Table format version │ 2
Metadata location │
s3://warehouse/default/table-1/metadata/00000-f0ccaadd-d988-482e-99da-3a37870288fe.metadata.json
Table UUID │ 33fa3fac-e638-4335-a085-343c6d9e7de5
@@ -143,6 +156,11 @@ write.format.default │ parquet
write.parquet.compression-codec │ zstd
```
+Drop a table or namespace with `iceberg drop table` or
+`iceberg drop namespace`. Use `iceberg rename` to rename a table and
+`iceberg properties get|set|remove` to work with table or namespace
+properties. Each command accepts `--help`.
+
## Inspecting tables
### `info` — single-screen summary
@@ -237,6 +255,41 @@ iceberg clean-orphan-files --older-than 5d my_db.events
iceberg clean-orphan-files --location s3://old-warehouse/my_db/events
my_db.events
```
+## File maintenance
+
+### Data-file compaction
+
+Preview the groups that compaction would rewrite with `compact analyze`.
+Use `compact run` to write replacements. By default it bin-packs each group.
+Both commands accept `--target-file-size` for output files.
+
+```sh
+iceberg compact analyze --target-file-size 268435456 my_db.events
+iceberg compact run --target-file-size 268435456 my_db.events
+```
+
+The next example uses flags added after v0.7.0. Install the
+[`@main` build](#cli) to try it. `--max-group-size` caps input bytes per group
+for either command. `compact run --sort` sorts each group by the table's
+default sort order.
+
+```sh
+iceberg compact run --sort --max-group-size 536870912 my_db.events
+```
+
+See [compaction](./api.md#compaction-rewrite-data-files) for sort strategy
+tradeoffs and `iceberg compact run --help` for additional options.
+
+### Manifest rewrites
+
+`rewrite-manifests` reorganizes the table's manifests. Use `--spec-id`
+to select a partition spec and `--target-manifest-size` to override the
+table's target size in bytes.
+
+```sh
+iceberg rewrite-manifests --spec-id 0 my_db.events
+```
+
## Rollback
Reset the current snapshot pointer to a previous snapshot. The target must be
an ancestor of the current snapshot.
@@ -335,6 +388,13 @@ iceberg tag create \
my_db.events monthly-backup-may
```
+### Delete a branch or tag
+
+```sh
+iceberg branch delete my_db.events audit-2026-q2
+iceberg tag delete my_db.events monthly-backup-may
+```
+
## Automation
Two flags make these commands safe to run from cron jobs or CI:
diff --git a/website/src/getting-started.md b/website/src/getting-started.md
index a09be3ed7..72c439cf6 100644
--- a/website/src/getting-started.md
+++ b/website/src/getting-started.md
@@ -19,240 +19,134 @@
# Getting Started
-This walkthrough takes you from `go get` to a fully written-and-read Iceberg
table in a few minutes, using a local SQLite-backed catalog so you do not need
any external services. By the end you will have:
+Create an Iceberg table in a local SQLite catalog, append three rows with
Arrow,
+and read the rows back. The program uses a fresh temporary catalog and
warehouse
+on each run and removes them when it exits.
-- An Iceberg catalog stored in a SQLite file
-- A table with an Arrow schema
-- Data written from Apache Arrow Go and read back
-- A schema evolution committed
-- A branch created on top of the table
+## Install
-If you would rather see all the operations as a reference, jump straight to
the [API](./api.md).
-
-## 1. Install
+This walkthrough uses Iceberg Go v0.7.0 and requires Go 1.25.9 or later.
+Create a new directory and run:
```sh
go mod init iceberg-go-tutorial
-go get github.com/apache/iceberg-go@latest
-go get github.com/apache/arrow-go/v18@latest
-go get github.com/uptrace/bun/driver/sqliteshim@latest
+go get github.com/apache/[email protected] \
+ github.com/apache/arrow-go/[email protected] \
+ github.com/uptrace/bun/driver/[email protected]
```
-`iceberg-go` itself only registers the local file system. For S3, GCS, or
Azure Blob you would also blank-import the matching backend package, such as
`github.com/apache/iceberg-go/io/gocloud/s3`. We are staying on local disk for
this tutorial.
-
-## 2. Open a local catalog
+## Create, write, and read a table
-The SQL catalog stores its metadata in a database, and the actual data files
live under a "warehouse" directory. We will use SQLite for both the catalog DB
and a local folder for the warehouse.
+Save the following as `main.go`. The SQL catalog stores table registrations in
+SQLite. The Iceberg metadata and Parquet data files go in the local warehouse.
```go
package main
import (
- "context"
- "database/sql"
- "log"
-
- "github.com/apache/iceberg-go"
- sqlcat "github.com/apache/iceberg-go/catalog/sql"
- "github.com/uptrace/bun/driver/sqliteshim"
+ "context"
+ "fmt"
+ "io"
+ "log"
+ "os"
+ "path/filepath"
+
+ "github.com/apache/arrow-go/v18/arrow"
+ "github.com/apache/arrow-go/v18/arrow/array"
+ "github.com/apache/arrow-go/v18/arrow/memory"
+ "github.com/apache/iceberg-go"
+ "github.com/apache/iceberg-go/catalog"
+ _ "github.com/apache/iceberg-go/catalog/sql"
+ "github.com/uptrace/bun/driver/sqliteshim"
)
-func openCatalog(ctx context.Context) (*sqlcat.Catalog, error) {
- db, err := sql.Open(sqliteshim.ShimName,
"file:./tutorial-catalog.db?cache=shared")
- if err != nil {
- return nil, err
- }
- return sqlcat.NewCatalog(ctx, "default", db, sqlcat.SQLite,
iceberg.Properties{
- "warehouse": "file:///tmp/iceberg-tutorial",
- "init_catalog_tables": "true",
- })
+func run(ctx context.Context) error {
+ dir, err := os.MkdirTemp("", "iceberg-tutorial-")
+ if err != nil {
+ return err
+ }
+ defer os.RemoveAll(dir)
+
+ cat, err := catalog.Load(ctx, "tutorial", iceberg.Properties{
+ "type": "sql",
+ "uri": "file:" + filepath.Join(dir, "catalog.db"),
+ "sql.driver": sqliteshim.ShimName,
+ "sql.dialect": "sqlite",
+ "warehouse": "file://" + filepath.Join(dir, "warehouse"),
+ })
+ if err != nil {
+ return err
+ }
+ if closer, ok := cat.(io.Closer); ok {
+ defer closer.Close()
+ }
+
+ if err := cat.CreateNamespace(ctx, catalog.ToIdentifier("taxi"), nil);
err != nil {
+ return err
+ }
+ trips := catalog.ToIdentifier("taxi", "trips")
+ schema := iceberg.NewSchema(0, iceberg.NestedField{ID: 1, Name:
"trip_id", Type: iceberg.PrimitiveTypes.Int64, Required: true})
+ tbl, err := cat.CreateTable(ctx, trips, schema)
+ if err != nil {
+ return err
+ }
+
+ arrowSchema := arrow.NewSchema([]arrow.Field{{Name: "trip_id", Type:
arrow.PrimitiveTypes.Int64}}, nil)
+ records := array.NewRecordBuilder(memory.DefaultAllocator, arrowSchema)
+ defer records.Release()
+ records.Field(0).(*array.Int64Builder).AppendValues([]int64{1, 2, 3},
nil)
+ batch := records.NewRecord()
+ defer batch.Release()
+ input := array.NewTableFromRecords(arrowSchema, []arrow.Record{batch})
+ defer input.Release()
+ tbl, err = tbl.AppendTable(ctx, input, 1024, nil)
+ if err != nil {
+ return err
+ }
+
+ output, err := tbl.Scan().ToArrowTable(ctx)
+ if err != nil {
+ return err
+ }
+ defer output.Release()
+ if tbl.CurrentSnapshot() == nil || output.NumRows() != 3 {
+ return fmt.Errorf("expected a committed snapshot and 3 rows,
got %d rows", output.NumRows())
+ }
+ fmt.Printf("Read %d rows from taxi.trips and verified a committed
snapshot.\n", output.NumRows())
+ return nil
}
-```
-
-`init_catalog_tables: "true"` lets the catalog create its bookkeeping tables
(`iceberg_tables`, `iceberg_namespace_properties`) on first use. Make sure
`/tmp/iceberg-tutorial` is writable.
-## 3. Create a namespace and a table
-
-Iceberg organizes tables under namespaces (the analog of databases). We will
create one and put a table inside it.
-
-```go
-import (
- "github.com/apache/iceberg-go/catalog"
- "github.com/apache/iceberg-go/table"
-)
-
-func createTrips(ctx context.Context, cat *sqlcat.Catalog) (*table.Table,
error) {
- ns := table.Identifier{"taxi"}
- if err := cat.CreateNamespace(ctx, ns, nil); err != nil {
- return nil, err
- }
-
- schema := iceberg.NewSchema(1,
- iceberg.NestedField{ID: 1, Name: "trip_id", Type:
iceberg.PrimitiveTypes.Int64, Required: true},
- iceberg.NestedField{ID: 2, Name: "fare", Type:
iceberg.PrimitiveTypes.Float64, Required: false},
- iceberg.NestedField{ID: 3, Name: "borough", Type:
iceberg.PrimitiveTypes.String, Required: false},
- )
-
- ident := catalog.ToIdentifier("taxi", "trips")
- return cat.CreateTable(ctx, ident, schema)
+func main() {
+ if err := run(context.Background()); err != nil {
+ log.Fatal(err)
+ }
}
```
-If the namespace already exists, `CreateNamespace` returns an error - the
example skips error handling for brevity; production code should check for
`iceberg.ErrAlreadyExists` and recover.
+Run the program:
-## 4. Write some Arrow data
-
-The write path takes either a streaming
[`array.RecordReader`](https://pkg.go.dev/github.com/apache/arrow-go/v18/arrow/array#RecordReader)
or a fully materialized
[`arrow.Table`](https://pkg.go.dev/github.com/apache/arrow-go/v18/arrow#Table).
We will build a small Arrow table inline and append it.
-
-```go
-import (
- "github.com/apache/arrow-go/v18/arrow"
- "github.com/apache/arrow-go/v18/arrow/array"
- "github.com/apache/arrow-go/v18/arrow/memory"
-)
-
-func writeSomeTrips(ctx context.Context, tbl *table.Table) (*table.Table,
error) {
- mem := memory.NewGoAllocator()
-
- arrowSchema := arrow.NewSchema([]arrow.Field{
- {Name: "trip_id", Type: arrow.PrimitiveTypes.Int64, Nullable: false},
- {Name: "fare", Type: arrow.PrimitiveTypes.Float64, Nullable: true},
- {Name: "borough", Type: arrow.BinaryTypes.String, Nullable: true},
- }, nil)
-
- b := array.NewRecordBuilder(mem, arrowSchema)
- defer b.Release()
-
- b.Field(0).(*array.Int64Builder).AppendValues([]int64{1, 2, 3}, nil)
- b.Field(1).(*array.Float64Builder).AppendValues([]float64{12.50, 8.75,
22.10}, nil)
- b.Field(2).(*array.StringBuilder).AppendValues([]string{"Manhattan",
"Brooklyn", "Queens"}, nil)
-
- rec := b.NewRecord()
- defer rec.Release()
-
- arrowTbl := array.NewTableFromRecords(arrowSchema, []arrow.Record{rec})
- defer arrowTbl.Release()
-
- return tbl.AppendTable(ctx, arrowTbl, 1024 /* batchSize */, nil)
-}
-```
-
-`AppendTable` returns a refreshed `*table.Table` reflecting the new snapshot.
-
-## 5. Read the data back
-
-```go
-func readAll(ctx context.Context, tbl *table.Table) error {
- arrowTbl, err := tbl.Scan().ToArrowTable(ctx)
- if err != nil {
- return err
- }
- defer arrowTbl.Release()
-
- log.Printf("read %d rows in %d columns", arrowTbl.NumRows(),
arrowTbl.NumCols())
- return nil
-}
-```
-
-For larger tables, use streaming so only one batch is in memory at a time:
-
-```go
-arrowSchema, batches, err := tbl.Scan().ToArrowRecords(ctx)
-if err != nil {
- return err
-}
-log.Printf("scan schema: %s", arrowSchema)
-
-for batch, err := range batches {
- if err != nil {
- return err
- }
- log.Printf("batch with %d rows", batch.NumRows())
- batch.Release()
-}
-```
-
-## 6. Filter and project
-
-Use the [predicate DSL](./row-filter-syntax.md) to push filters down into the
scan, and `WithSelectedFields` to project columns:
-
-```go
-filter := iceberg.GreaterThan(iceberg.Reference("fare"), float64(10.0))
-
-arrowTbl, err := tbl.Scan(
- table.WithSelectedFields("trip_id", "fare"),
- table.WithRowFilter(filter),
-).ToArrowTable(ctx)
-```
-
-## 7. Evolve the schema
-
-Most schema changes go through a transaction. Add a `tip` column:
-
-```go
-import "github.com/apache/iceberg-go/table"
-
-func addTipColumn(ctx context.Context, tbl *table.Table) (*table.Table, error)
{
- txn := tbl.NewTransaction()
-
- err := table.NewUpdateSchema(txn, true /* caseSensitive */, false /*
allowIncompatible */).
- AddColumn([]string{"tip"}, iceberg.PrimitiveTypes.Float64, "Tip in
dollars", false, nil).
- Commit()
- if err != nil {
- return nil, err
- }
-
- return txn.Commit(ctx)
-}
+```sh
+go mod tidy
+go run .
```
-The returned table has the new schema and a fresh metadata file.
-
-## 8. Branch the table
-
-A branch is a named ref that points at a snapshot. Creating one requires a
metadata commit that adds the ref - `NewTransactionOnBranch` only writes to a
branch that already exists. Two steps:
-
-```go
-import "github.com/apache/iceberg-go/table"
-
-// Step 1: create the branch via Catalog.CommitTable.
-func createExperimentBranch(ctx context.Context, cat *sqlcat.Catalog, tbl
*table.Table) (*table.Table, error) {
- snap := tbl.CurrentSnapshot()
- update := table.NewSetSnapshotRefUpdate(
- "experiment", snap.SnapshotID, table.BranchRef,
- 0 /* maxRefAgeMs */, 0 /* maxSnapshotAgeMs */, 0 /* minSnapshotsToKeep
*/,
- )
- reqs := []table.Requirement{
- table.AssertTableUUID(tbl.Metadata().TableUUID()),
- table.AssertRefSnapshotID("experiment", nil), // branch must not yet
exist
- }
- if _, _, err := cat.CommitTable(ctx, tbl.Identifier(), reqs,
[]table.Update{update}); err != nil {
- return nil, err
- }
- // Reload so subsequent transactions see the new ref.
- return cat.LoadTable(ctx, tbl.Identifier())
-}
-
-// Step 2: open a transaction on the branch and write.
-func writeOnBranch(ctx context.Context, tbl *table.Table, arrowTbl
arrow.Table) (*table.Table, error) {
- txn, err := tbl.NewTransactionOnBranch("experiment")
- if err != nil {
- return nil, err
- }
- if err := txn.AppendTable(ctx, arrowTbl, 1024, nil); err != nil {
- return nil, err
- }
- return txn.Commit(ctx)
-}
+```text
+Read 3 rows from taxi.trips and verified a committed snapshot.
```
-Reads can target the branch with `tbl.Scan().UseRef("experiment")`.
+The append returns a new table handle with the committed snapshot. The scan
+uses that handle to read the rows back.
## Where to go next
-- [API](./api.md) - the full Go surface for catalogs, tables, scans, writes,
transactions, schema and partition evolution, snapshot management, maintenance,
and views.
-- [Configuration](./configuration.md) - cloud credentials, table properties,
concurrency, custom catalog and IO registration.
-- [CLI](./cli.md) - inspect, expire, compact, branch, and tag from the command
line.
-- [Row Filter Syntax](./row-filter-syntax.md) and [Expression
DSL](./expression-dsl.md) - the predicate DSL in detail.
-
-The full Iceberg specification, terminology, and engine integration policy
live with the main project at [iceberg.apache.org](https://iceberg.apache.org/).
+- [Filter and project columns](./api.md#projection-and-filters) or
+ [stream Arrow record batches](./api.md#streaming-record-batches).
+- [Evolve a schema](./api.md#schema-evolution) or
+ [work with branches and tags](./api.md#branches-and-tags).
+- [Configure another catalog](./configuration.md#catalog-options) or
+ [inspect a table from the CLI](./cli.md#inspecting-tables).
+- For an S3, GCS, or Azure warehouse, see
+ [file-system credentials](./configuration.md#file-system-credentials) for
+ backend imports and credentials.
+- See [Releases](./releases.md#using-a-release) for other library versions and
+ [API](./api.md) for examples that follow the development branch.
diff --git a/website/src/how-to-release.md b/website/src/how-to-release.md
index 037859626..8d953421d 100644
--- a/website/src/how-to-release.md
+++ b/website/src/how-to-release.md
@@ -24,6 +24,7 @@ This page is for Apache Iceberg PMC members and committers
who are cutting a new
## Requirements
- You must be an Apache Iceberg committer or PMC member.
+- Install GitHub CLI, Subversion, and `sha512sum` for candidate preparation.
Publishing also uses `sort --version-sort`.
- You must prepare a PGP key for signing. See
[https://infra.apache.org/release-signing.html#generate](https://infra.apache.org/release-signing.html#generate).
- Your PGP key must be registered in the Apache Iceberg `KEYS` file at
`https://downloads.apache.org/iceberg/KEYS`. To add a key:
@@ -85,8 +86,9 @@ After publishing, complete these steps:
1. Add the release to ASF's report database at the [Apache Committee Report
Helper](https://reporter.apache.org/addrelease.html?iceberg).
2. Verify the GitHub Release at
`https://github.com/apache/iceberg-go/releases` is correctly tagged, has
generated release notes against the prior tag, and is marked as latest.
`release.sh` runs `gh release create ... --generate-notes --verify-tag` so the
release should already exist; double-check the notes and the "Latest" badge.
-3. Send the `[ANNOUNCE]` email to `[email protected]` and
`[email protected]`.
-4. File a release blog post in
[`apache/iceberg`](https://github.com/apache/iceberg) under
`site/docs/blog/posts/`. See the prior 0.5.0 post
(`2026-03-05-iceberg-go-0.5.0-release.md`) for the frontmatter and structure.
+3. Update [Getting Started](./getting-started.md#install) to pin the new
release. Check the Go minimum and dependency versions against the tag's
`go.mod`, then run the walkthrough in a fresh module. Update the release-tag
link and version-specific flag notes in the [CLI guide](./cli.md).
+4. Send the `[ANNOUNCE]` email to `[email protected]` and
`[email protected]`.
+5. File a release blog post in
[`apache/iceberg`](https://github.com/apache/iceberg) under
`site/docs/blog/posts/`. See the prior 0.5.0 post
(`2026-03-05-iceberg-go-0.5.0-release.md`) for the frontmatter and structure.
## Patch releases
diff --git a/website/src/install.md b/website/src/install.md
index 44985fbfb..c03b5cf07 100644
--- a/website/src/install.md
+++ b/website/src/install.md
@@ -19,27 +19,24 @@
# Install
-In this quickstart, we’ll glean insights from code segments and learn how to:
+## Go library
-## Requirements
+Use Go 1.26.3 or later to build from `main`. For a tagged release, see the
+Go requirement in that tag's `go.mod`.
-<div class="warning">
-Go 1.26 or later is required to build.
-</div>
+From your Go module, install the latest release:
-## Installation
+```sh
+go get github.com/apache/iceberg-go@latest
+```
-To install `iceberg-go` package, you need to install Go and set your Go
workspace first.
-If you don't have a go.mod file, create it with `go mod init gin`.
+Start with the [Getting Started](./getting-started.md) walkthrough or see
+[Releases](./releases.md#using-a-release) for version selection.
-1. Download and install it:
+## CLI
```sh
-go get -u github.com/apache/iceberg-go
+go install github.com/apache/iceberg-go/cmd/iceberg@latest
```
-2. Import it in your code:
-
-```go
-import "github.com/apache/iceberg-go"
-```
+See the [CLI guide](./cli.md) for command examples and source builds.
diff --git a/website/src/verify-release.md b/website/src/verify-release.md
index 87343d77f..ca1512083 100644
--- a/website/src/verify-release.md
+++ b/website/src/verify-release.md
@@ -39,8 +39,11 @@ The script requires:
- `gpg`
- `shasum` or `sha512sum`
- `tar`
+- Java and Python 3 for the RAT license check
+- `jq` if the script needs to download Go
-You do not need Go installed - if Go is not on the system, the latest Go is
downloaded automatically and used only for verification.
+Use a Go toolchain that meets the requirement in the candidate's `go.mod`.
+If Go is unavailable, the script downloads a toolchain for verification.
## Import the Apache Iceberg KEYS
@@ -51,16 +54,18 @@ gpg --import KEYS
## Run the verification script
-The script takes the version and RC number as positional arguments:
+Pass the version and RC number. Use a disposable module cache because the
+script cleans it on exit. Run with `GITHUB_TOKEN` unset to keep it out of
+shell traces if the script downloads Go.
```sh
-dev/release/verify_rc.sh ${VERSION} ${RC}
+env -u GITHUB_TOKEN GOMODCACHE="$(mktemp -d)" dev/release/verify_rc.sh
${VERSION} ${RC}
```
For example, to verify `0.6.0` RC1:
```sh
-dev/release/verify_rc.sh 0.6.0 1
+env -u GITHUB_TOKEN GOMODCACHE="$(mktemp -d)" dev/release/verify_rc.sh 0.6.0 1
```
If the verification succeeds, the script prints:
@@ -77,9 +82,8 @@ RC looks good!
|---|---|---|
| `VERIFY_DEFAULT` | `1` | Master switch propagated to `VERIFY_DOWNLOAD` and
`VERIFY_SIGN` if they are unset. |
| `VERIFY_DOWNLOAD` | `${VERIFY_DEFAULT}` | Re-download artifacts when `1`;
reuse the local copy when `0`. |
-| `VERIFY_SIGN` | `${VERIFY_DEFAULT}` | Re-run signature and checksum
verification when `1`. |
+| `VERIFY_SIGN` | `${VERIFY_DEFAULT}` | Verify the signature when `1`. The
script always checks the checksum. |
| `VERIFY_FORCE_USE_GO_BINARY` | `0` | When `1`, ignore any system Go and use
the script's auto-downloaded Go. |
-| `GITHUB_TOKEN` | unset | Optional - supplies authenticated requests when
fetching the latest Go release, avoiding rate limits. |
## Manual verification fallback
@@ -97,8 +101,14 @@ gpg --verify apache-iceberg-go-${VERSION}.tar.gz.asc
apache-iceberg-go-${VERSION
# Verify the checksum (or sha512sum -c on systems without shasum)
shasum -a 512 --check apache-iceberg-go-${VERSION}.tar.gz.sha512
-# Inspect the contents
-tar xf apache-iceberg-go-${VERSION}.tar.gz
+# Inspect the archive, check licenses, and run the unit tests
+archive="apache-iceberg-go-${VERSION}"
+tar xf "${archive}.tar.gz"
+(
+ cd "${archive}"
+ dev/release/run_rat.sh "../${archive}.tar.gz"
+ go test ./...
+)
```
-You should reply to the `[VOTE]` thread with `+1`, `+0`, or `-1` and a
one-line description of what you verified (for example, "verified signatures,
checksums, and `verify_rc.sh` passed on macOS arm64 with system Go 1.25.5").
+You should reply to the `[VOTE]` thread with `+1`, `+0`, or `-1` and a
one-line description of what you verified (for example, "verified signatures,
checksums, and `verify_rc.sh` passed on macOS arm64").