Adapters are an important part of Polypheny and they play a crucial role in enabling Polypheny to interact with different underlying databases. The adapters are designed to translate the relational algebra into a database-specific query language and to manage the schema on the underlying database. This guide outlines the required steps for adding a new adapter to Polypheny.
Polypheny distinguishes between two different types of adapters: Data Stores and Data Sources.
Data Stores have their schema managed by Polypheny. It is expected that Polypheny has the sole and exclusive control over data stores.
Data Sources allow querying an external database using Polypheny.
Polypheny supports three deployment types for adapters:
When developing a new adapter, you should aim to support all three types. However, if there is no embedded version available or if its use violates our licensing policy, then supporting only Docker and Remote is acceptable.
To add an adapter to Polypheny, you first need to create a class that extends either
DataStore. This new class should also define the possible adapter settings. These settings are defined using annotations. This new class is the central component of the adapter.
Polypheny uses an extended relational algebra to represent queries. Each adapter translates this into the native query language of the underlying database. The adapter can define individually how the relational algebra operations are transformed to its own query representation. To do this, it must define adapter-specific rules, such as
[adapter name]Project, which defines how a Project is transformed, or
[adapter name]Filter, which transforms a Filter operation.
The extended relational algebra consists of the following basic operations:
Additionally, it uses special operations for DMLs (Data Manipulation Languages), which are:
These operations need to be registered to the planner.
Polypheny is equipped with a comprehensive testing suite, which can be used during development to ensure correct implementation of data stores. To start the testing suite, use the following gradle command:
./gradlew integrationTests -Dstore.default=[New Store Name]
More information about the testing suite can be found in the testing guide.