Skip to content

Fixes 25991: Enable https scheme support for Druid connector - #27513

Closed
mohitjeswani01 wants to merge 7 commits into
open-metadata:mainfrom
mohitjeswani01:fix/25991-druid-https-support
Closed

mohitjeswani01 wants to merge 7 commits into
open-metadata:mainfrom
mohitjeswani01:fix/25991-druid-https-support

Conversation

@mohitjeswani01

@mohitjeswani01 mohitjeswani01 commented Apr 18, 2026 •

Copy link
Copy Markdown
Contributor

Description:

Fixes #25991

I worked on expanding the Druid connection JSON schema to officially support the druid+http and druid+https schemes because the connector previously lacked the ability to connect to secured endpoints.

What changes did you make?

  • Surgically updated druidConnection.json to expand the druidScheme enum from ["druid"] to ["druid", "druid+http", "druid+https"].
  • The Pydantic model generator automatically picks up this change and makes it available to the ingestion Python builders.
  • I maintained backward compatibility by keeping the default value as "druid". Therefore, no JSON migration scripts are necessary since existing connections will default correctly and remain completely unaffected.

How did I test my changes?

  • Regenerated the Python Pydantic models locally using make generate.
  • Installed all the unit testing database dependencies (make install_test).
  • Added robust unit tests to ingestion/tests/unit/test_source_connection.py to assert that the URL builder correctly consumes druid+http and druid+https.
  • Ran pytest locally which successfully passed.

Screenshots proving local test success:

image

Result
image

Type of change:

  • Improvement

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes 25991: Enable https scheme support for Druid connector
  • 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.
  • I have added tests around the new logic.
  • For connector/ingestion changes: I updated the documentation.

Summary by Gitar

  • New unit tests:
    • Added comprehensive test cases for DatabricksConnection and UnityCatalogConnection to verify connection URL generation.
    • Included tests for URL encoding with special characters in catalog names and validated DatabricksPipelineConnection patterns.
  • Integration testing:
    • Added Druid integration tests using testcontainers and pytest fixtures to verify metadata discovery.

This will update automatically on new commits.

Greptile Summary

This PR adds HTTP and HTTPS scheme support to the Druid connector. The main changes are:

  • Adds druid+http and druid+https to the connection schema.
  • Adds unit coverage for Druid connection URLs.
  • Adds a container-based Druid metadata integration test.

Confidence Score: 4/5

The updated code introduces no additional blocking issue that requires a separate change.

  • No new failure distinct from the existing review findings was found.
  • The schema default remains backward compatible.
  • The new tests cover URL construction and metadata discovery.

Important Files Changed

Filename Overview
openmetadata-spec/src/main/resources/json/schema/entity/services/connections/database/druidConnection.json Adds the HTTP and HTTPS Druid scheme values while preserving the existing default.
ingestion/tests/integration/druid/conftest.py Adds the Druid container and database service fixtures used by integration tests.
ingestion/tests/integration/druid/test_metadata.py Adds an ingestion test that checks discovery of a Druid database schema.
ingestion/tests/unit/test_source_connection.py Adds URL construction coverage for the supported Druid schemes.

Reviews (3): Last reviewed commit: "Merge branch 'main' into fix/25991-druid..." | Re-trigger Greptile

Context used:

  • Context used - CLAUDE.md (source)
  • Context used - AGENTS.md (source)

@mohitjeswani01
mohitjeswani01 requested a review from a team as a code owner April 18, 2026 14:13
Copilot AI lite review requested due to automatic review settings April 18, 2026 14:13
@github-actions

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Expands the Druid ingestion connector’s connection schema to allow explicit druid+http and druid+https SQLAlchemy URL schemes, enabling connectivity to secured endpoints while keeping druid as the default for backward compatibility.

Changes:

  • Updated druidConnection.json to extend the druidScheme enum with druid+http and druid+https.
  • Extended ingestion unit tests to validate URL building for the new schemes.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
