Skip to content

Fixes #31345: Add ClickZetta database connector - #30907

Merged
ulixius9 merged 25 commits into
open-metadata:mainfrom
iamkiayun:codex/clickzetta-upstream-a946
Sep 15, 2026
Merged

ulixius9 merged 25 commits into
open-metadata:mainfrom
iamkiayun:codex/clickzetta-upstream-a946

Conversation

@iamkiayun

@iamkiayun iamkiayun commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes #31345

OpenMetadata can create and operate ClickZetta database services through the same connector framework used by other SQLAlchemy databases. This PR includes catalog metadata, native usage and query lineage, standard profiling and data-quality execution, native sampling, data diff, and the attached DBT artifact workflow.

The latest follow-up removes ClickZetta-only capability restrictions. Operators now use OpenMetadata's normal sampling, filters, test definitions, and workflow scope instead of a connector-specific 1,000-row limit or full-scan opt-in.

Type of change:

  • Bug fix
  • Improvement
  • New feature
  • Breaking change
  • Documentation

High-level design:

  • Uses the ClickZetta SQLAlchemy dialect for connectivity and catalog extraction with clickzetta-connector==1.0.30 and clickzetta-sqlalchemy==0.8.65.4.
  • Maps workspace-local information_schema.job_history or cross-workspace sys.information_schema.job_history into OpenMetadata usage and query-lineage records. Workflows keep their configured time window and result limit.
  • Inherits OpenMetadata's standard SQLAlchemy profiler and test-suite interfaces instead of maintaining reduced ClickZetta-only copies.
  • Implements ClickZetta sampling with native TABLESAMPLE ROW and TABLESAMPLE SYSTEM syntax for row-count and percentage sampling.
  • Keeps ClickZetta-specific data-diff schema discovery through DESCRIBE, then uses standard generated comparison queries. Existing allowFullTableScan=true configurations remain accepted. An explicit legacy false value raises a migration error instead of silently enabling data reads.
  • Enables the standard attached DBT artifact workflow. It reads manifest.json and optional DBT artifacts from the configured source; it does not run DBT models or execute ClickZetta SQL.
  • Adds no OpenMetadata database migration.

Profiling, custom SQL tests, sampling, and data diff can read table data. Production operators should use normal OpenMetadata sampling, database/schema/table filters, and explicitly scoped workflows.

Tests:

Use cases covered

  • A user can configure ClickZetta and ingest database, schema, table, view, and column metadata.
  • Usage and query lineage can read either supported native history view when the ingestion identity has permission.
  • Profiling and standard data-quality validators use the shared SQLAlchemy interfaces.
  • Sampling compiles all four ClickZetta combinations: rows or percentage with row or system sampling.
  • Data diff loads ClickZetta types through DESCRIBE and executes generated comparison queries without a private connector gate.
  • DBT capability flags expose the standard artifact ingestion pipeline.

Unit tests

  • I added unit tests for the new and changed logic.
  • Focused ClickZetta suite in the pinned ingestion image: 62 passed.
  • Shared profiler, service-spec, and sampler regression suite: 68 passed.
  • Ruff checks and format checks passed for all changed Python files.
  • JSON Schema validation, generated TypeScript Prettier validation, and git diff --check passed.

Backend integration tests

  • Not applicable (no backend API changes).

Ingestion integration tests

  • No upstream credentialed ClickZetta CI identity or public fixture is available.
  • Earlier bounded live checks covered a 10-row sample, a count metric, a not-null validator, typed-table data diff, and native usage/query-lineage ingestion against explicitly named seller_center objects.
  • This follow-up ran no production table scans or whole-schema workflows. Native TABLESAMPLE ROW and SYSTEM query shapes are covered offline and should receive a bounded post-deploy smoke test.

Playwright (UI) tests

  • No new Playwright E2E test is included.
  • Existing credential-free captures cover the ClickZetta service picker, schema loader, icon, and connection form.

