Apache Iceberg - Go

Clone this repo:
  1. a1d883e feat(cli): add --schema-from-file flag to infer table schema from parquet files (#927) by Tanmay Rauth · 4 days ago main
  2. 41f5c54 feat(io): add BulkRemovableIO interface(#914) (#916) by Tanmay Rauth · 4 days ago
  3. fe9bcf4 feat(config,cmd/iceberg): support more rest options in config (#933) by Matt Topol · 4 days ago
  4. c576fd1 fix(table): seed UpdateSchema id counter from metadata LastColumnID (#936) by Ashley Jeffs · 4 days ago
  5. f8df330 fix: use floored division in HourTransform for pre-epoch timestamps (#924) (#926) by Tanmay Rauth · 5 days 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

OperationRESTHiveGlueSQL
Load TableXXXX
List TablesXXXX
Create TableXXXX
Register TableXXX
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 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