openmetadata-spec/src/main/resources/json/schema/entity/services/connections/database/druidConnection.json Adds druid+http and druid+https to supported Druid schemes while preserving the default.
ingestion/tests/unit/test_source_connection.py Adds assertions that Druid URL construction supports the new schemes.

@github-actions

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@mohitjeswani01

Copy link
Copy Markdown
Contributor Author

Hi @harshach , I have addressed all the feedback from the bots (Gitar and Copilot) by updating the unit tests to use the generated DruidScheme enum members instead of raw string literals. This ensures better type-safety and consistency across the ingestion framework.

Could you please review and kindly add the safe to test label so the CI workflows can run? Thank you for your time!🙏

@harshach

Copy link
Copy Markdown
Collaborator

@mohitjeswani01 since druid is available as docker, it would be good to write a integration test to make sure this works. Check the integration tests for ingestion

Copilot AI review requested due to automatic review settings April 18, 2026 20:03
@github-actions

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@mohitjeswani01

Copy link
Copy Markdown
Contributor Author

@mohitjeswani01 since druid is available as docker, it would be good to write a integration test to make sure this works. Check the integration tests for ingestion

thanks for informing @harshach sir👋

Added an integration test for the Druid connector as requested.

Created ingestion/tests/integration/druid/ following the
existing testcontainers pattern (same as cockroach, mongodb):

  • conftest.py — spins up apache/druid:30.0.0 via testcontainers,
    waits for /status/health to return 200, creates DruidConnection
    service request
  • test_metadata.py — runs MetadataWorkflow and asserts at least
    one schema is discovered from Druid's built-in system schemas
  • init.py — module init

The test uses DruidScheme.druid (plain http) for container
connectivity. The druid+http and druid+https schemes are
validated in the existing unit test.

Ready for re-review! 🙏
image
image

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Expands the Druid database connection schema to support SQLAlchemy-style driver schemes for secured endpoints (druid+http, druid+https), and updates ingestion tests to validate URL construction and basic Druid ingestion behavior.

Changes:

  • Extended druidScheme enum in the Druid connection JSON schema to include druid+http and druid+https.
  • Updated unit tests to assert correct URL generation for the new schemes.
  • Added a Druid integration test (with dockerized Druid) to validate metadata ingestion path.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
openmetadata-spec/src/main/resources/json/schema/entity/services/connections/database/druidConnection.json Adds druid+http / druid+https to the supported scheme enum.
ingestion/tests/unit/test_source_connection.py Extends Druid URL unit test coverage to the new scheme variants.
ingestion/tests/integration/druid/test_metadata.py New integration test validating Druid workflow discovers schemas.
ingestion/tests/integration/druid/conftest.py New Druid container + service setup fixtures for integration testing.
ingestion/tests/integration/druid/init.py Adds package marker for the new integration test folder.

@github-actions

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

Copilot AI review requested due to automatic review settings April 18, 2026 20:13
@github-actions

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Expands the Druid connector connection schema to support explicit druid+http and druid+https SQLAlchemy schemes, and adds tests to validate URL construction and basic end-to-end metadata ingestion against a Druid container.

Changes:

  • Extend druidScheme enum in the Druid connection JSON schema to include druid+http and druid+https.
  • Update unit tests to assert the Druid connection URL builder emits the new schemes correctly.
  • Add a new Druid integration test suite using testcontainers to validate metadata ingestion against a running Druid instance.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
openmetadata-spec/src/main/resources/json/schema/entity/services/connections/database/druidConnection.json Adds druid+http and druid+https to the allowed connection schemes.
ingestion/tests/unit/test_source_connection.py Extends the Druid URL unit test to cover the new schemes.
ingestion/tests/integration/druid/conftest.py Introduces a Druid container fixture + service creation request for integration testing.
ingestion/tests/integration/druid/test_metadata.py Runs a metadata workflow and asserts Druid schemas are discovered.
ingestion/tests/integration/druid/init.py Adds package marker for the new Druid integration test suite.

