Apache Iceberg - Go

Clone this repo:
  1. f192c8e fix(manifest): handle lifecycle of the decoder in reader (#766) by ferhat elmas · 2 days ago main
  2. 839de5b fix: nil field Type causes unrecovered panic in MarshalJSON (#765) by Shubhendu · 2 days ago
  3. 15b0cce build(deps): bump go.opentelemetry.io/otel/sdk from 1.39.0 to 1.40.0 (#764) by dependabot[bot] · 2 days ago
  4. 7602b8b build(deps): bump the gomod_updates group with 18 updates (#763) by dependabot[bot] · 2 days ago
  5. fd7042c chore: use ubuntu-slim for lightweight jobs (#760) by Junwang Zhao · 5 days ago v0.5.0-rc0

Iceberg Golang

Go Reference

iceberg is a Golang implementation of the Iceberg table spec.

Build From Source

Prerequisites

  • Go 1.23 or later

Build

$ git clone https://github.com/apache/iceberg-go.git
$ cd iceberg-go/cmd/iceberg && go build .

Running Tests

Use the Makefile so commands stay in sync with CI (e.g. golangci-lint version).

Unit tests

make test

Linting

make lint

Install the linter first

make lint-install
# or: go install github.com/golangci/golangci-lint/cmd/golangci-lint@v2.8.0

Integration tests

Prerequisites: Docker, Docker Compose

  1. Start the Docker containers using docker compose:

    make integration-setup
    
  2. Export the required environment variables:

    export AWS_S3_ENDPOINT=http://$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' minio):9000
    export AWS_REGION=us-east-1
    export SPARK_CONTAINER_ID=$(docker ps -qf 'name=spark-iceberg')
    export DOCKER_API_VER=$(docker version -f '{{.Server.APIVersion}}')
    
  3. Run the integration tests:

    make integration-test
    

    Or run a single suite: make integration-scanner, make integration-io, make integration-rest, make integration-spark.

Feature Support / Roadmap

FileSystem Support

Filesystem TypeSupported
S3X
Google Cloud StorageX
Azure Blob StorageX
Local FilesystemX

Metadata

OperationSupported
Get SchemaX
Get SnapshotsX
Get Sort OrdersX
Get Partition SpecsX
Get ManifestsX
Create New ManifestsX
Plan Scanx
Plan Scan for Snapshotx

Catalog Support

OperationRESTHiveGlueSQL
Load TableXXXX
List TablesXXXX
Create TableXXXX
Register TableXX
Update Current SnapshotXXXX
Create New SnapshotXXXX
Rename TableXXXX
Drop TableXXXX
Alter TableXXXX
Check Table ExistsXXXX
Set Table PropertiesXXXX
List NamespacesXXXX
Create NamespaceXXXX
Check Namespace ExistsXXXX
Drop NamespaceXXXX
Update Namespace PropertiesXXXX
Create ViewXX
Load ViewXX
List ViewXXX
Drop ViewXXX
Check View ExistsXXX

Read/Write Data Support

  • Data can currently be read as an Arrow Table or as a stream of Arrow record batches.

Supported Write Operations

As long as the FileSystem is supported and the Catalog supports altering the table, the following tracks the current write support:

OperationSupported
Append StreamX
Append Data FilesX
Rewrite Files
Rewrite manifests
Overwrite FilesX
Copy-On-Write DeleteX
Write Pos DeleteX
Write Eq Delete
Row Delta

CLI Usage

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@latest to install it to the bin directory of your GOPATH.

The iceberg CLI usage is very similar to pyiceberg CLI
You can pass the catalog URI with --uri argument.

Example: You can start the Iceberg REST API docker image which runs on default in port 8181

docker pull apache/iceberg-rest-fixture:latest
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
┌─────┐
| IDs |
| --- |
└─────┘

Create Namespace

./iceberg --uri http://0.0.0.0:8181 create namespace taxitrips

List Namespace

 ./iceberg --uri http://0.0.0.0:8181 list
┌───────────┐
| IDs       |
| --------- |
| taxitrips |
└───────────┘


Get in Touch