Repository navigation
[2.0] Fixes #37877: [Oracle] Fix percentage sampling reading all rows or none - #37940
Merged
Merged
Conversation
- The percentage sample filter references no column, so with COUNT(DISTINCT) in the metric query Oracle evaluated it once per execution and each metric read every row or none - OracleSampler draws the random value in a NO_MERGE query block and is registered in the Oracle service spec - Add a compile test and an Oracle integration test that samples 50% eight times (cherry picked from commit 13f551f)
gh-bot-collate
Bot
requested review from
stout-yeoman
and removed request for
a team
November 17, 2026 05:59
Author
|
🤖 This backport will not merge itself: |
12 of 14 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Automated backport of #37881 to
2.0.13f551f431bea9cdcf88659347294938b4b55904Resolution notes
Backport notes: #37881 → 2.0
Conflict
ingestion/tests/integration/test_oracle_sampling.pyconflicted as "deleted by us":this file does not exist on
2.0at all. It was originally added onmainbyPR #37074 (
Fixes 7370: Compile Oracle table-diff sampling with supported SQL),which reached
2.1via a release merge but was never backported to2.0. PR #37881then added a second test to that same file on
main, which is what produced theconflict here.
Resolution
Recreated the file on
2.0containing only the test added by #37881(
test_percentage_sample_reads_part_of_the_table_in_every_metric_query), plus theoracle_sampling_connectionfixture it depends on. The pre-existing test from #37074(
test_oracle_sampling_matches_utf8_selected_ids, and its now-unused imports:hashlib,TableParameter,build_sample_where_clause,DatabaseServiceType,SALT/THRESHOLD) was intentionally not reintroduced — it belongs to a separate,unrelated PR that was never backported to
2.0and is out of scope for this change.If that test is wanted on
2.0, it should be backported separately via #37074.The module docstring was adjusted from "Sampling against physical scalar columns in a
designated disposable Oracle database" (which described the removed test) to
"Sampling against a designated disposable Oracle database" to match the trimmed file's
actual content.
All other files in this cherry-pick applied cleanly with no conflicts:
ingestion/src/metadata/ingestion/source/database/oracle/service_spec.py(registersOracleSampler)ingestion/src/metadata/sampler/sqlalchemy/oracle/sampler.py(newOracleSampler)ingestion/tests/unit/observability/profiler/sqlalchemy/oracle/test_oracle_sampling.py(new unit test)What a reviewer should check
fixture and no longer references anything from the removed test).
2.0separately — if there is,that should be a distinct PR, not folded into this one.
Opened from openmetadata-collate, which holds the credentials needed to open a PR here. It merges itself once this branch's required checks pass — no review needed. If a check fails it stays open and the author of #37881 is asked to look.
resolver run


Confidence Score: 5/5
The PR appears safe to merge; no actionable issues were found.Summary
Registers
OracleSamplerand addsNO_MERGEto keep Oracle from merging the query that draws each row’s random value.Reviews (1) · Last reviewed commit: "Add Oracle sampler that keeps percentage..." · Reviewed by Greptile