Repository navigation
Fixes 25991: Enable https scheme support for Druid connector - #32120
Conversation
The schema change on its own left the new schemes unreachable and untested. The committed UI type still declared DruidScheme as `druid` only, so the connection form could not offer the values the schema now accepts. The unit tests landed in tests/unit/test_source_connection.py -- whose Druid, Vertica and PinotDB cases had already moved to connector-specific modules -- and imported a module-level get_connection_url that no longer exists. And the integration test only ever built a `druid://` engine, so a scheme the schema accepts but SQLAlchemy cannot resolve would still have passed it. - regenerate DruidScheme in the committed UI types - move the URL assertions to tests/unit/source/database/druid/test_connection.py and pin every enum member to an installed SQLAlchemy dialect - run the integration suite once per DruidScheme against a Druid broker that serves plaintext and TLS at the same time, with druid+https validating the broker certificate against its CA rather than skipping verification - fix the database FQN the ingestion assertion looks up: the connection leaves databaseName unset, so the connector names the database `default`, not `druid` - fix the container command: the image entrypoint takes a service name, and the all-in-one quickstart scripts it ships need Perl and Python, neither of which is in the image - document the schemes and ssl_verify_cert in the in-app connector docs Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
✅ PR checks passedThe linked issue has a description and all required Shipping project fields set. Thanks! |
There was a problem hiding this comment.
Pull request overview
This PR expands the Druid connector’s connection scheme support to include druid+http and druid+https across the JSON Schema, regenerated UI types, and ingestion tests, enabling TLS-secured Druid brokers to be configured from the UI and workflow YAMLs.
Changes:
- Extend
DruidSchemeenum values in the Druid connection JSON schema and regenerate the UI enum to match. - Add/extend ingestion unit tests to validate URL construction for every supported scheme (and dialect resolution when
pydruidis installed). - Add Druid ingestion integration tests that run metadata ingestion + Test Connection against a real broker over both plaintext and TLS.
Reviewed changes
Copilot reviewed 5 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| openmetadata-ui/src/main/resources/ui/src/generated/entity/services/connections/database/druidConnection.ts | Regenerated UI enum to include druid+http and druid+https. |
| openmetadata-ui/src/main/resources/ui/public/locales/en-US/Database/Druid.md | Updates connector docs to describe scheme options and ssl_verify_cert. |
| openmetadata-spec/src/main/resources/json/schema/entity/services/connections/database/druidConnection.json | Expands schema enum for scheme to allow druid+http and druid+https. |
| ingestion/tests/unit/source/database/druid/test_connection.py | Adds scheme-parameterized URL tests and optional dialect-resolution checks. |
| ingestion/tests/integration/druid/conftest.py | Adds containerized Druid+ZooKeeper fixtures and parametrizes service creation over all schemes. |
| ingestion/tests/integration/druid/test_metadata.py | Adds integration tests validating ingestion and Test Connection workflow per scheme. |
Suppressed comments (1)
ingestion/tests/unit/source/database/druid/test_connection.py:25
- These two consecutive imports are from the same module and can be combined; this keeps import sections cleaner and helps avoid isort/ruff churn.
from metadata.generated.schema.entity.services.connections.database.druidConnection import (
DruidConnection as DruidConnectionConfig,
)
from metadata.generated.schema.entity.services.connections.database.druidConnection import (
DruidScheme,
)
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| DRUID_IMAGE = "apache/druid:30.0.0" | ||
| ZOOKEEPER_IMAGE = "zookeeper:3.9" | ||
| BROKER_PLAINTEXT_PORT = 8082 |
There was a problem hiding this comment.
Agreed — fixed in f07b09e. Pinned to zookeeper:3.9.5, the patch release 3.9 currently resolves to (same digest sha256:f258365d…), so the suite is reproducible without a behaviour change today.
apache/druid:30.0.0 was already fully pinned.
Re-ran the suite on the pinned tag:
$ pytest ingestion/tests/integration/druid -v
test_ingest_metadata[druid] PASSED
test_connection_workflow[druid] PASSED
test_ingest_metadata[druid+http] PASSED
test_connection_workflow[druid+http] PASSED
test_ingest_metadata[druid+https] PASSED
test_connection_workflow[druid+https] PASSED
6 passed in 20.74s
✅ TypeScript Types Auto-UpdatedThe generated TypeScript types have been automatically updated based on JSON schema changes in this PR. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 18 changed files in this pull request and generated no new comments.
Suppressed comments (4)
Previously missed (2) — in code that hasn't changed since the last review.
ingestion/tests/integration/druid/conftest.py:31
- The integration suite will error at engine creation if
pydruidis not installed in the test environment (SQLAlchemy won’t be able to resolve thedruiddialect). Skip the suite early with a clear reason (or ensurepydruidis always installed) to avoid a confusing runtime failure after containers start.
This issue also appears on line 187 of the same file.
import pytest
import requests
ingestion/tests/unit/source/database/druid/test_connection.py:76
- This test is described as ensuring every
DruidSchememember resolves to an installed SQLAlchemy dialect, butpytest.importorskip("pydruid")means the assertion is skipped entirely whenpydruidisn’t present. If the intent is to fail CI when a scheme is in the schema but the driver is missing, CI/test deps need to guaranteepydruidis installed (or this test should hard-fail when it isn’t).
@pytest.mark.parametrize("scheme", list(DruidScheme))
def test_every_scheme_maps_to_an_installed_dialect(scheme):
"""A scheme the schema accepts but SQLAlchemy cannot resolve fails at engine creation.
pydruid registers druid, druid.http and druid.https as entry points; this pins the
enum to what is actually installed instead of to a hardcoded list.
"""
pytest.importorskip("pydruid")
from sqlalchemy.engine.url import make_url
ingestion/tests/integration/druid/conftest.py:195
scheme.value.endswith("https")is a brittle way to branch on the enum (it depends on string formatting rather than the enum member). Use an explicit enum comparison so future Druid scheme additions don’t accidentally fall into the HTTPS path.
scheme: DruidScheme = request.param
if scheme.value.endswith("https"):
host_port = f"localhost:{druid_container.get_exposed_port(BROKER_TLS_PORT)}"
# pydruid forwards ssl_verify_cert to requests' verify, so pointing it at the CA
# asserts the certificate is actually validated instead of waved through.
connection_arguments = {"ssl_verify_cert": str(druid_tls.ca_certificate)}
else:
host_port = f"localhost:{druid_container.get_exposed_port(BROKER_PLAINTEXT_PORT)}"
connection_arguments = None
ingestion/tests/integration/druid/conftest.py:55
zookeeper:3.9is a moving tag, which can make integration tests non-deterministic if upstream changes the image. Pin to a specific patch version (or digest) to keep CI stable and reproducible.
DRUID_IMAGE = "apache/druid:30.0.0"
ZOOKEEPER_IMAGE = "zookeeper:3.9"
pytest.importorskip("pydruid") made the dialect check conditional, so the
guarantee it advertises -- a scheme in the schema without a working driver
fails in CI -- would silently evaporate wherever pydruid was missing. It never
is: pydruid lives in the `all` and `all-dev-env` extras, which are what the CI
unit lane (`nox -s unit-tests` installs `.[all]`) and `make install_dev_env`
both pull in. Dropped the skip and corrected the module docstring, which
claimed the opposite.
zookeeper:3.9 is a floating tag that can move under CI between runs; pinned to
3.9.5, the patch release it currently resolves to. Sibling suites pin fully
(apache/airflow:3.3.1-python3.10, timescale/timescaledb:2.14.2-pg15).
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 18 changed files in this pull request and generated no new comments.
Suppressed comments (3)
Previously missed (2) — in code that hasn't changed since the last review.
ingestion/tests/integration/druid/conftest.py:140
- The Zookeeper container setup is written as a long single line, which hurts readability and is likely to violate the repository’s Python formatting/lint rules for max line length. Please format the chained builder calls using parentheses so automated formatting is stable.
def zookeeper_container(druid_network):
container = DockerContainer(ZOOKEEPER_IMAGE).with_network(druid_network).with_network_aliases("zookeeper")
with container:
wait_for_logs(container, "binding to port", timeout=180)
yield container
ingestion/tests/integration/druid/test_metadata.py:69
- This call line is very long and would be clearer (and more formatter-friendly) if split across multiple lines with explicit keyword arguments.
This issue also appears on line 97 of the same file.
segments = metadata.get_by_name(entity=Table, fqn=f"{database_fqn}.sys.segments", fields=["columns"])
ingestion/tests/integration/druid/test_metadata.py:97
- This delete call is long; splitting it across multiple lines makes it easier to read and aligns with the formatting used in other integration tests.
metadata.delete(entity=Workflow, entity_id=str(automation_workflow.id.root), hard_delete=True)
✅ Playwright Results — workflow succeededValidated commit ✅ 825 passed · ❌ 0 failed · 🟡 0 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky PerformanceBlocking targets: ✅ met · Optimization targets: 🟡 in progress Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting. 🕒 Full workflow signal wall (to summary) 52m 12s ⏱️ Max setup 5m 7s · max shard execution 17m 51s · max shard-job elapsed before upload 21m 21s · reporting 6s 🌐 215.09 requests/attempt · 2.48 app boots/UI scenario · 16.90% common-shard skew Optimization targets still in progress:
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
Both containers ship sized for real workloads, which is wasteful for a suite that only reads INFORMATION_SCHEMA and sys, and shard-3 is explicitly the disk- and memory-constrained catch-all lane. - ZooKeeper defaults to a 1 GB heap (verified: -Xmx1000m); a single-node ensemble holding one broker's announcements runs fine on 256m. - The nano-quickstart broker asks for a 512m heap plus 400m direct and derives numThreads from the core count. Pinning one processing thread drops the direct-memory requirement to buffer.sizeBytes (50MiB) * (1 + 2 + 1) = 200MiB, so 384m heap and 320m direct leave headroom. Measured after: broker 679 MiB RSS, ZooKeeper 97 MiB, against roughly 2 GB of heap and direct reservations before. Suite still passes 6/6. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Triaged the red All six Druid tests passed in the failing job. The failures were Trino: The Trino container died mid-run — the profiler logged It is nondeterministic: the same commit That said, this suite does add load to the lane the workflow comment calls "deliberately the lightest", so I have trimmed its footprint in 3edbd7d:
Pinning one processing thread drops the direct-memory requirement to One thing I have deliberately not done: |
Code Review ✅ Approved 1 resolved / 1 findingsAdds ✅ 1 resolved✅ Quality: importorskip weakens the claimed CI dialect guarantee
OptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|
|