@mohitjeswani01
mohitjeswani01 force-pushed the fix/25991-druid-https-support branch from 75cdc25 to ff2c114 Compare April 30, 2026 12:12
@github-actions

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@mohitjeswani01

Copy link
Copy Markdown
Contributor Author

hi @harshach , @PubChimps sir may i get a safe to test label ? i recently resolved the merge conflicts in this pr. thanks 🙏

@ayush-shah

Copy link
Copy Markdown
Member

Thanks for the PR. This needs to be updated against the latest main before we can move it forward.

Could you please rebase on main, resolve any conflicts if present, push the updated branch, and let CI rerun? Once the checks are green, we can re-check merge readiness.

Copilot AI review requested due to automatic review settings May 20, 2026 07:02
@mohitjeswani01

Copy link
Copy Markdown
Contributor Author

done @ayush-shah

@github-actions

Copy link
Copy Markdown
Contributor

This PR has had no activity for 30 days and will be closed in 7 days if no further activity occurs.
Feel free to reopen it if you'd like to continue working on it.

@github-actions github-actions Bot added the Stale label Aug 22, 2026
Copilot AI review requested due to automatic review settings August 25, 2026 05:31
@github-actions github-actions Bot removed the safe to test Add this label to run secure Github workflows on PRs label Aug 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Suppressed comments (1)

openmetadata-spec/src/main/resources/json/schema/entity/services/connections/database/druidConnection.json:20

  • The schema enum has been expanded, but the committed UI generated TypeScript still defines DruidScheme as only "druid" (see openmetadata-ui/src/main/resources/ui/src/generated/entity/services/connections/database/druidConnection.ts). Please regenerate and commit the updated UI generated types so the UI can represent/select druid+http and druid+https consistently with the schema.
    "druidScheme": {
      "description": "SQLAlchemy driver scheme options.",
      "type": "string",
      "enum": ["druid", "druid+http", "druid+https"],
      "default": "druid"
    }

Comment on lines +49 to +52
config=DruidConnection(
scheme=DruidScheme.druid,
hostPort=f"{druid_container.get_container_host_ip()}:{druid_container.get_exposed_port(8082)}",
)
@github-actions github-actions Bot removed the Stale label Aug 25, 2026
Copilot AI review requested due to automatic review settings August 25, 2026 13:28
@github-actions

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@gitar-bot

gitar-bot Bot commented Aug 25, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 1 resolved / 1 findings

Expands the Druid connection schema and URL builder to support HTTP and HTTPS schemes with comprehensive unit and integration tests. No issues found.

✅ 1 resolved
✅ Quality: Tests use string literals instead of DruidScheme enum members

📄 ingestion/tests/unit/test_source_connection.py:657 📄 ingestion/tests/unit/test_source_connection.py:663
The new test cases at lines 657 and 663 pass scheme="druid+http" and scheme="druid+https" as raw strings, while the existing test at line 651 correctly uses scheme=DruidScheme.druid. Using enum members would be more type-safe, consistent, and would also verify the generated enum actually contains these new values.

Options

Display: compact → Showing less information.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Suppressed comments (2)

