This is an automated email from the ASF dual-hosted git repository. volodymyr pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/drill.git
commit b67f77a18ac4b67044fa9b4b962d0536fdc54af5 Author: Volodymyr Vysotskyi <[email protected]> AuthorDate: Tue Nov 13 15:21:39 2018 +0200 DRILL-6850: Force setting DRILL_LOGICAL Convention for DrillRelFactories and DrillFilterRel - Fix workspace case insensitivity for JDBC storage plugin --- .../exec/store/hive/schema/HiveSchemaFactory.java | 21 ++++++++++----------- .../drill/exec/store/jdbc/JdbcStoragePlugin.java | 21 +++++++++++---------- .../exec/store/jdbc/TestJdbcPluginWithDerbyIT.java | 9 ++++----- .../drill/exec/planner/logical/DrillFilterRel.java | 2 +- .../apache/drill/exec/planner/logical/DrillRel.java | 2 +- .../exec/planner/logical/DrillRelFactories.java | 9 +++++---- .../planner/sql/handlers/DescribeSchemaHandler.java | 6 +++--- .../org/apache/drill/exec/store/SchemaFactory.java | 2 ++ .../drill/exec/store/dfs/FileSystemPlugin.java | 2 -- .../exec/store/dfs/FileSystemSchemaFactory.java | 2 -- .../drill/exec/util/StoragePluginTestUtils.java | 4 ++-- .../java/org/apache/drill/test/BaseTestQuery.java | 4 ++-- .../java/org/apache/drill/test/ClusterFixture.java | 4 ++-- .../apache/drill/jdbc/impl/DrillConnectionImpl.java | 4 ++-- 14 files changed, 45 insertions(+), 47 deletions(-) diff --git a/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/schema/HiveSchemaFactory.java b/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/schema/HiveSchemaFactory.java index f857ec6..abb8676 100644 --- a/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/schema/HiveSchemaFactory.java +++ b/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/schema/HiveSchemaFactory.java @@ -18,6 +18,8 @@ package org.apache.drill.exec.store.hive.schema; import java.io.IOException; +import java.util.Collections; +import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.concurrent.ExecutionException; @@ -45,9 +47,6 @@ import org.apache.hadoop.hive.conf.HiveConf.ConfVars; import org.apache.hadoop.hive.metastore.api.MetaException; import org.apache.thrift.TException; -import org.apache.drill.shaded.guava.com.google.common.collect.ImmutableList; -import org.apache.drill.shaded.guava.com.google.common.collect.Sets; - public class HiveSchemaFactory extends AbstractSchemaFactory { private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(HiveSchemaFactory.class); @@ -137,10 +136,10 @@ public class HiveSchemaFactory extends AbstractSchemaFactory { private HiveDatabaseSchema defaultSchema; HiveSchema(final SchemaConfig schemaConfig, final DrillHiveMetaStoreClient mClient, final String name) { - super(ImmutableList.<String>of(), name); + super(Collections.emptyList(), name); this.schemaConfig = schemaConfig; this.mClient = mClient; - getSubSchema("default"); + getSubSchema(DEFAULT_WS_NAME); } @Override @@ -152,7 +151,7 @@ public class HiveSchemaFactory extends AbstractSchemaFactory { return null; } HiveDatabaseSchema schema = getSubSchemaKnownExists(name); - if (name.equals("default")) { + if (DEFAULT_WS_NAME.equals(name)) { this.defaultSchema = schema; } return schema; @@ -181,8 +180,8 @@ public class HiveSchemaFactory extends AbstractSchemaFactory { public Set<String> getSubSchemaNames() { try { List<String> dbs = mClient.getDatabases(schemaConfig.getIgnoreAuthErrors()); - return Sets.newHashSet(dbs); - } catch (final TException e) { + return new HashSet<>(dbs); + } catch (TException e) { logger.warn("Failure while getting Hive database list.", e); } return super.getSubSchemaNames(); @@ -227,11 +226,11 @@ public class HiveSchemaFactory extends AbstractSchemaFactory { HiveReadEntry getSelectionBaseOnName(String dbName, String t) { if (dbName == null) { - dbName = "default"; + dbName = DEFAULT_WS_NAME; } - try{ + try { return mClient.getHiveReadEntry(dbName, t, schemaConfig.getIgnoreAuthErrors()); - }catch(final TException e) { + } catch (TException e) { logger.warn("Exception occurred while trying to read table. {}.{}", dbName, t, e.getCause()); return null; } diff --git a/contrib/storage-jdbc/src/main/java/org/apache/drill/exec/store/jdbc/JdbcStoragePlugin.java b/contrib/storage-jdbc/src/main/java/org/apache/drill/exec/store/jdbc/JdbcStoragePlugin.java index b0338cb..cd9a6c4 100755 --- a/contrib/storage-jdbc/src/main/java/org/apache/drill/exec/store/jdbc/JdbcStoragePlugin.java +++ b/contrib/storage-jdbc/src/main/java/org/apache/drill/exec/store/jdbc/JdbcStoragePlugin.java @@ -22,6 +22,8 @@ import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; @@ -59,13 +61,12 @@ import org.apache.drill.exec.server.DrillbitContext; import org.apache.drill.exec.store.AbstractSchema; import org.apache.drill.exec.store.AbstractStoragePlugin; import org.apache.drill.exec.store.SchemaConfig; +import org.apache.drill.exec.store.SchemaFactory; import org.apache.drill.exec.store.jdbc.DrillJdbcRuleBase.DrillJdbcFilterRule; import org.apache.drill.exec.store.jdbc.DrillJdbcRuleBase.DrillJdbcProjectRule; import org.apache.drill.shaded.guava.com.google.common.base.Joiner; -import org.apache.drill.shaded.guava.com.google.common.collect.ImmutableList; import org.apache.drill.shaded.guava.com.google.common.collect.ImmutableSet; -import org.apache.drill.shaded.guava.com.google.common.collect.Maps; public class JdbcStoragePlugin extends AbstractStoragePlugin { private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(JdbcStoragePlugin.class); @@ -157,10 +158,10 @@ public class JdbcStoragePlugin extends AbstractStoragePlugin { } /** - * Returns whether a condition is supported by {@link JdbcJoin}. + * Returns whether a condition is supported by {@link org.apache.calcite.adapter.jdbc.JdbcRules.JdbcJoin}. * * <p>Corresponds to the capabilities of - * {@link SqlImplementor#convertConditionToSqlNode}. + * {@link org.apache.calcite.rel.rel2sql.SqlImplementor#convertConditionToSqlNode}. * * @param node Condition * @return Whether condition is supported @@ -234,7 +235,7 @@ public class JdbcStoragePlugin extends AbstractStoragePlugin { private class CapitalizingJdbcSchema extends AbstractSchema { - final Map<String, CapitalizingJdbcSchema> schemaMap = Maps.newHashMap(); + private final Map<String, CapitalizingJdbcSchema> schemaMap = new HashMap<>(); private final JdbcSchema inner; public CapitalizingJdbcSchema(List<String> parentSchemaPath, String name, DataSource dataSource, @@ -299,11 +300,11 @@ public class JdbcStoragePlugin extends AbstractStoragePlugin { private class JdbcCatalogSchema extends AbstractSchema { - private final Map<String, CapitalizingJdbcSchema> schemaMap = Maps.newHashMap(); + private final Map<String, CapitalizingJdbcSchema> schemaMap = new HashMap<>(); private final CapitalizingJdbcSchema defaultSchema; public JdbcCatalogSchema(String name) { - super(ImmutableList.<String> of(), name); + super(Collections.emptyList(), name); try (Connection con = source.getConnection(); ResultSet set = con.getMetaData().getCatalogs()) { @@ -311,7 +312,7 @@ public class JdbcStoragePlugin extends AbstractStoragePlugin { final String catalogName = set.getString(1); CapitalizingJdbcSchema schema = new CapitalizingJdbcSchema( getSchemaPath(), catalogName, source, dialect, convention, catalogName, null); - schemaMap.put(catalogName, schema); + schemaMap.put(schema.getName(), schema); } } catch (SQLException e) { logger.warn("Failure while attempting to load JDBC schema.", e); @@ -325,7 +326,7 @@ public class JdbcStoragePlugin extends AbstractStoragePlugin { if (!schemasAdded) { // there were no schemas, just create a default one (the jdbc system doesn't support catalogs/schemas). - schemaMap.put("default", new CapitalizingJdbcSchema(ImmutableList.<String> of(), name, source, dialect, + schemaMap.put(SchemaFactory.DEFAULT_WS_NAME, new CapitalizingJdbcSchema(Collections.emptyList(), name, source, dialect, convention, null, null)); } } else { @@ -360,7 +361,7 @@ public class JdbcStoragePlugin extends AbstractStoragePlugin { convention, catalogName, schemaName); // if a catalog schema doesn't exist, we'll add this at the top level. - schemaMap.put(schemaName, schema); + schemaMap.put(schema.getName(), schema); } else { CapitalizingJdbcSchema schema = new CapitalizingJdbcSchema(parentSchema.getSchemaPath(), schemaName, source, dialect, diff --git a/contrib/storage-jdbc/src/test/java/org/apache/drill/exec/store/jdbc/TestJdbcPluginWithDerbyIT.java b/contrib/storage-jdbc/src/test/java/org/apache/drill/exec/store/jdbc/TestJdbcPluginWithDerbyIT.java index 65a1ea5..a22b40a 100644 --- a/contrib/storage-jdbc/src/test/java/org/apache/drill/exec/store/jdbc/TestJdbcPluginWithDerbyIT.java +++ b/contrib/storage-jdbc/src/test/java/org/apache/drill/exec/store/jdbc/TestJdbcPluginWithDerbyIT.java @@ -20,7 +20,6 @@ package org.apache.drill.exec.store.jdbc; import org.apache.drill.categories.JdbcStorageTest; import org.apache.drill.PlanTestBase; import org.apache.drill.exec.expr.fn.impl.DateUtility; -import org.apache.drill.exec.proto.UserBitShared; import org.apache.drill.exec.util.StoragePluginTestUtils; import org.junit.BeforeClass; @@ -126,14 +125,14 @@ public class TestJdbcPluginWithDerbyIT extends PlanTestBase { @Test public void showTablesDefaultSchema() throws Exception { - test("use derby"); - assertEquals(1, testRunAndPrint(UserBitShared.QueryType.SQL, "show tables like 'person'")); + testNoResult("use derby.drill_derby_test"); + assertEquals(1, testSql("show tables like 'PERSON'")); } @Test public void describe() throws Exception { - test("use derby"); - assertEquals(19, testRunAndPrint(UserBitShared.QueryType.SQL, "describe drill_derby_test.person")); + testNoResult("use derby.drill_derby_test"); + assertEquals(19, testSql("describe PERSON")); } @Test diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillFilterRel.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillFilterRel.java index 7497783..9e351f7 100644 --- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillFilterRel.java +++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillFilterRel.java @@ -51,7 +51,7 @@ public class DrillFilterRel extends DrillFilterRelBase implements DrillRel { } public static DrillFilterRel create(RelNode child, RexNode condition) { - return new DrillFilterRel(child.getCluster(), child.getTraitSet(), child, condition); + return new DrillFilterRel(child.getCluster(), child.getTraitSet().plus(DRILL_LOGICAL), child, condition); } } diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillRel.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillRel.java index 2de63ab..51bfb46 100644 --- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillRel.java +++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillRel.java @@ -27,7 +27,7 @@ import org.apache.calcite.plan.Convention; public interface DrillRel extends DrillRelNode { /** Calling convention for relational expressions that are "implemented" by * generating Drill logical plans. */ - public static final Convention DRILL_LOGICAL = new Convention.Impl("LOGICAL", DrillRel.class); + Convention DRILL_LOGICAL = new Convention.Impl("LOGICAL", DrillRel.class); LogicalOperator implement(DrillImplementor implementor); } diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillRelFactories.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillRelFactories.java index a0b727d..feccce0 100644 --- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillRelFactories.java +++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillRelFactories.java @@ -44,6 +44,7 @@ import static org.apache.calcite.rel.core.RelFactories.DEFAULT_SET_OP_FACTORY; import static org.apache.calcite.rel.core.RelFactories.DEFAULT_SORT_FACTORY; import static org.apache.calcite.rel.core.RelFactories.DEFAULT_TABLE_SCAN_FACTORY; import static org.apache.calcite.rel.core.RelFactories.DEFAULT_VALUES_FACTORY; +import static org.apache.drill.exec.planner.logical.DrillRel.DRILL_LOGICAL; /** * Contains factory implementation for creating various Drill Logical Rel nodes. @@ -100,7 +101,7 @@ public class DrillRelFactories { final RelDataType rowType = RexUtil.createStructType(cluster.getTypeFactory(), childExprs, fieldNames, null); - return DrillProjectRel.create(cluster, child.getTraitSet(), child, childExprs, rowType); + return DrillProjectRel.create(cluster, child.getTraitSet().plus(DRILL_LOGICAL), child, childExprs, rowType); } } @@ -125,14 +126,14 @@ public class DrillRelFactories { public RelNode createJoin(RelNode left, RelNode right, RexNode condition, Set<CorrelationId> variablesSet, JoinRelType joinType, boolean semiJoinDone) { - return new DrillJoinRel(left.getCluster(), left.getTraitSet(), left, right, condition, joinType); + return new DrillJoinRel(left.getCluster(), left.getTraitSet().plus(DRILL_LOGICAL), left, right, condition, joinType); } @Override public RelNode createJoin(RelNode left, RelNode right, RexNode condition, JoinRelType joinType, Set<String> variablesStopped, boolean semiJoinDone) { - return new DrillJoinRel(left.getCluster(), left.getTraitSet(), left, right, condition, joinType); + return new DrillJoinRel(left.getCluster(), left.getTraitSet().plus(DRILL_LOGICAL), left, right, condition, joinType); } } @@ -145,7 +146,7 @@ public class DrillRelFactories { @Override public RelNode createAggregate(RelNode input, boolean indicator, ImmutableBitSet groupSet, com.google.common.collect.ImmutableList<ImmutableBitSet> groupSets, List<AggregateCall> aggCalls) { - return new DrillAggregateRel(input.getCluster(), input.getTraitSet(), input, indicator, groupSet, groupSets, aggCalls); + return new DrillAggregateRel(input.getCluster(), input.getTraitSet().plus(DRILL_LOGICAL), input, indicator, groupSet, groupSets, aggCalls); } } } diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/handlers/DescribeSchemaHandler.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/handlers/DescribeSchemaHandler.java index 7f7dbe9..92a07c5 100644 --- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/handlers/DescribeSchemaHandler.java +++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/handlers/DescribeSchemaHandler.java @@ -21,6 +21,7 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.SerializableString; import com.fasterxml.jackson.core.io.CharacterEscapes; import com.fasterxml.jackson.databind.ObjectMapper; +import org.apache.drill.exec.store.SchemaFactory; import org.apache.drill.shaded.guava.com.google.common.base.Joiner; import org.apache.calcite.schema.SchemaPlus; import org.apache.calcite.sql.SqlDescribeSchema; @@ -35,7 +36,6 @@ import org.apache.drill.exec.planner.sql.SchemaUtilites; import org.apache.drill.exec.store.AbstractSchema; import org.apache.drill.exec.store.StoragePlugin; import org.apache.drill.exec.store.dfs.FileSystemPlugin; -import org.apache.drill.exec.store.dfs.FileSystemSchemaFactory; import org.apache.drill.exec.store.dfs.WorkspaceConfig; import org.apache.drill.exec.work.foreman.ForemanSetupException; @@ -111,12 +111,12 @@ public class DescribeSchemaHandler extends DefaultSqlHandler { Object workspaces = configMap.remove("workspaces"); if (workspaces != null) { Map map = (Map) workspaces; - String key = names.size() > 1 ? names.get(1) : FileSystemSchemaFactory.DEFAULT_WS_NAME; + String key = names.size() > 1 ? names.get(1) : SchemaFactory.DEFAULT_WS_NAME; Object workspace = map.get(key); if (workspace != null) { Map workspaceMap = (Map) map.get(key); configMap.putAll(workspaceMap); - } else if (FileSystemSchemaFactory.DEFAULT_WS_NAME.equals(key)) { + } else if (SchemaFactory.DEFAULT_WS_NAME.equals(key)) { configMap.putAll(mapper.convertValue(WorkspaceConfig.DEFAULT, Map.class)); } } diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/store/SchemaFactory.java b/exec/java-exec/src/main/java/org/apache/drill/exec/store/SchemaFactory.java index 4545169..4766e96 100644 --- a/exec/java-exec/src/main/java/org/apache/drill/exec/store/SchemaFactory.java +++ b/exec/java-exec/src/main/java/org/apache/drill/exec/store/SchemaFactory.java @@ -26,6 +26,8 @@ import java.io.IOException; */ public interface SchemaFactory { + String DEFAULT_WS_NAME = "default"; + /** * Register the schemas provided by this SchemaFactory implementation under the given parent schema. * diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/store/dfs/FileSystemPlugin.java b/exec/java-exec/src/main/java/org/apache/drill/exec/store/dfs/FileSystemPlugin.java index dd1c91c..5656c55 100644 --- a/exec/java-exec/src/main/java/org/apache/drill/exec/store/dfs/FileSystemPlugin.java +++ b/exec/java-exec/src/main/java/org/apache/drill/exec/store/dfs/FileSystemPlugin.java @@ -17,8 +17,6 @@ */ package org.apache.drill.exec.store.dfs; -import static org.apache.drill.exec.store.dfs.FileSystemSchemaFactory.DEFAULT_WS_NAME; - import java.io.IOException; import java.net.URI; import java.util.ArrayList; diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/store/dfs/FileSystemSchemaFactory.java b/exec/java-exec/src/main/java/org/apache/drill/exec/store/dfs/FileSystemSchemaFactory.java index 1a97e60..795cbd2 100644 --- a/exec/java-exec/src/main/java/org/apache/drill/exec/store/dfs/FileSystemSchemaFactory.java +++ b/exec/java-exec/src/main/java/org/apache/drill/exec/store/dfs/FileSystemSchemaFactory.java @@ -47,8 +47,6 @@ import org.apache.hadoop.fs.Path; */ public class FileSystemSchemaFactory extends AbstractSchemaFactory { - public static final String DEFAULT_WS_NAME = "default"; - public static final String LOCAL_FS_SCHEME = "file"; private List<WorkspaceSchemaFactory> factories; diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/util/StoragePluginTestUtils.java b/exec/java-exec/src/main/java/org/apache/drill/exec/util/StoragePluginTestUtils.java index e73c1b6..1c7b2ab 100644 --- a/exec/java-exec/src/main/java/org/apache/drill/exec/util/StoragePluginTestUtils.java +++ b/exec/java-exec/src/main/java/org/apache/drill/exec/util/StoragePluginTestUtils.java @@ -22,6 +22,7 @@ import java.util.HashMap; import java.util.Map; import java.util.Optional; +import org.apache.drill.exec.store.SchemaFactory; import org.apache.drill.shaded.guava.com.google.common.collect.ImmutableList; import org.apache.drill.common.exceptions.ExecutionSetupException; import org.apache.drill.common.logical.FormatPluginConfig; @@ -43,11 +44,10 @@ public class StoragePluginTestUtils { public static final String DFS_PLUGIN_NAME = "dfs"; public static final String TMP_SCHEMA = "tmp"; - public static final String DEFAULT_SCHEMA = "default"; public static final String ROOT_SCHEMA = "root"; public static final String DFS_TMP_SCHEMA = DFS_PLUGIN_NAME + "." + TMP_SCHEMA; - public static final String DFS_DEFAULT_SCHEMA = DFS_PLUGIN_NAME + "." + DEFAULT_SCHEMA; + public static final String DFS_DEFAULT_SCHEMA = DFS_PLUGIN_NAME + "." + SchemaFactory.DEFAULT_WS_NAME; public static final String DFS_ROOT_SCHEMA = DFS_PLUGIN_NAME + "." + ROOT_SCHEMA; public static final String UNIT_TEST_PROP_PREFIX = "drillJDBCUnitTests"; diff --git a/exec/java-exec/src/test/java/org/apache/drill/test/BaseTestQuery.java b/exec/java-exec/src/test/java/org/apache/drill/test/BaseTestQuery.java index 71aa240..250f646 100644 --- a/exec/java-exec/src/test/java/org/apache/drill/test/BaseTestQuery.java +++ b/exec/java-exec/src/test/java/org/apache/drill/test/BaseTestQuery.java @@ -17,7 +17,6 @@ */ package org.apache.drill.test; -import static org.apache.drill.exec.util.StoragePluginTestUtils.DEFAULT_SCHEMA; import static org.apache.drill.exec.util.StoragePluginTestUtils.ROOT_SCHEMA; import static org.apache.drill.exec.util.StoragePluginTestUtils.TMP_SCHEMA; import static org.hamcrest.core.StringContains.containsString; @@ -35,6 +34,7 @@ import java.util.List; import java.util.Properties; import java.util.concurrent.atomic.AtomicInteger; +import org.apache.drill.exec.store.SchemaFactory; import org.apache.drill.test.DrillTestWrapper.TestServices; import org.apache.drill.common.config.DrillConfig; import org.apache.drill.common.config.DrillProperties; @@ -194,7 +194,7 @@ public class BaseTestQuery extends ExecTest { StoragePluginTestUtils.updateSchemaLocation(StoragePluginTestUtils.DFS_PLUGIN_NAME, pluginRegistry, dirTestWatcher.getRootDir(), ROOT_SCHEMA); StoragePluginTestUtils.updateSchemaLocation(StoragePluginTestUtils.DFS_PLUGIN_NAME, pluginRegistry, - dirTestWatcher.getRootDir(), DEFAULT_SCHEMA); + dirTestWatcher.getRootDir(), SchemaFactory.DEFAULT_WS_NAME); } if (!properties.containsKey(DrillProperties.DRILLBIT_CONNECTION)) { diff --git a/exec/java-exec/src/test/java/org/apache/drill/test/ClusterFixture.java b/exec/java-exec/src/test/java/org/apache/drill/test/ClusterFixture.java index 996898e..a9d2977 100644 --- a/exec/java-exec/src/test/java/org/apache/drill/test/ClusterFixture.java +++ b/exec/java-exec/src/test/java/org/apache/drill/test/ClusterFixture.java @@ -33,6 +33,7 @@ import java.util.Map; import java.util.Optional; import java.util.Properties; +import org.apache.drill.exec.store.SchemaFactory; import org.apache.drill.test.DrillTestWrapper.TestServices; import org.apache.drill.common.config.DrillProperties; import org.apache.drill.common.exceptions.ExecutionSetupException; @@ -61,7 +62,6 @@ import org.apache.drill.shaded.guava.com.google.common.base.Charsets; import org.apache.drill.shaded.guava.com.google.common.base.Preconditions; import org.apache.drill.shaded.guava.com.google.common.io.Resources; -import static org.apache.drill.exec.util.StoragePluginTestUtils.DEFAULT_SCHEMA; import static org.apache.drill.exec.util.StoragePluginTestUtils.DFS_TMP_SCHEMA; import static org.apache.drill.exec.util.StoragePluginTestUtils.ROOT_SCHEMA; import static org.apache.drill.exec.util.StoragePluginTestUtils.TMP_SCHEMA; @@ -267,7 +267,7 @@ public class ClusterFixture extends BaseFixture implements AutoCloseable { StoragePluginTestUtils.updateSchemaLocation(StoragePluginTestUtils.DFS_PLUGIN_NAME, pluginRegistry, builder.dirTestWatcher.getDfsTestTmpDir(), TMP_SCHEMA); StoragePluginTestUtils.updateSchemaLocation(StoragePluginTestUtils.DFS_PLUGIN_NAME, pluginRegistry, builder.dirTestWatcher.getRootDir(), ROOT_SCHEMA); - StoragePluginTestUtils.updateSchemaLocation(StoragePluginTestUtils.DFS_PLUGIN_NAME, pluginRegistry, builder.dirTestWatcher.getRootDir(), DEFAULT_SCHEMA); + StoragePluginTestUtils.updateSchemaLocation(StoragePluginTestUtils.DFS_PLUGIN_NAME, pluginRegistry, builder.dirTestWatcher.getRootDir(), SchemaFactory.DEFAULT_WS_NAME); // Create the mock data plugin diff --git a/exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/DrillConnectionImpl.java b/exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/DrillConnectionImpl.java index b7e61b9..820044e 100644 --- a/exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/DrillConnectionImpl.java +++ b/exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/DrillConnectionImpl.java @@ -55,6 +55,7 @@ import org.apache.drill.exec.memory.RootAllocatorFactory; import org.apache.drill.exec.rpc.RpcException; import org.apache.drill.exec.server.Drillbit; import org.apache.drill.exec.server.RemoteServiceSet; +import org.apache.drill.exec.store.SchemaFactory; import org.apache.drill.exec.store.StoragePluginRegistry; import org.apache.drill.jdbc.AlreadyClosedSqlException; import org.apache.drill.jdbc.DrillConnection; @@ -65,7 +66,6 @@ import org.slf4j.Logger; import org.apache.drill.shaded.guava.com.google.common.base.Throwables; -import static org.apache.drill.exec.util.StoragePluginTestUtils.DEFAULT_SCHEMA; import static org.apache.drill.exec.util.StoragePluginTestUtils.DFS_PLUGIN_NAME; import static org.apache.drill.exec.util.StoragePluginTestUtils.ROOT_SCHEMA; import static org.apache.drill.exec.util.StoragePluginTestUtils.TMP_SCHEMA; @@ -666,7 +666,7 @@ class DrillConnectionImpl extends AvaticaConnection if (dfsDefaultPath == null) { logger.warn(logMessage, UNIT_TEST_DFS_DEFAULT_PROP); } else { - updateSchemaLocation(DFS_PLUGIN_NAME, pluginRegistry, new File(dfsDefaultPath), DEFAULT_SCHEMA); + updateSchemaLocation(DFS_PLUGIN_NAME, pluginRegistry, new File(dfsDefaultPath), SchemaFactory.DEFAULT_WS_NAME); } } } catch(Throwable e) {
