Apache Iceberg - Go

Clone this repo:
  1. cc8a6ff feat(table): roll parquet files based on actual compressed size (#759) by Tobias Pütz · 2 days ago main
  2. e3b130b refactor: make partition spec and sort order fields range friendly (#772) by ferhat elmas · 6 days ago
  3. 5c12903 chore: Update copyright year in NOTICE file (#771) by Matt Topol · 6 days ago
  4. 52dbce5 fix(table): fix refcount leak in enrichRecordsWithPosDeleteFields (#762) by Andrei Tserakhau · 7 days ago
  5. 1a546fc feat(rest): add RegisterView to REST catalog (#753) by Shubhendu · 7 days ago

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