ingestion/tests/unit/test_source_connection.py:483

  • metadata.ingestion.source.database.pinotdb.connection similarly does not export a module-level get_connection_url function; it only defines PinotDBConnection.get_connection_url(...) as a staticmethod. Importing get_connection_url here will fail. Update the test to call the handler’s staticmethod (or import the handler class) instead.
        from metadata.ingestion.source.database.pinotdb.connection import (
            get_connection_url,
        )

        expected_url = "pinot://localhost:8099/query/sql?controller=http://localhost:9000/"
        pinot_conn_obj = PinotDBConnection(
            scheme=PinotDBScheme.pinot,
            hostPort="localhost:8099",

openmetadata-spec/src/main/resources/json/schema/entity/services/connections/database/druidConnection.json:19

  • The schema enum was expanded, but the committed UI generated type for Druid still only allows "druid" (see openmetadata-ui/src/main/resources/ui/src/generated/entity/services/connections/database/druidConnection.ts:172-174). Please regenerate and commit the updated UI generated types so the UI and schema stay in sync and the new scheme values are selectable.
      "description": "SQLAlchemy driver scheme options.",
      "type": "string",
      "enum": ["druid", "druid+http", "druid+https"],
      "default": "druid"

Comment on lines +459 to +473
from metadata.ingestion.source.database.druid.connection import (
get_connection_url,
)

expected_url = "druid://localhost:8082/druid/v2/sql"
druid_conn_obj = DruidConnection(scheme=DruidScheme.druid, hostPort="localhost:8082")
assert expected_url == get_connection_url(druid_conn_obj)

expected_url = "druid+http://localhost:8082/druid/v2/sql"
druid_conn_obj = DruidConnection(scheme=DruidScheme.druid_http, hostPort="localhost:8082")
assert expected_url == get_connection_url(druid_conn_obj)

expected_url = "druid+https://localhost:8082/druid/v2/sql"
druid_conn_obj = DruidConnection(scheme=DruidScheme.druid_https, hostPort="localhost:8082")
assert expected_url == get_connection_url(druid_conn_obj)
Comment on lines +435 to +437
def test_vertica_url(self):
expected_url = "vertica+vertica_python://username:password@localhost:5443/database"
vertica_conn_obj = VerticaConnection(
@harshach harshach added the safe to test Add this label to run secure Github workflows on PRs label Aug 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

The Python checkstyle failed.

Please run make py_format and py_format_check in the root of your repository and commit the changes to this PR.
You can also use pre-commit to automate the Python code formatting.

You can install the pre-commit hooks with make install_test precommit_install.

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ TypeScript Types Need Update

The generated TypeScript types are out of sync with the JSON schema changes.

Since this is a pull request from a forked repository, the types cannot be automatically committed.
Please generate and commit the types manually:

cd openmetadata-ui/src/main/resources/ui
./json2ts-generate-all.sh -l true
git add src/generated/
git commit -m "Update generated TypeScript types"
git push

After pushing the changes, this check will pass automatically.

@harshach

Copy link
Copy Markdown
Collaborator

Thanks a lot for this @mohitjeswani01 — the schema change is right, and it's now on its way in.

Since this PR comes from a fork we can't push to, I've cherry-picked your commits into #32120 with your authorship preserved and finished the remaining work on top:

  • Regenerated the committed UI type. src/generated/.../druidConnection.ts still declared DruidScheme as druid only, so the connection form couldn't have offered the new values.
  • Moved the unit tests. The Druid, Vertica and PinotDB cases in tests/unit/test_source_connection.py had already been moved to connector-specific modules on main, so those additions were re-adding deleted tests — and they imported a module-level get_connection_url that no longer exists (only DruidConnection.get_connection_url as a staticmethod), which would have failed at import. They now live in tests/unit/source/database/druid/test_connection.py.
  • Made the integration test exercise the new schemes. It only ever built a druid:// engine, so a scheme the schema accepts but SQLAlchemy can't resolve would still have passed. It's now parametrised over every DruidScheme member.
  • Fixed the container command. apache/druid's entrypoint takes a service name, and the all-in-one quickstart scripts it ships need Perl and Python — neither is in the image — so the fixture as written couldn't start Druid. The suite now runs ZooKeeper plus a broker, which is the smallest deployment that answers Druid SQL.
  • Added real HTTPS. The broker now serves plaintext and TLS at the same time via druid.enableTlsPort, and the druid+https run validates the broker certificate against its CA rather than skipping verification.
  • Fixed the database FQN. The assertion looked up ${service}.druid, but the connection leaves databaseName unset, so the connector names the database default.
  • Documented the schemes and the ssl_verify_cert connection argument in the in-app connector docs.

Closing in favour of #32120. Thanks again for the contribution and for sticking with the review!

@harshach

Copy link
Copy Markdown
Collaborator

Merged it here #32120

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Druid add support for https connection

6 participants