Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Disable testTableSampleBernoulli in BigQuery #23167

Merged
merged 1 commit into from
Aug 29, 2024
Merged

Conversation

ebyhr
Copy link
Member

@ebyhr ebyhr commented Aug 29, 2024

Description

The test is slow and increases the possibility of CI failures due to BigQuery SLA because it contains 100 executions.
Disabling this test should be safe since the connector doesn't support SAMPLE pushdown.
I think we can make this test conditional with TestingConnectorBehavior in a follow-up.

@Test
public void testTableSampleBernoulli()
{
DescriptiveStatistics stats = new DescriptiveStatistics();
int total = computeExpected("SELECT orderkey FROM orders", ImmutableList.of(BIGINT)).getMaterializedRows().size();
for (int i = 0; i < 100; i++) {
List<MaterializedRow> values = computeActual("SELECT orderkey FROM orders TABLESAMPLE BERNOULLI (50)").getMaterializedRows();
assertThat(values.size())
.describedAs("TABLESAMPLE produced duplicate rows")
.isEqualTo(ImmutableSet.copyOf(values).size());
stats.addValue(values.size() * 1.0 / total);
}
double mean = stats.getGeometricMean();
assertThat(mean > 0.45 && mean < 0.55)
.describedAs(format("Expected mean sampling rate to be ~0.5, but was %s", mean))
.isTrue();
}

Release notes

(x) This is not user-visible or is docs only, and no release notes are required.

@cla-bot cla-bot bot added the cla-signed label Aug 29, 2024
@github-actions github-actions bot added the bigquery BigQuery connector label Aug 29, 2024
@ebyhr ebyhr requested review from wendigo and hashhar August 29, 2024 05:05
@ebyhr ebyhr force-pushed the ebi/bigquery-disable-test branch from 53093ef to e3e98be Compare August 29, 2024 05:10
@ebyhr ebyhr merged commit a3264af into master Aug 29, 2024
17 checks passed
@ebyhr ebyhr deleted the ebi/bigquery-disable-test branch August 29, 2024 05:43
@github-actions github-actions bot added this to the 455 milestone Aug 29, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bigquery BigQuery connector cla-signed
Development

Successfully merging this pull request may close these issues.

2 participants