Skip to content

Commit

Permalink
Disable unsupported MapR profile and plugins.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnturton committed Aug 25, 2023
1 parent 097a471 commit c132445
Show file tree
Hide file tree
Showing 20 changed files with 1,197 additions and 1,348 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,13 @@ public final class DrillProperties extends Properties {
public static final String TLS_HANDSHAKE_TIMEOUT = "TLSHandshakeTimeout";
public static final String TLS_PROVIDER = "TLSProvider";
public static final String USE_SYSTEM_TRUSTSTORE = "useSystemTrustStore";
public static final String USE_MAPR_SSL_CONFIG = "useMapRSSLConfig";

public static final String QUERY_TAGS = "queryTags";

// Properties that are no longer supported.
/*
public static final String USE_MAPR_SSL_CONFIG = "useMapRSSLConfig";
*/

// Although all properties from the application are sent to the server (from the client), the following
// sets of properties are used by the client and server respectively. These are reserved words.

Expand Down
40 changes: 22 additions & 18 deletions contrib/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,39 +40,43 @@

<modules>
<module>data</module>
<module>udfs</module>
<module>storage-hbase</module>
<module>format-maprdb</module>
<module>format-syslog</module>
<module>format-ltsv</module>
<module>format-access</module>
<module>format-deltalake</module>
<module>format-esri</module>
<module>format-excel</module>
<module>format-hdf5</module>
<module>format-httpd</module>
<module>format-esri</module>
<module>format-iceberg</module>
<module>format-image</module>
<module>format-log</module>
<module>format-access</module>
<module>format-ltsv</module>
<module>format-pcapng</module>
<module>format-pdf</module>
<module>format-hdf5</module>
<module>format-sas</module>
<module>format-spss</module>
<module>format-syslog</module>
<module>format-xml</module>
<module>format-image</module>
<module>format-pcapng</module>
<module>format-iceberg</module>
<module>format-deltalake</module>
<module>storage-cassandra</module>
<module>storage-drill</module>
<module>storage-phoenix</module>
<module>storage-druid</module>
<module>storage-elasticsearch</module>
<module>storage-googlesheets</module>
<module>storage-hbase</module>
<module>storage-hive</module>
<module>storage-mongo</module>
<module>storage-http</module>
<module>storage-jdbc</module>
<module>storage-kafka</module>
<module>storage-kudu</module>
<module>storage-mongo</module>
<module>storage-opentsdb</module>
<module>storage-phoenix</module>
<module>storage-splunk</module>
<module>storage-http</module>
<module>storage-druid</module>
<module>storage-elasticsearch</module>
<module>storage-cassandra</module>
<module>udfs</module>

<!-- Modules that are no longer supported. -->
<!--
<module>format-maprdb</module>
-->
</modules>

</project>
3 changes: 3 additions & 0 deletions contrib/storage-hbase/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,8 @@
</dependencies>
</profile>

<!-- Profiles that are no longer supported. -->
<!--
<profile>
<id>mapr</id>
<properties>
Expand Down Expand Up @@ -313,5 +315,6 @@
</dependency>
</dependencies>
</profile>
-->
</profiles>
</project>
8 changes: 3 additions & 5 deletions contrib/storage-hive/core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,8 @@
</plugins>
</build>
<profiles>
<!-- Profiles that are no longer supported. -->
<!--
<profile>
<id>mapr</id>
<properties>
Expand Down Expand Up @@ -350,11 +352,6 @@
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.apache.drill.contrib</groupId>
<artifactId>drill-format-mapr</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.tdunning</groupId>
<artifactId>json</artifactId>
Expand All @@ -370,5 +367,6 @@
</dependency>
</dependencies>
</profile>
-->
</profiles>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@
import org.apache.drill.common.exceptions.DrillRuntimeException;
import org.apache.drill.common.exceptions.ExecutionSetupException;
import org.apache.drill.common.expression.SchemaPath;
import org.apache.drill.common.logical.FormatPluginConfig;
import org.apache.drill.common.logical.StoragePluginConfig;
import org.apache.drill.exec.ExecConstants;
import org.apache.drill.exec.ops.OptimizerRulesContext;
import org.apache.drill.exec.physical.base.AbstractGroupScan;
Expand All @@ -50,11 +48,9 @@
import org.apache.drill.exec.store.AbstractStoragePlugin;
import org.apache.drill.exec.store.SchemaConfig;
import org.apache.drill.exec.store.StoragePluginOptimizerRule;
import org.apache.drill.exec.store.dfs.FormatPlugin;
import org.apache.drill.exec.store.hive.schema.HiveSchemaFactory;
import com.google.common.collect.ImmutableSet;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hive.conf.HiveConf;
import org.apache.hadoop.hive.conf.HiveConf.ConfVars;
import org.apache.hadoop.hive.metastore.api.MetaException;
Expand All @@ -64,8 +60,6 @@ public class HiveStoragePlugin extends AbstractStoragePlugin {

private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(HiveStoragePlugin.class);

public static final String HIVE_MAPRDB_FORMAT_PLUGIN_NAME = "hive-maprdb";

private final HiveStoragePluginConfig config;
private HiveSchemaFactory schemaFactory;
private final HiveConf hiveConf;
Expand Down Expand Up @@ -206,44 +200,10 @@ public Set<StoragePluginOptimizerRule> getOptimizerRules(OptimizerRulesContext o
options.getBoolean(ExecConstants.HIVE_OPTIMIZE_PARQUET_SCAN_WITH_NATIVE_READER)) {
ruleBuilder.add(ConvertHiveParquetScanToDrillParquetScan.INSTANCE);
}
if (options.getBoolean(ExecConstants.HIVE_OPTIMIZE_MAPRDB_JSON_SCAN_WITH_NATIVE_READER)) {
try {
Class<?> hiveToDrillMapRDBJsonRuleClass =
Class.forName("org.apache.drill.exec.planner.sql.logical.ConvertHiveMapRDBJsonScanToDrillMapRDBJsonScan");
ruleBuilder.add((StoragePluginOptimizerRule) hiveToDrillMapRDBJsonRuleClass.getField("INSTANCE").get(null));
} catch (ReflectiveOperationException e) {
logger.warn("Current Drill build is not designed for working with Hive MapR-DB tables. " +
"Please disable {} option", ExecConstants.HIVE_OPTIMIZE_MAPRDB_JSON_SCAN_WITH_NATIVE_READER);
}
}
return ruleBuilder.build();
}
default:
return ImmutableSet.of();
}
}

