Skip to content

Commit

Permalink
Remove explicit CATALOG usage
Browse files Browse the repository at this point in the history
  • Loading branch information
kokosing committed Jul 18, 2018
1 parent d0f78d2 commit 4003509
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

public final class MemoryQueryRunner
{
public static final String CATALOG = "memory";
private static final String CATALOG = "memory";

private MemoryQueryRunner() {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

import java.util.List;

import static com.facebook.presto.plugin.memory.MemoryQueryRunner.CATALOG;
import static com.facebook.presto.testing.assertions.Assert.assertEquals;
import static java.lang.String.format;
import static org.testng.Assert.assertTrue;
Expand Down Expand Up @@ -110,15 +109,15 @@ public void testSelectColumnsSubset()
@Test
public void testCreateTableInNonDefaultSchema()
{
assertUpdate(format("CREATE SCHEMA %s.schema1", CATALOG));
assertUpdate(format("CREATE SCHEMA %s.schema2", CATALOG));
assertUpdate("CREATE SCHEMA schema1");
assertUpdate("CREATE SCHEMA schema2");

assertQueryResult(format("SHOW SCHEMAS FROM %s", CATALOG), "default", "information_schema", "schema1", "schema2");
assertUpdate(format("CREATE TABLE %s.schema1.nation AS SELECT * FROM tpch.tiny.nation WHERE nationkey %% 2 = 0", CATALOG), "SELECT count(*) FROM nation WHERE MOD(nationkey, 2) = 0");
assertUpdate(format("CREATE TABLE %s.schema2.nation AS SELECT * FROM tpch.tiny.nation WHERE nationkey %% 2 = 1", CATALOG), "SELECT count(*) FROM nation WHERE MOD(nationkey, 2) = 1");
assertQueryResult("SHOW SCHEMAS", "default", "information_schema", "schema1", "schema2");
assertUpdate("CREATE TABLE schema1.nation AS SELECT * FROM tpch.tiny.nation WHERE nationkey % 2 = 0", "SELECT count(*) FROM nation WHERE MOD(nationkey, 2) = 0");
assertUpdate("CREATE TABLE schema2.nation AS SELECT * FROM tpch.tiny.nation WHERE nationkey % 2 = 1", "SELECT count(*) FROM nation WHERE MOD(nationkey, 2) = 1");

assertQueryResult(format("SELECT count(*) FROM %s.schema1.nation", CATALOG), 13L);
assertQueryResult(format("SELECT count(*) FROM %s.schema2.nation", CATALOG), 12L);
assertQueryResult("SELECT count(*) FROM schema1.nation", 13L);
assertQueryResult("SELECT count(*) FROM schema2.nation", 12L);
}

@Test
Expand Down

0 comments on commit 4003509

Please sign in to comment.