Skip to content

Commit

Permalink
Remove throws Exception from AbstractTestQueries
Browse files Browse the repository at this point in the history
Test and test utility methods were declared that can throw Exception
while no exception could be thrown.
  • Loading branch information
kokosing authored and martint committed Nov 9, 2016
1 parent 2687b22 commit 56ac17a
Show file tree
Hide file tree
Showing 10 changed files with 1 addition and 574 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,12 @@ public TestAccumuloDistributedQueries()

@Override
public void testAddColumn()
throws Exception
{
// Adding columns via SQL are not supported until adding columns with comments are supported
}

@Override
public void testCreateTableAsSelect()
throws Exception
{
// This test is overridden due to Function "UUID" not found errors
// Some test cases from the base class are removed
Expand Down Expand Up @@ -89,14 +87,12 @@ public void testCreateTableAsSelect()

@Override
public void testDelete()
throws Exception
{
// Deletes are not supported by the connector
}

@Override
public void testInsert()
throws Exception
{
@Language("SQL") String query = "SELECT UUID() AS uuid, orderdate, orderkey FROM orders";

Expand Down Expand Up @@ -133,7 +129,6 @@ public void testInsert()

@Test
public void testInsertDuplicateRows()
throws Exception
{
// This test case tests the Accumulo connectors override capabilities
// When a row is inserted into a table where a row with the same row ID already exists,
Expand All @@ -152,7 +147,6 @@ public void testInsertDuplicateRows()

@Override
public void testBuildFilteredLeftJoin()
throws Exception
{
// Override because of extra UUID column in lineitem table, cannot SELECT *
assertQuery("SELECT "
Expand All @@ -165,15 +159,13 @@ public void testBuildFilteredLeftJoin()
@Override
@Test
public void testJoinWithAlias()
throws Exception
{
// Override because of extra UUID column in lineitem table, cannot SELECT *
// Cannot munge test to pass due to aliased data set 'x' containing duplicate orderkey and comment columns
}

@Override
public void testProbeFilteredLeftJoin()
throws Exception
{
// Override because of extra UUID column in lineitem table, cannot SELECT *
assertQuery("SELECT "
Expand All @@ -186,15 +178,13 @@ public void testProbeFilteredLeftJoin()
@Override
@Test
public void testJoinWithDuplicateRelations()
throws Exception
{
// Override because of extra UUID column in lineitem table, cannot SELECT *
// Cannot munge test to pass due to aliased data sets 'x' containing duplicate orderkey and comment columns
}

@Override
public void testLeftJoinWithEmptyInnerTable()
throws Exception
{
// Override because of extra UUID column in lineitem table, cannot SELECT *
// Use orderkey = rand() to create an empty relation
Expand Down Expand Up @@ -222,7 +212,6 @@ public void testLeftJoinWithEmptyInnerTable()

@Override
public void testScalarSubquery()
throws Exception
{
// Override because of extra UUID column in lineitem table, cannot SELECT *

Expand Down Expand Up @@ -313,7 +302,6 @@ public void testScalarSubquery()

@Override
public void testShowColumns()
throws Exception
{
// Override base class because table descriptions for Accumulo connector include comments
MaterializedResult actual = computeActual("SHOW COLUMNS FROM orders");
Expand All @@ -340,7 +328,6 @@ public void testShowColumns()

@Test
public void testMultiInBelowCardinality()
throws Exception
{
assertQuery("SELECT COUNT(*) FROM partsupp WHERE partkey = 1", "SELECT 4");
assertQuery("SELECT COUNT(*) FROM partsupp WHERE partkey = 2", "SELECT 4");
Expand All @@ -349,7 +336,6 @@ public void testMultiInBelowCardinality()

@Test
public void testSelectNullValue()
throws Exception
{
try {
assertUpdate("CREATE TABLE test_select_null_value AS SELECT 1 a, 2 b, CAST(NULL AS BIGINT) c", 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ public TestJdbcDistributedQueries()

@Override
public void testLargeIn()
throws Exception
{
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,70 +43,60 @@ protected boolean supportsViews()

@Override
public void testGroupingSetMixedExpressionAndColumn()
throws Exception
{
// Cassandra does not support DATE
}

@Override
public void testGroupingSetMixedExpressionAndOrdinal()
throws Exception
{
// Cassandra does not support DATE
}

@Override
public void testRenameTable()
throws Exception
{
// Cassandra does not support renaming tables
}

@Override
public void testAddColumn()
throws Exception
{
// Cassandra does not support adding columns
}

@Override
public void testRenameColumn()
throws Exception
{
// Cassandra does not support renaming columns
}

@Override
public void testInsert()
throws Exception
{
// Cassandra connector currently does not support insert
}

@Override
public void testCreateTable()
throws Exception
{
// Cassandra connector currently does not support create table
}

@Override
public void testCreateTableAsSelect()
throws Exception
{
// Cassandra connector currently does not support create table
}

@Override
public void testDelete()
throws Exception
{
// Cassandra connector currently does not support delete
}

@Override
public void testShowColumns()
throws Exception
{
MaterializedResult actual = computeActual("SHOW COLUMNS FROM orders");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,28 +29,24 @@ public TestHiveDistributedQueries()

@Override
public void testDelete()
throws Exception
{
// Hive connector currently does not support row-by-row delete
}

@Override
public void testAddColumn()
throws Exception
{
// Hive connector currently does not support schema change
}

@Override
public void testRenameColumn()
throws Exception
{
// Hive connector currently does not support schema change
}

@Override
public void testRenameTable()
throws Exception
{
// Hive connector currently does not support table rename
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ public final void destroy()

@Test
public void testDropTable()
throws Exception
{
assertUpdate("CREATE TABLE test_drop AS SELECT 123 x", 1);
assertTrue(queryRunner.tableExists(getSession(), "test_drop"));
Expand All @@ -86,7 +85,7 @@ public void testDropTable()

@Test
public void testViews()
throws Exception
throws SQLException
{
execute("CREATE OR REPLACE VIEW tpch.test_view AS SELECT * FROM tpch.orders");

Expand All @@ -97,7 +96,6 @@ public void testViews()

@Test
public void testPrestoCreatedParameterizedVarchar()
throws Exception
{
DataTypeTest.create()
.addRoundTrip(stringDataType("varchar(10)", createVarcharType(255)), "text_a")
Expand All @@ -114,7 +112,6 @@ public void testPrestoCreatedParameterizedVarchar()

@Test
public void testMySqlCreatedParameterizedVarchar()
throws Exception
{
DataTypeTest.create()
.addRoundTrip(stringDataType("tinytext", createVarcharType(255)), "a")
Expand All @@ -128,7 +125,6 @@ public void testMySqlCreatedParameterizedVarchar()

@Test
public void testMySqlCreatedParameterizedVarcharUnicode()
throws Exception
{
String sampleUnicodeText = "\u653b\u6bbb\u6a5f\u52d5\u968a";
DataTypeTest.create()
Expand All @@ -144,14 +140,12 @@ public void testMySqlCreatedParameterizedVarcharUnicode()

@Test
public void testPrestoCreatedParameterizedChar()
throws Exception
{
mysqlCharTypeTest().execute(queryRunner, prestoCreateAsSelect("mysql_test_parameterized_char"));
}

@Test
public void testMySqlCreatedParameterizedChar()
throws Exception
{
mysqlCharTypeTest().execute(queryRunner, mysqlCreateAndInsert("tpch.mysql_test_parameterized_char"));
}
Expand All @@ -170,7 +164,6 @@ private DataTypeTest mysqlCharTypeTest()

@Test
public void testMySqlCreatedParameterizedCharUnicode()
throws Exception
{
DataTypeTest.create()
.addRoundTrip(charDataType(1, CHARACTER_SET_UTF8), "\u653b")
Expand All @@ -192,7 +185,6 @@ private DataSetup mysqlCreateAndInsert(String tableNamePrefix)

@Override
public void testShowColumns()
throws Exception
{
MaterializedResult actual = computeActual("SHOW COLUMNS FROM orders");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ public final void destroy()

@Override
public void testLargeIn()
throws Exception
{
// the PostgreSQL query fails with "stack depth limit exceeded"
// TODO: fix QueryBuilder not to generate such a large query
Expand All @@ -76,7 +75,6 @@ public void testLargeIn()

@Test
public void testDropTable()
throws Exception
{
assertUpdate("CREATE TABLE test_drop AS SELECT 123 x", 1);
assertTrue(queryRunner.tableExists(getSession(), "test_drop"));
Expand All @@ -98,14 +96,12 @@ public void testViews()

@Test
public void testPrestoCreatedParameterizedVarchar()
throws Exception
{
varcharDataTypeTest().execute(queryRunner, prestoCreateAsSelect("presto_test_parameterized_varchar"));
}

@Test
public void testPostgreSqlCreatedParameterizedVarchar()
throws Exception
{
varcharDataTypeTest().execute(queryRunner, postgresCreateAndInsert("tpch.postgresql_test_parameterized_varchar"));
}
Expand All @@ -122,28 +118,24 @@ private DataTypeTest varcharDataTypeTest()

@Test
public void testPrestoCreatedParameterizedVarcharUnicode()
throws Exception
{
unicodeVarcharDateTypeTest().execute(queryRunner, prestoCreateAsSelect("postgresql_test_parameterized_varchar_unicode"));
}

@Test
public void testPostgreSqlCreatedParameterizedVarcharUnicode()
throws Exception
{
unicodeVarcharDateTypeTest().execute(queryRunner, postgresCreateAndInsert("tpch.postgresql_test_parameterized_varchar_unicode"));
}

@Test
public void testPrestoCreatedParameterizedCharUnicode()
throws Exception
{
unicodeDataTypeTest(DataType::charDataType).execute(queryRunner, prestoCreateAsSelect("postgresql_test_parameterized_char_unicode"));
}

@Test
public void testPostgreSqlCreatedParameterizedCharUnicode()
throws Exception
{
unicodeDataTypeTest(DataType::charDataType).execute(queryRunner, postgresCreateAndInsert("tpch.postgresql_test_parameterized_char_unicode"));
}
Expand Down
Loading

0 comments on commit 56ac17a

Please sign in to comment.