Skip to content

Commit

Permalink
Move schema creation tests to distributed query tests
Browse files Browse the repository at this point in the history
  • Loading branch information
electrum committed Feb 27, 2020
1 parent 4335b05 commit 5de3231
Show file tree
Hide file tree
Showing 16 changed files with 35 additions and 78 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ protected QueryRunner createQueryRunner()
return createAccumuloQueryRunner(ImmutableMap.of());
}

@Override
public void testCreateSchema()
{
// schema creation is not supported
}

@Override
public void testAddColumn()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,6 @@ protected QueryRunner createQueryRunner()
return createAccumuloQueryRunner(ImmutableMap.of());
}

@Override
protected boolean canCreateSchema()
{
return false;
}

@Override
protected TestTable createTableWithDefaultColumns()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ protected boolean supportsViews()
return false;
}

@Override
public void testCreateSchema()
{
// Cassandra does not support creating schemas
}

@Override
public void testRenameTable()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,6 @@ protected boolean isParameterizedVarcharSupported()
return false;
}

@Override
protected boolean canCreateSchema()
{
return false;
}

@Override
protected TestTable createTableWithDefaultColumns()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -684,12 +684,6 @@ public void testMultiIndexAlias()
"SELECT (SELECT count(*) FROM region) + (SELECT count(*) FROM nation)");
}

@Override
protected boolean canCreateSchema()
{
return false;
}

private void index(String index, Map<String, Object> document)
throws IOException
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,6 @@ protected QueryRunner createQueryRunner()
.build();
}

@Override
protected boolean canCreateSchema()
{
return false;
}

@Override
protected TestTable createTableWithDefaultColumns()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,6 @@ private void assertTableProperty(String tableProperties, String key, String rege
"Not found: " + key + " = " + regexValue + " in " + tableProperties);
}

@Override
protected boolean canCreateSchema()
{
return false;
}

@AfterClass(alwaysRun = true)
public final void destroy()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,12 +304,6 @@ public void testSelectView()
assertUpdate("DROP TABLE test.view_base");
}

@Override
protected boolean canCreateSchema()
{
return false;
}

private void assertOneNotNullResult(String query)
{
MaterializedResult results = getQueryRunner().execute(getSession(), query).toTestTypes();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,10 @@ public void testCommentTable()
// Phoenix connector currently does not support comment on table
assertQueryFails("COMMENT ON TABLE orders IS 'hello'", "This connector does not support setting table comments");
}

@Override
public void testCreateSchema()
{
throw new SkipException("test disabled until issue fixed"); // TODO https://github.com/prestosql/presto/issues/2348
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,6 @@ public void testCaseInsensitiveNameMatching()
assertQuery("SELECT Val1 FROM testcaseinsensitive where Val1 < 1.2", "SELECT 1.1");
}

@Override
public void testCreateSchema()
{
throw new SkipException("test disabled until issue fixed"); // TODO https://github.com/prestosql/presto/issues/2348
}

private void executeInPhoenix(String sql)
throws SQLException
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,10 @@ public void testInsertWithCoercion()
{
// No support for char type
}

@Override
public void testCreateSchema()
{
// schema creation is not supported
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -776,10 +776,4 @@ public void testAlterTable()

assertUpdate("DROP TABLE test_alter_table");
}

@Override
protected boolean canCreateSchema()
{
return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,6 @@ public void destroy()
redisServer.close();
}

@Override
protected boolean canCreateSchema()
{
return false;
}

@Override
protected TestTable createTableWithDefaultColumns()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1142,4 +1142,15 @@ public void testComplexCast()
"SELECT count(DISTINCT a), CAST(max(b) AS VARCHAR) FROM t",
"VALUES (1, '0 00:00:01.000')");
}

@Test
public void testCreateSchema()
{
assertThat(computeActual("SHOW SCHEMAS").getOnlyColumnAsSet()).doesNotContain("test_schema_create");
assertUpdate("CREATE SCHEMA test_schema_create");
assertThat(computeActual("SHOW SCHEMAS").getOnlyColumnAsSet()).contains("test_schema_create");
assertQueryFails("CREATE SCHEMA test_schema_create", "line 1:1: Schema '.*\\.test_schema_create' already exists");
assertUpdate("DROP SCHEMA test_schema_create");
assertQueryFails("DROP SCHEMA test_schema_create", "line 1:1: Schema '.*\\.test_schema_create' does not exist");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import static io.prestosql.testing.QueryAssertions.assertContains;
import static io.prestosql.testing.assertions.Assert.assertEquals;
import static java.lang.String.format;
import static org.assertj.core.api.Assertions.assertThat;

public abstract class AbstractTestIntegrationSmokeTest
extends AbstractTestQueryFramework
Expand All @@ -36,11 +35,6 @@ protected boolean isParameterizedVarcharSupported()
return true;
}

protected boolean canCreateSchema()
{
return true;
}

@Test
public void testAggregateSingleColumn()
{
Expand Down Expand Up @@ -244,18 +238,6 @@ private MaterializedResult getExpectedOrdersTableDescription(boolean dateSupport
}
}

@Test
public void testCreateSchema()
throws Exception
{
assertThat(computeActual("SHOW SCHEMAS").getOnlyColumnAsSet()).doesNotContain("test_schema_create");
assertUpdate("CREATE SCHEMA test_schema_create");
assertThat(computeActual("SHOW SCHEMAS").getOnlyColumnAsSet()).contains("test_schema_create");
assertQueryFails("CREATE SCHEMA test_schema_create", "line 1:1: Schema '.*\\.test_schema_create' already exists");
assertUpdate("DROP SCHEMA test_schema_create");
assertQueryFails("DROP SCHEMA test_schema_create", "line 1:1: Schema '.*\\.test_schema_create' does not exist");
}

@Test
public void testInsertForDefaultColumn()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,4 @@ public void testShowSchemas()
.row("sf1");
assertContains(actualSchemas, resultBuilder.build());
}

@Override
protected boolean canCreateSchema()
{
return false;
}
}

0 comments on commit 5de3231

Please sign in to comment.