MCPcopy Index your code
hub / github.com/apache/polaris

github.com/apache/polaris @apache-polaris-1.5.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release apache-polaris-1.5.0 ↗ · + Follow
11,353 symbols 60,296 edges 1,548 files 2,327 documented · 20%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Apache Polaris

Apache Polaris™ is an open-source, fully-featured catalog for Apache Iceberg™. It implements Iceberg's REST API, enabling seamless multi-engine interoperability across a wide range of platforms, including Apache Doris™, Apache Flink®, Apache Spark™, Dremio® OSS, StarRocks, and Trino.

Documentation is available at https://polaris.apache.org. The REST OpenAPI specifications are available here: Polaris management API doc and Polaris Catalog API doc.

For a high-level, auto-generated tour of the codebase's modules and relationships, see the Code Wiki for Apache Polaris. It is a third-party, auto-generated navigation aid, useful for orientation, but the source tree remains the authoritative reference.

Subscribe to the dev mailing list to join discussions via email or browse the archives. Check out the CONTRIBUTING guide for contribution guidelines.

Slack Build Status

Polaris Overview

Click here for a quick overview of Polaris.

Quickstart

Click here for the quickstart experience, which will help you set up a Polaris instance locally or on any supported cloud provider.

Project Structure

Apache Polaris is organized into the following modules: - Primary modules: - polaris-core - The main Polaris entity definitions and core business logic - API modules - Build scripts for generating Java classes from the OpenAPI specifications: - polaris-api-management-model - Polaris Management API model classes - polaris-api-management-service - Polaris Management API service classes - polaris-api-iceberg-service - The Iceberg REST service classes - polaris-api-catalog-service - The Polaris Catalog API service classes - Runtime modules: - polaris-admin - The Polaris Admin Tool; mainly for bootstrapping persistence - polaris-runtime-defaults - The runtime configuration defaults - polaris-distribution - The Polaris distribution - polaris-server - The Polaris Quarkus Server - polaris-runtime-service - The package containing the Polaris service. - polaris-runtime-spark-tests - Integration tests for the Polaris Spark plugin - polaris-runtime-test-common - Test utilities - Persistence modules: - polaris-relational-jdbc - The JDBC implementation of BasePersistence to be used via AtomicMetaStoreManager - Extensions modules: - polaris-extensions-federation-hadoop - The Hadoop federation extension - polaris-extensions-federation-hive - The Hive federation extension - Secondary modules: - agregated-license-report - Generates the aggregated license report - polaris-bom - The Bill of Materials (BOM) for Polaris - polaris-build-logic - Establishes consistent build logic - polaris-tests - Normative integration tests for reuse in downstream projects - Tool modules: - Documentation configuration: - polaris-config-docs-annotations - Annotations for documentation generator - polaris-config-docs-generator - Generates Polaris reference docs - polaris-config-docs-site - The configuration documentation site - Other Tools: - polaris-container-spec-helper - Helper for container specifications - polaris-immutables - Predefined Immutables configuration & annotations for Polaris - polaris-minio-testcontainer - Minio test container - polaris-rustfs-testcontainer - RustFS test container - polaris-misc-types - Miscellaneous types for Polaris - polaris-version - Versioning for Polaris

In addition to modules, there are: - API specifications - The OpenAPI specifications - Python client - The Python client - codestyle - The code style guidelines - getting-started - A collection of getting started examples - gradle - The Gradle wrapper and Gradle configuration files including banned dependencies - helm - The Helm charts for Polaris. - Spark Plugin - The Polaris Spark plugin - regtests - Regression tests - server-templates - OpenAPI Generator templates to generate the server code - site - The Polaris website

Outside of this repository, there are several other tools that can be found in a separate Polaris-Tools repository.

Building and Running

Apache Polaris is built using Gradle with Java 21+ and Docker 27+.

  • ./gradlew build - To build and run tests. Make sure Docker is running, as the integration tests depend on it.
  • ./gradlew assemble - To skip tests.
  • ./gradlew check - To run all checks, including unit tests and integration tests.
  • ./gradlew run - To run the Polaris server locally; the server is reachable at localhost:8181. This is also suitable for running regression tests, or for connecting with Spark. Set your own credentials by specifying system property ./gradlew run -Dpolaris.bootstrap.credentials=POLARIS,root,secret where:
  • POLARIS is the realm
  • root is the CLIENT_ID
  • secret is the CLIENT_SECRET
  • If credentials are not set, it will use preset credentials POLARIS,root,s3cr3t
  • ./regtests/run_spark_sql.sh - To connect from Spark SQL. Here are some example commands to run in the Spark SQL shell:
