Apache Iceberg - Go

Clone this repo:
  1. 1a44611 feat(table): project reserved row-lineage fields as null when the file lacks them (#1045) by David Zhao · 4 hours ago main
  2. 53fa29c feat(table): gate v2-only metadata fields on v1 reads (#1088) by Andrei Tserakhau · 10 hours ago v0.6.0-rc0
  3. a59f2a2 fix(table): derive position-delete partition paths from table schema (#1089) by Andrei Tserakhau · 24 hours ago
  4. 7df00ed feat(table): emit null current-snapshot-id for empty v3 metadata (#1059) by Andrei Tserakhau · 32 hours ago
  5. f8b8ee9 feat(puffin): enforce required DV blob properties on write (#1060) by Andrei Tserakhau · 32 hours ago

Iceberg Golang

Go Reference

iceberg is a Golang implementation of the Iceberg table spec.

Build From Source

Prerequisites

  • Go 1.25 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

OperationRESTHiveGlueSQLHadoop
Load TableXXXXX
List TablesXXXXX
Create TableXXXXX
Register TableXXX
Update Current SnapshotXXXXX
Create New SnapshotXXXXX
Rename TableXXXX
Drop TableXXXXX
Alter TableXXXXX
Check Table ExistsXXXXX
Set Table PropertiesXXXXX
List NamespacesXXXXX
Create NamespaceXXXXX
Check Namespace ExistsXXXXX
Drop NamespaceXXXXX
Update Namespace PropertiesXXXX
Create ViewXXX
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