Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Fix flaky BigQuery testInsertSameValues #15159

Merged
merged 1 commit into from
Nov 23, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
import static io.trino.testing.assertions.Assert.assertEquals;
import static io.trino.testing.assertions.Assert.assertEventually;
import static java.lang.String.format;
import static java.lang.String.join;
import static java.util.Collections.nCopies;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.testng.Assert.assertFalse;
Expand Down Expand Up @@ -802,6 +804,19 @@ public void testInsertArray()
}
}

@Override
public void testInsertSameValues()
{
// TODO Remove override once https://github.com/trinodb/trino/issues/14981 is addressed
// queries with empty projections (count(*)) can return incorrect results for tables which are written to recently
try (TestTable table = new TestTable(
getQueryRunner()::execute,
"insert_same_values",
"AS " + join(" UNION ALL ", nCopies(2, "SELECT * FROM region")))) {
assertThat(computeActual("SELECT regionkey FROM " + table.getName()).getRowCount()).isEqualTo(10);
}
}

@Override
protected String errorMessageForCreateTableAsSelectNegativeDate(String date)
{
Expand Down