@Override
public FormatPlugin getFormatPlugin(FormatPluginConfig formatConfig) {
// TODO: implement formatCreator similar to FileSystemPlugin formatCreator. DRILL-6621
try {
Class<?> mapRDBFormatPluginConfigClass =
Class.forName("org.apache.drill.exec.store.mapr.db.MapRDBFormatPluginConfig");
Class<?> mapRDBFormatPluginClass =
Class.forName("org.apache.drill.exec.store.mapr.db.MapRDBFormatPlugin");

if (mapRDBFormatPluginConfigClass.isInstance(formatConfig)) {
return (FormatPlugin) mapRDBFormatPluginClass.getConstructor(
new Class[]{String.class, DrillbitContext.class, Configuration.class,
StoragePluginConfig.class, mapRDBFormatPluginConfigClass})
.newInstance(
new Object[]{HIVE_MAPRDB_FORMAT_PLUGIN_NAME, context, hiveConf, config, formatConfig});
}
} catch (ReflectiveOperationException e) {
throw new DrillRuntimeException("The error is occurred while connecting to MapR-DB or instantiating mapRDBFormatPlugin", e);
}
throw new DrillRuntimeException(String.format("Hive storage plugin doesn't support usage of %s format plugin",
formatConfig.getClass().getName()));
}

}
Loading

0 comments on commit c132445

Please sign in to comment.