Manual testing performed

  1. Ran the focused connector suite inside the pinned OpenMetadata 1.13.0 ingestion image.
  2. Ran shared profiler, service-spec, and sampler regression tests in the same image.
  3. Validated the connection schema and generated UI type formatting.
  4. Confirmed the legacy data-diff opt-out cannot silently become permission to query data.

Post-Deploy Monitoring & Validation

  • Start with one explicitly named small seller_center table and conservative sampling. Do not begin with a whole-schema profiler or data-diff run.
  • During the first 24 hours and the first run of each newly enabled pipeline, monitor ingestion logs for ClickZetta SQL syntax errors, permission errors, unexpected full-table jobs, and abnormal runtime or virtual-cluster usage.
  • Treat metadata, DBT, profiler, test, sampling, and data-diff pipelines as healthy only when the intended scoped run finishes successfully and ClickZetta job history shows the expected query count and table scope.
  • Keep usage and lineage pipelines time-bounded and result-limited. The current production configuration uses manual runs, a seller_center filter, concurrency 1, and resultLimit=50.
  • If query volume, runtime, or data-read scope is unexpected, disable the affected ingestion pipeline and roll back the ingestion image to the previous immutable digest. This change has no OpenMetadata database migration.

New concepts

ClickZetta follows standard capability inheritance: shared OpenMetadata behavior is reused for profiling, tests, and DBT, while connector code is limited to dialect differences such as TABLESAMPLE syntax and DESCRIBE schema loading.

This keeps ClickZetta aligned with other official connectors. Workload safety is configured at the ingestion workflow level instead of being implemented as hidden connector-specific limits.

UI screen recording / screenshots:

Credential-free evidence was captured from the live OpenMetadata ClickZetta service setup flow without entering credentials:

ClickZetta service picker

ClickZetta connection form

Download the ClickZetta UI walkthrough recording

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes #31345: Add ClickZetta database connector.
  • My PR is linked to GitHub issue Add native ClickZetta database connector #31345 via Fixes #31345 above.
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: I explained above why a migration is not needed.
  • For UI changes: I attached a screen recording and screenshots above.
  • I have added tests and listed them above.

Greptile Summary

The PR adds end-to-end ClickZetta database support across shared schemas, ingestion workflows, secret conversion, profiling, sampling, data diff, usage and lineage extraction, and UI registration.

  • Adds the ClickZetta connection contract and generated UI model updates.
  • Implements metadata, usage, lineage, profiling, testing, sampling, data-diff, and DBT capability wiring.
  • Adds service icons, setup documentation, connection conversion, and focused connector tests.

Confidence Score: 5/5

The PR appears safe to merge because no blocking failure remains in the eligible follow-up review set.

No blocking failure remains.

Important Files Changed

Filename Overview
ingestion/src/metadata/ingestion/source/database/clickzetta/service_spec.py Registers the connector’s metadata, lineage, usage, connection, sampler, profiler/test defaults, and data-diff implementations.
ingestion/src/metadata/ingestion/source/database/clickzetta/queries.py Builds bounded and validated native or custom ClickZetta query-history SQL for usage and lineage.
ingestion/src/metadata/ingestion/source/database/clickzetta/query_parser.py Normalizes query-history records into shared TableQuery models and configures usage and lineage source creation.
ingestion/src/metadata/ingestion/source/database/clickzetta/data_diff/data_diff.py Adds ClickZetta-specific data-diff connection, dialect, type parsing, schema discovery, and registration behavior.
ingestion/src/metadata/sampler/sqlalchemy/clickzetta/sampler.py Implements native ClickZetta row-count and percentage sampling for ROW and SYSTEM methods.
openmetadata-spec/src/main/resources/json/schema/entity/services/connections/database/clickzettaConnection.json Defines the schema-first ClickZetta connection contract consumed by ingestion, service, and UI layers.
openmetadata-service/src/main/java/org/openmetadata/service/secrets/converter/ClickzettaConnectionClassConverter.java Adds server-side secret conversion support for ClickZetta connection credentials.
openmetadata-ui/src/main/resources/ui/src/utils/DatabaseServicePureUtils.ts Registers the ClickZetta connection schema in the database-service setup UI.
openmetadata-ui/src/main/resources/ui/src/utils/ServiceIconUtils.ts Registers the ClickZetta service icon for UI rendering.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Config[ClickZetta service configuration] --> Schema[Shared connection schema]
  Schema --> Connection[ClickZetta connection owner]
  Connection --> Metadata[Metadata extraction]
  Connection --> History[Usage and lineage history]
  Connection --> DataOps[Profiler, tests, sampling, and data diff]
  Metadata --> Catalog[OpenMetadata catalog]
  History --> Catalog
  DataOps --> Catalog
  Schema --> UI[Service setup UI]