Describe your changes:
Fixes #25991
Supersedes #27513 (same author's commits cherry-picked here — that PR came from a fork we could not push review fixes to).
I worked on making the Druid connector reach TLS-secured brokers because the connection schema only ever accepted the plaintext
druidscheme, so there was no way to configuredruid+httpsfrom the UI or from a workflow YAML.What changed
druidConnection.json—druidSchemegrows from["druid"]to["druid", "druid+http", "druid+https"], default unchanged, so existing services keep working and no migration is needed. pydruid already registers all three as SQLAlchemy entry points (druid,druid.http,druid.https), so nothing in the connector itself has to change.DruidSchemeinsrc/generated/.../druidConnection.tsstill declareddruidonly, so the connection form could not have offered the new values.DruidSchememember is asserted to build the right URL and to resolve to an installed SQLAlchemy dialect, so a scheme added to the schema without a working driver fails in CI rather than at a user's first ingestion.DruidSchememember.ssl_verify_certconnection argument.Type of change:
High-level design:
Why a broker + ZooKeeper and not the quickstart. The official
apache/druidimage runs one service per container: its entrypoint takes a service name, and the all-in-onebin/start-nano-quickstart/bin/supervisescripts it ships need Perl and Python, neither of which is in the image. ZooKeeper plus a broker is the smallest deployment that answers Druid SQL, and it is enough for metadata extraction —INFORMATION_SCHEMAand thesystables are served by the broker and need no coordinator, historical or middle manager.Why Druid's own TLS and not a proxy.
/druid.shturns everydruid_*environment variable into a runtime property, so the broker is configured withdruid.enableTlsPort=trueand a PKCS12 keystore generated by the fixture. Plaintext (8082) and TLS (8282) are served simultaneously, so one cluster covers all three schemes. Terminating TLS at an nginx sidecar would have been simpler to write but would have tested nginx, not Druid's HTTPS listener.Why verify the certificate. pydruid forwards
ssl_verify_certtorequests'verify, so thedruid+httpsparameter points it at the CA the fixture generated instead of passingfalse. The test therefore asserts the certificate is actually validated — the failure mode a user hits with a private CA — rather than that verification can be switched off.Backward compatibility. The enum only gains values and the default stays
druid, so stored services deserialize unchanged and nobootstrap/sqlmigration is required.Tests:
Use cases covered
druid+httpsagainst a broker behind TLS and the Test Connection step succeedsdruidscheme and for the explicitdruid+httpUnit tests
ingestion/tests/unit/source/database/druid/test_connection.py— URL parity for all three schemes, plus a check that everyDruidSchememember resolves to an installed dialect.Backend integration tests
DruidSchemePOJO is regenerated from the schema at build time).Verified the regenerated POJO deserializes the new values, which is what a stale server binary rejects:
Ingestion integration tests
ingestion/tests/integration/druid/conftest.py— ZooKeeper + Druid broker with a self-signed PKCS12 keystore, serving plaintext and TLS;create_service_requestparametrised overDruidScheme.ingestion/tests/integration/druid/test_metadata.py—test_ingest_metadata(schemas, tables, columns) andtest_connection_workflow(the Test Connection automation the UI runs).tests/integration/druidlands in the shard-3 catch-all, so no CI shard configuration changes are needed.Playwright (UI) tests
src/generated/, which feeds the schema-driven connection form; there is no new component or behaviour to drive.Manual testing performed
druid.enableTlsPort=trueand confirmedGET /status/healthreturnstrueon bothhttp://localhost:8082andhttps://localhost:8282.druid://,druid+http://anddruid+https://and ranSELECT 1,get_schema_names(),get_table_names()andget_columns()against each, withdruid+httpsboth CA-verified and with verification disabled.UI screen recording / screenshots:
Not applicable — no visual change; the connection form is generated from the JSON Schema and picks up the two new scheme options automatically.
Checklist:
I have read the CONTRIBUTING document.
My PR title is
Fixes <issue-number>: <short explanation>My PR is linked to a GitHub issue via
Fixes #<issue-number>above.I have commented on my code, particularly in hard-to-understand areas.
For JSON Schema changes: I updated the migration scripts or explained why it is not needed.
For UI changes: I attached a screen recording and/or screenshots above.
I have added tests (unit / integration / Playwright as applicable) and listed them above.
I have added tests around the new logic.
For connector/ingestion changes: I updated the documentation.
Credit
The schema change and the first pass at the integration test are @mohitjeswani01's commits, cherry-picked from #27513 with authorship preserved.
🤖 Generated with Claude Code
Greptile Summary
The PR expands the Druid connection contract to support explicit HTTP and HTTPS schemes while preserving the existing default.
Confidence Score: 5/5
The PR appears safe to merge.
No blocking failure remains.
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart LR Schema[Druid JSON schema] --> Models[Generated connection models] Models --> Form[Schema-driven connection form] Models --> Connector[Python Druid connector] Connector --> URL{Selected scheme} URL -->|druid or druid+http| HTTP[Plaintext broker] URL -->|druid+https| HTTPS[TLS broker] CA[ssl_verify_cert connection argument] --> HTTPSReviews (4): Last reviewed commit: "Shrink the Druid suite's footprint on th..." | Re-trigger Greptile