Repository navigation
Fixes 36674: Add default system-schema filters for database connectors - #36677
Conversation
Add connection-level databaseFilterPattern/schemaFilterPattern defaults that exclude engine-owned system databases/schemas for 20 database connectors that had none (or an incomplete one). Defaults only pre-fill filters of newly created ingestion pipelines.
^db_.* also hid user schemas such as db_staging on Azure SQL and Synapse.
|
Local Java test run: FAILED — details
Failed: Selected but produced no report: Tests run locally
Per-class counts come from the test reports, which can credit a test to the wrong class when classes run concurrently, and keep only the last run of a nested class that several test classes inherit. The summary's step totals are Maven's own counts. Why these tests
Impacted, not run locally (1)
Commandsmvn -B package -pl openmetadata-service -am -Dspring-boot.repackage.skip=true -Dtest=ClassConverterFactoryTest,HiveConnectionClassConverterTest,PasswordEntityMaskerTest -Dsurefire.failIfNoSpecifiedTests=false
mvn -B verify -pl :openmetadata-integration-tests -am -Dspring-boot.repackage.skip=true -Pmysql-elasticsearch -DintegrationTests.lane=parallel -Dit.test=APIServiceResourceIT,ConfigResourceIT,DashboardServiceResourceIT,DatabaseServiceResourceIT,DatabaseSmokeIT,DriveServiceResourceIT,GlossaryTermResourceIT,LLMServiceResourceIT,McpServiceResourceIT,MessagingServiceResourceIT,MetadataServiceResourceIT,MlModelServiceResourceIT,MlModelServiceSearchAliasIT,PipelineServiceResourceIT,SearchServiceResourceIT,SecurityServiceResourceIT,SeedDataPresenceIT,ServiceAttributePolicyIT,ServiceLineagePipelineRoutingMigrationIT,ServiceLineageRefcountIT,ServicesOverviewResourceIT,StorageServiceResourceIT,TableResourceIT,UserResourceIT -Dfailsafe.failIfNoSpecifiedTests=false -Dtest=NoUnitTestsInThisRun -Dsurefire.failIfNoSpecifiedTests=false |
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
✅ Generated Sources Auto-UpdatedThe generated TypeScript types ( |
| - No default is added where it would be a no-op: the Vertica dialect already drops `v_*` schemas | ||
| and the StarRocks source already skips its system schemas in code. | ||
|
|
||
| ## Consequences | ||
| New pipelines no longer ingest engine catalogs by default; users can still clear the default. | ||
| Existing pipelines are untouched. A connector added later should ship its system-schema default | ||
| in the same PR. Matching is case-insensitive (`filters._filter` uses `re.IGNORECASE`), so one | ||
| pattern covers engines that upper-case their catalog names. |
There was a problem hiding this comment.
⚠️ Quality: ADR omits rule: no default where connection filters are read at runtime
The description excludes connectors on purpose: "Snowflake, Databend and Athena, which read connection-level filters at runtime, are untouched." The tree does not record this rule. Those sources do read the connection field at runtime (databend/connection.py:133 calls filter_by_schema(self.service_connection.schemaFilterPattern, …), athena/connection.py:327 passes service_connection.schemaFilterPattern, and glue/connection.py:136-137 does the same). Generated models apply schema defaults whenever the field is missing, so a default on those connections would quietly change filtering for existing services. That would break the ADR's "Existing pipelines are untouched" consequence.
The new ADR does the opposite of protecting this. Its Consequences section says "A connector added later should ship its system-schema default in the same PR", and its only listed exception is the no-op case (Vertica/StarRocks). Someone following the ADR could add a default to Athena, Databend or Glue and change how live services behave. The record should say something like: "A connector that reads schemaFilterPattern/databaseFilterPattern from the service connection at runtime (Snowflake, Databend, Athena, Glue) gets no new default, because the default would apply to existing services, not only to new pipelines."
Add the runtime-read exclusion to the ADR's Decision list.:
- No default is added where the connector reads the connection-level `schemaFilterPattern` /
`databaseFilterPattern` at runtime (Snowflake, Databend, Athena, Glue): there the default would
apply to every existing service, not only pre-fill new pipelines.
Was this helpful? React with 👍 / 👎
Code Review
|
| Compact |
|
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source
|
|
Khairajani
left a comment
There was a problem hiding this comment.
LGTM. Nit: worth one line in the ADR on why Snowflake, Databend and Athena get no default (they read connection-level filters at runtime).
… test (#37097) * Fix nightly ingestion integration tests broken by connector defaults and BigQuery usage resolution - ometa workflow fixture: set MysqlConnection.type explicitly. The dump excludes unset fields, so without the discriminator the untagged DatabaseConnection union resolved to TrinoConnection once Trino gained default filter patterns (#36677). - test_sample_usage: sample_data is a BigQuery service, and BigQuery usage resolution (#36867) rewrites references to database.schema.table, so expect those keys. Assert the whole map so a miss shows what was found. * Fix flaky Alation sink clock tests that patched the global time.monotonic Patching `client.time.monotonic` replaces the attribute on the shared `time` module, so any background thread (a leftover pymongo cursor reaper on the 3.10 unit job) consumed the fake ticks; the exhausted iterator raised StopIteration, which _write_batch reported as an empty error. Patch the client module's `time` binding instead.



Describe your changes:
Fixes #36674
Most database connectors had no
databaseFilterPattern/schemaFilterPatterndefault, so new ingestion pipelines pulled in engine catalogs such asinformation_schema,system,_impala_builtinsand Mongoadmin/local/config. This PR adds exact-name system-schema excludes to 20 connection schemas, plus a unit test and a decision record. The defaults only pre-fill filters on newly created pipelines. Ingestion reads filters from the pipeline's ownsourceConfig, so existing pipelines are unchanged.Type of change:
High-level design:
defaultgoes on the connection-level filter, which the UI add-ingestion form (getDefaultFilterPropertyValues, create mode only) andCreateIngestionPipelineImplcopy into a new pipeline'ssourceConfig. None of the 20 connectors reads the connection-level filters at runtime; only Snowflake, Databend and Athena do, and they are untouched.information_schema,performance_schema__internal_schematemplate0,template1information_schema,gp_toolkitsysteminformation_schema,crdb_internal,pg_extensionmsdb,model,tempdbdb_*roles by name,guest,information_schema,syssystem,information_schemasystem(catalog)information_schemaSYS,_SYS_(?!BIC$).*SYS(CAT|FUN|IBM|IBMADM|IBMINTERNAL|IBMTS|PROC|PUBLIC|STAT|TOOLS),NULLID,SQLJDBC,SYS_CALENDAR,SYSLIB,TD_SYS.*,TDSTATS, … (28 patterns)SYS,EXA_STATISTICSsystem,system_auth,system_schema,system_distributed,system_traces,system_views,system_virtual_schemaadmin,local,config_system_impala_builtinsINFORMATION_SCHEMA,syssys,information_schemaADR:2026-10-30-database-connection-defaults-exclude-system-schemas:^SYS.*,^system_.*or^db_.*, which would hide user schemas such asSYSTEM_DATA,system_logsordb_staging._SYS_BIC, because its lineage resolves calculation views there.v_*schemas, and the StarRocks source already filters its system schemas in code.Tests:
Use cases covered
system_logs,SYSTEM_DATA,configs,_SYS_BIC,DBC_COPY, …).Unit tests
ingestion/tests/unit/test_connection_default_filters.py: 26 parametrized cases. Each loads the schema's default and runs it throughmetadata.utils.filters.filter_by_schema/filter_by_database, asserting the system names are excluded and the look-alike user names are kept. Result:pytest tests/unit/test_connection_default_filters.py→ 26 passed.Backend integration tests
Local Java test run: unit PASSED · integration skipped (author's call)
openmetadata-service):ClassConverterFactoryTest26/26 ·HiveConnectionClassConverterTest4/4 ·PasswordEntityMaskerTest23/23.defaultvalues change, and no IT asserts on them. A first run of the 24 impacted ITs atc4ec14cd470failed in 14 tests, all environmental: "Connection refused" to the test server mid-run, and a missingdata-consumerfixture user. On re-run TableResourceIT (55/55) and ServiceLineagePipelineRoutingMigrationIT (8/8) passed. The 4data-consumer/ built-in-metadata-service failures remained and were not baselined against main.Ingestion integration tests
ingestion/srcchanges, only a new unit test.Playwright (UI) tests
Manual testing performed
connections/database/*Connection.jsonwith filter-pattern properties: 59 total, 47 with no database/schema default before this PR.sourceConfig, and that the UI uses connection defaults only in create mode (IngestionConfigUtils.getDefaultFilterPropertyValues).UI screen recording:
Not applicable — schema-default change with no UI code changes.
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. (Not needed: only
defaultvalues are added, nothing stored changes, and existing pipelines keep their saved filters.)For a UI feature or feature task: Not applicable.
I have added tests (unit / integration / Playwright as applicable) and listed them above.
Self-review: I reviewed the final diff against
REVIEW.md(thepr-checklistskill runs it) and fixed every 🔴 finding, or answered it on the line below.Reviewed
bfe1bb941a8: no 🔴. Fixed the 🟡 findings inc4ec14cd470:^db_.*narrowed to the nine fixed SQL Server roles, withdb_stagingadded as a kept case, and the default-block indentation in cassandra/mongoDB/impala corrected. Bundled UI schemas (public/jsons/,src/jsons/) are left to thetypescript-type-generationbot (yarn parse-schema).Decision check: adds
docs/decisions/2026-10-30-database-connection-defaults-exclude-system-schemas.md.I have added tests around the new logic.
For connector/ingestion changes: I updated the documentation.
🤖 Generated with Claude Code