Loading

Reviews (2): Last reviewed commit: "test: cover Prefect connection converter..." | Re-trigger Greptile

Context used (4)

@github-actions

github-actions Bot commented Aug 4, 2026

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!

@iamkiayun

Copy link
Copy Markdown
Contributor Author

Follow-up draft PR for native ClickZetta usage/query-lineage extraction: iamkiayun#1. It is intentionally dependent on this metadata connector branch, uses a configurable canonical read-only query-history view, and has only seller_center-bounded fake-engine/container tests; no live production query was run.

@github-actions

github-actions Bot commented Aug 6, 2026

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!

@github-actions

github-actions Bot commented Aug 6, 2026

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!

@iamkiayun
iamkiayun marked this pull request as ready for review August 6, 2026 10:37
@iamkiayun
iamkiayun requested review from a team as code owners August 6, 2026 10:37
@github-actions

github-actions Bot commented Aug 6, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR checks passed

The linked issue has a description and all required Shipping project fields set. Thanks!

@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!

@iamkiayun iamkiayun changed the title Add ClickZetta database metadata connector Fixes #31345: Add ClickZetta database connector Aug 11, 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!

@iamkiayun

Copy link
Copy Markdown
Contributor Author

Updated this PR in 52af4abed36e to support both ClickZetta native history paths and to prefer workspace-local information_schema.job_history.

Why: ClickZetta rejected an object-level grant on sys.information_schema.job_history because it is a shared-system object, while a bounded read of information_schema.job_history succeeded for the existing ingestion identity. The cross-workspace sys path remains available for deployments that grant the broader shared-system-schema permission.

Fresh validation on the exact PR head:

  • focused native-history suite: 19 passed; Ruff check/format passed;
  • full distribution build: 13,687 UI tests passed and all Maven modules succeeded;
  • matching immutable server/ingestion images deployed with revision 52af4abed36e3e961a675cef20699d738576af08;
  • bounded usage run 333ba785-b3c1-4bac-8df4-714437692f76: success, 2 history records, 0 errors, 3 source SELECT operations;
  • bounded lineage run 75e77305-9d0e-4da9-9e14-1405ac8b70bc: success, 0 errors, 2 source SELECT operations, no resolvable edges in that slice;
  • existing catalog retained: 5 schemas and 86 tables; both history pipelines were disabled again after the manual runs.

The PR description now includes the live evidence and post-deploy validation. The remaining repository gates appear maintainer-owned: please add issue #31345 to the Shipping project and set its required fields, then approve the fork workflows or apply safe to test when ready.

@harshach harshach added the safe to test Add this label to run secure Github workflows on PRs label Aug 11, 2026
@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.

@sonarqubecloud

sonarqubecloud Bot commented Sep 8, 2026

Copy link
Copy Markdown

@ulixius9
ulixius9 enabled auto-merge September 9, 2026 05:37
@ulixius9
ulixius9 added this pull request to the merge queue Sep 9, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 9, 2026
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — failed_checks (2026-09-09T20:25:23Z)

Blocked the queue: py-tests-status

  • py-tests — py-tests-status, python / Verify Expected Jobs, python / Integration Tests (shard-2)

@ulixius9
ulixius9 added this pull request to the merge queue Sep 10, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — failed_checks (2026-09-10T10:03:35Z)

Blocked the queue: playwright-summary

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.

Add native ClickZetta database connector

4 participants