create database db1;
show databases;
create table db1.table1 (id int, name string);
insert into db1.table1 values (1, 'a');
select * from db1.table1;
  • env POLARIS_HOST=localhost ./regtests/run.sh - To run regression tests locally, see more options here.

Makefile Convenience Commands

To streamline the developer experience, especially for common setup and build tasks, a root-level Makefile is available. This Makefile acts as a convenient wrapper around various Gradle commands and other tooling, simplifying interactions. While Gradle remains the primary build system, the Makefile provides concise shortcuts for frequent operations like: - Building Polaris components: e.g., make build-server, make build-admin - Managing development clusters: e.g., make minikube-start-cluster, make minikube-cleanup - Automating Helm tasks: e.g., make helm-doc-generate, make helm-unittest - Handling dependencies: e.g., make install-dependencies-brew - Managing client operations: e.g., make client-lint, make client-regenerate

To see available commands:

make help

For example, to build the Polaris server and its container image, you can simply run:

make build-server

More build and run options

Running in Docker

  • To build the image locally: bash ./gradlew \ :polaris-server:assemble \ :polaris-server:quarkusAppPartsBuild --rerun \ -Dquarkus.container-image.build=true
  • docker run -p 8181:8181 -p 8182:8182 apache/polaris:latest - To run the image.

The Polaris codebase contains some docker compose examples to quickly get started with Polaris, using different configurations. See the Quickstart for more information.

Running in Kubernetes

Configuring Polaris

Polaris Servers can be configured using a variety of ways. Please see the Configuration Guide for more information.

Default configuration values can be found in runtime/defaults/src/main/resources/application.properties.

Building docs

  • Docs are generated using Hugo using the Docsy theme.
  • To view the site locally, run bash site/bin/run-hugo-in-docker.sh
  • See README in site/ for more information.

Publishing Build Scans to develocity.apache.org

Build scans of CI builds from a branch or tag in the apache/polaris repository on GitHub publish build scans to the ASF Develocity instance at develocity.apache.org, if the workflow runs have access to the Apache organization-level secret DEVELOCITY_ACCESS_KEY.

Build scans of local developer builds publish build scans only if the Gradle command line option --scan is used. Those build scans are published to Gradle's public Develocity instance (see advanced configuration options below). Note that build scans on Gradle's public Develocity instance are publicly accessible to anyone. You have to accept Gradle's terms of service to publish to the Gradle's public Develocity instance.

CI builds originating from pull requests against the apache/polaris GitHub repository are published to Gradle's public Develocity instance.

Other CI build scans do only publish build scans to the Gradle's public Develocity instance, if the environment variable GRADLE_TOS_ACCEPTED is set to true. By setting this variable you agree to the Gradle's terms of service, because accepting these ToS is your personal decision. You can configure this environment variable for your GitHub repository in the GitHub repository settings under Secrets > Secrets and variables > Actions > choose the Variables tab > New repository variable.

Advanced configuration options for publishing build scans (only local and non-apache/polaris repository CI): * The project ID published with the build scan can be specified using the environment variable DEVELOCITY_PROJECT_ID. The project ID defaults to the GitHub repository owner/name, for example octocat/polaris. * The Develocity server can be specified using the environment variable DEVELOCITY_SERVER if build scans should be published to another than Gradle's public Develocity instance. * If you have to publish build scans to your own Develocity instance, you can configure the access key using a GitHub secret named DEVELOCITY_ACCESS_KEY.

License

Apache Polaris is under the Apache License Version 2.0. See the LICENSE.

Extension points exported contracts — how you extend this code

