Hi David,
Thank you for your question.
In my project, the adapter supports passing a JWT token as a parameter in the
JDBC connection string, which is then included in the header of each REST
request (e.g., as Authorization: Bearer ...). This enables integration with
authentication systems relying on JWT and OAuth2/OIDC.
Additionally, I will add a usage example for JWT authentication to the
README.md for clarity.
A few details about the motivation and architecture:
My main project is an ETL engine that leverages SQL-based transformations. When
the need arose to integrate data from REST sources, we decided to use the
Calcite Framework and develop a custom adapter (since, unfortunately, there
wasn’t a suitable REST adapter in the official list:
https://calcite.apache.org/docs/adapter.html).
Another challenge was the unpredictable nature of REST services and their
request formats. To address this, we utilize Apache Freemarker as a template
engine for forming the actual REST request. This means that the application
does not have to be rebuilt or redeployed when supporting a new REST source;
instead, a user only needs to provide an XML configuration file for the new
REST service, defining the request template using Freemarker.
Practically, the received filters and projects parameters in the
Enumerable<@Nullable Object[]> scan(DataContext root, List filters, int
@Nullable[] projects)
method of the org.apache.calcite.schema.ProjectableFilterableTable interface
are passed into the Freemarker context. They can then be used to construct the
REST request in any way that fits the supported features of the target REST API.
Best regards,
Oleg Alekseev
Telegram: @oalekseevdev
E-mail: [email protected]
On 2025/11/11 09:37:41 David Radley wrote:
> Hi,
> It looks interesting. What is the security story around this? e.g.
> certificates / OIDC etc,
> Kind regards, David.
>
> From: Oleg Alekseev <[email protected]>
> Date: Tuesday, 11 November 2025 at 09:13
> To: [email protected] <[email protected]>
> Subject: [EXTERNAL] Proposal to contribute CalciteRestAPIAdapter for
> community use
>
>
>
>
> Hello Apache Calcite community,
>
> My name is Oleg Alekseev, and I have developed a new adapter called
> CalciteRestAPIAdapter designed to retrieve data from REST services using
> standard SQL syntax. This adapter leverages the Apache Calcite framework,
> enabling access to REST APIs through JDBC by configuring service schemas and
> tables via XML files.
>
> The adapter is publicly available on GitHub:
> https://github.com/oalekseev/CalciteRestAPIAdapter
>
> I would like to propose this adapter as a contribution to the Apache Calcite
> project to make it accessible and beneficial to the wider community.
>
> Please let me know the appropriate process and any guidelines I should follow
> to move forward with submitting this contribution.
>
> Thank you for your time and consideration.
>
> Best regards,
> Oleg Alekseev
>
>
> Unless otherwise stated above:
>
> IBM United Kingdom Limited
> Registered in England and Wales with number 741598
> Registered office: Building C, IBM Hursley Office, Hursley Park Road,
> Winchester, Hampshire SO21 2JN
>
--
Олег Алексеев
Отправлено из Почты Mail