Apache.Calcite.Cosmos.Adapter
1.0.0-pre.316
dotnet add package Apache.Calcite.Cosmos.Adapter --version 1.0.0-pre.316
NuGet\Install-Package Apache.Calcite.Cosmos.Adapter -Version 1.0.0-pre.316
<PackageReference Include="Apache.Calcite.Cosmos.Adapter" Version="1.0.0-pre.316" />
<PackageVersion Include="Apache.Calcite.Cosmos.Adapter" Version="1.0.0-pre.316" />
<PackageReference Include="Apache.Calcite.Cosmos.Adapter" />
paket add Apache.Calcite.Cosmos.Adapter --version 1.0.0-pre.316
#r "nuget: Apache.Calcite.Cosmos.Adapter, 1.0.0-pre.316"
#:package Apache.Calcite.Cosmos.Adapter@1.0.0-pre.316
#addin nuget:?package=Apache.Calcite.Cosmos.Adapter&version=1.0.0-pre.316&prerelease
#tool nuget:?package=Apache.Calcite.Cosmos.Adapter&version=1.0.0-pre.316&prerelease
Apache.Calcite.Cosmos.Adapter
An Apache Calcite adapter for Azure Cosmos DB for NoSQL. Query Cosmos containers with ordinary SQL from .NET: as much of each query as Cosmos can evaluate is translated to Cosmos SQL and run by the service, and the rest — relational joins, set operations, functions Cosmos lacks — is evaluated in process by Calcite, which runs inside your application through IKVM.
Install
dotnet add package Apache.Calcite.Cosmos.Adapter
dotnet add package Apache.Calcite.Data
Apache.Calcite.Data is the ADO.NET provider your code talks to; this package plugs Cosmos into it.
Register a database
{
"version": "1.0",
"defaultSchema": "COSMOS",
"schemas": [{
"name": "COSMOS",
"type": "custom",
"factory": "Apache.Calcite.Cosmos.Adapter.CosmosSchemaFactory, Apache.Calcite.Cosmos.Adapter",
"operand": {
"endpoint": "https://myaccount.documents.azure.com:443/",
"database": "inventory",
"containers": [ "products", "orders" ]
}
}]
}
Give a key to use an account key, or none to sign in with Microsoft Entra ID. Omit containers to
expose every container, or database to expose the whole account.
The factory must be named assembly-qualified, as above, and its assembly loaded before the model is
read — _ = new Apache.Calcite.Cosmos.Adapter.CosmosSchemaFactory(); at start-up does it.
Query
await using var connection = new CalciteConnection(new CalciteConnectionStringBuilder
{
Model = "inline:" + model,
CaseSensitive = true,
DefaultNullCollation = "LOW",
}.ConnectionString);
await connection.OpenAsync();
await using var command = connection.CreateCommand();
command.CommandText = """
SELECT c."id", JSON_VALUE(c."DOC", '$.name') AS "name"
FROM "products" AS c
WHERE c."$.category" = 'bikes'
""";
await using var reader = await command.ExecuteReaderAsync();
while (await reader.ReadAsync())
Console.WriteLine(reader.GetString(1));
Each container is a table with one column holding the whole document, DOC, reached with JSON_VALUE
and JSON_QUERY, plus id, _ts, _etag and the partition key. Set DefaultNullCollation = "LOW" so
sorts can run at the service, and read with the asynchronous methods — the Cosmos SDK has no
synchronous reads.
Features
- Filters, projections, sorts, paging, aggregation and array traversal pushed down — partially where a whole operator cannot be
- Partition routing and point reads recovered from the predicate
- Lookup joins that fetch only the documents another source's keys match
INSERT,UPDATEandDELETE- JSON Schema and
UNIQUEdeclarations that let UUIDs, timestamps and numbers stored as text push down - Full text search, vector search and geodesic geography
- Request-unit metrics and traces through
System.Diagnostics
Documentation
The user manual covers configuration, the row model, what pushes down and why, writing, declarations, performance, monitoring and troubleshooting.
License
Apache License 2.0.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- Apache.Calcite.Extensions (>= 2.0.1-pre.267)
- Apache.Calcite.FullText (>= 2.0.1-pre.267)
- Apache.Calcite.Geography (>= 2.0.1-pre.267)
- Azure.Identity (>= 1.21.0)
- IKVM (>= 8.16.1)
- IKVM.Java.Extensions (>= 8.16.1)
- IKVM.Maven.Sdk (>= 1.12.1)
- Microsoft.Azure.Cosmos (>= 3.63.0)
- Newtonsoft.Json (>= 13.0.4)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0-pre.316 | 0 | 10/10/2026 |
| 1.0.0-pre.312 | 0 | 10/10/2026 |
| 1.0.0-pre.305 | 0 | 10/10/2026 |
| 1.0.0-pre.297 | 0 | 10/10/2026 |
| 1.0.0-pre.291 | 23 | 10/9/2026 |
| 1.0.0-pre.287 | 86 | 9/30/2026 |
| 1.0.0-pre.283 | 103 | 9/28/2026 |
| 1.0.0-pre.278 | 56 | 9/26/2026 |
| 1.0.0-pre.275 | 116 | 9/22/2026 |
| 1.0.0-pre.266 | 82 | 9/22/2026 |
| 1.0.0-pre.257 | 91 | 9/21/2026 |
| 1.0.0-pre.255 | 64 | 9/20/2026 |
| 1.0.0-pre.251 | 63 | 9/20/2026 |
| 1.0.0-pre.249 | 65 | 9/20/2026 |
| 1.0.0-pre.238 | 65 | 9/20/2026 |
| 1.0.0-pre.233 | 83 | 9/19/2026 |
| 1.0.0-pre.2 | 70 | 8/31/2026 |
| 1.0.0-pre.1 | 87 | 8/14/2026 |