Skip to content

Commit

Permalink
Remove unnecessary test
Browse files Browse the repository at this point in the history
The test is supposed to ensure that the table is not
analyzed, but PostgreSQL analyzes tables automatically.
Therefore, the test is not applicable for it.
  • Loading branch information
martint committed Oct 20, 2023
1 parent eda58ca commit 6aa9ee3
Showing 1 changed file with 2 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import static io.trino.tpch.TpchTable.ORDERS;
import static java.lang.String.format;
import static java.util.stream.Collectors.joining;
import static org.junit.jupiter.api.Assumptions.abort;

public class TestPostgreSqlTableStatistics
extends BaseJdbcTableStatisticsTest
Expand Down Expand Up @@ -57,39 +58,7 @@ protected QueryRunner createQueryRunner()
@Override
public void testNotAnalyzed()
{
String tableName = "test_stats_not_analyzed";
assertUpdate("DROP TABLE IF EXISTS " + tableName);
computeActual(format("CREATE TABLE %s AS SELECT * FROM tpch.tiny.orders", tableName));

Exception failure = null;
try {
for (int i = 0; i < 10; i++) {
try {
assertQuery(
"SHOW STATS FOR " + tableName,
"VALUES " +
"('orderkey', null, null, null, null, null, null)," +
"('custkey', null, null, null, null, null, null)," +
"('orderstatus', null, null, null, null, null, null)," +
"('totalprice', null, null, null, null, null, null)," +
"('orderdate', null, null, null, null, null, null)," +
"('orderpriority', null, null, null, null, null, null)," +
"('clerk', null, null, null, null, null, null)," +
"('shippriority', null, null, null, null, null, null)," +
"('comment', null, null, null, null, null, null)," +
"(null, null, null, null, 15000, null, null)");
return;
}
catch (Exception e) {
failure = e;
}
}

throw new AssertionError(failure);
}
finally {
assertUpdate("DROP TABLE " + tableName);
}
abort("PostgreSQL analyzes tables automatically");
}

@Override
Expand Down

0 comments on commit 6aa9ee3

Please sign in to comment.