ConnectionCredentialVendor (Interface)
Vendor for generating connection credentials for remote catalog or storage access. Implementations combine Polaris-m [13 …
polaris-core/src/main/java/org/apache/polaris/core/credentials/connection/ConnectionCredentialVendor.java
IdGeneratorSource (Interface)
Provides values for ID generators, usually provided by NodeLease implementations. [8 implementers]
persistence/nosql/idgen/spi/src/main/java/org/apache/polaris/ids/spi/IdGeneratorSource.java
TokenBrokerFactory (Interface)
Factory that creates a TokenBroker for generating and parsing. The TokenBroker is created based on the r [14 implementers]
runtime/service/src/main/java/org/apache/polaris/service/auth/internal/broker/TokenBrokerFactory.java
Operation (Interface)
(no doc) [14 implementers]
persistence/relational-jdbc/src/main/java/org/apache/polaris/persistence/relational/jdbc/DatasourceOperations.java
PolarisCatalog (Interface)
(no doc) [8 implementers]
plugins/spark/v3.5/spark/src/main/java/org/apache/polaris/spark/PolarisCatalog.java
BearerTokenProvider (Interface)
Interface for providing bearer tokens for authentication. Implementations can provide tokens from various sources su [3 …
extensions/auth/opa/impl/src/main/java/org/apache/polaris/extension/auth/opa/token/BearerTokenProvider.java
QuarkusPersistenceConfiguration (Interface)
(no doc) [5 implementers]
runtime/admin/src/main/java/org/apache/polaris/admintool/config/QuarkusPersistenceConfiguration.java
PolarisAccessManager (Interface)
(no doc) [3 implementers]
integration-tests/src/main/java/org/apache/polaris/service/it/ext/PolarisAccessManager.java

Core symbols most depended-on inside this repo

of
called by 2127
polaris-core/src/main/java/org/apache/polaris/core/config/ProductionReadinessCheck.java
of
called by 1343
runtime/service/src/main/java/org/apache/polaris/service/auth/PolarisCredential.java
build
called by 1201
polaris-core/src/main/java/org/apache/polaris/core/persistence/pagination/PageToken.java
get
called by 1093
polaris-core/src/main/java/org/apache/polaris/core/storage/StorageAccessConfig.java
put
called by 1038
polaris-core/src/main/java/org/apache/polaris/core/storage/StorageAccessConfig.java
add
called by 564
persistence/nosql/persistence/impl/src/main/java/org/apache/polaris/persistence/nosql/impl/indexes/IndexSpi.java
map
called by 514
persistence/nosql/persistence/api/src/testFixtures/java/org/apache/polaris/persistence/nosql/api/obj/SimpleTestObj.java
getId
called by 483
polaris-core/src/main/java/org/apache/polaris/core/entity/Identifiable.java

Shape

Method 9,291
Class 1,375
Interface 437
Function 180
Enum 42
Route 28

Languages

Java95%
Python5%
Kotlin1%

Modules by API surface

runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalog.java99 symbols
runtime/service/src/main/java/org/apache/polaris/service/admin/PolarisAdminService.java84 symbols
integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogIntegrationBase.java82 symbols
runtime/service/src/test/java/org/apache/polaris/service/catalog/iceberg/AbstractIcebergCatalogTest.java71 symbols
runtime/service/src/test/java/org/apache/polaris/service/catalog/iceberg/AbstractIcebergCatalogHandlerAuthzTest.java71 symbols
runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalogHandler.java65 symbols
persistence/nosql/persistence/impl/src/main/java/org/apache/polaris/persistence/nosql/impl/indexes/IndexImpl.java58 symbols
integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisManagementServiceIntegrationTest.java56 symbols
polaris-core/src/testFixtures/java/org/apache/polaris/core/persistence/PolarisTestMetaStoreManager.java55 symbols
polaris-core/src/main/java/org/apache/polaris/core/persistence/transactional/TransactionalMetaStoreManagerImpl.java52 symbols
polaris-core/src/main/java/org/apache/polaris/core/persistence/transactional/AbstractTransactionalPersistence.java52 symbols
persistence/relational-jdbc/src/main/java/org/apache/polaris/persistence/relational/jdbc/JdbcBasePersistenceImpl.java52 symbols

Datastores touched

(mongodb)Database · 1 repos
POLARISDatabase · 1 repos
polarisDatabase · 1 repos

For agents

$ claude mcp add polaris \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page