vdiravka commented on a change in pull request #1586: DRILL-6929: Exclude maprfs jar for default profile URL: https://github.com/apache/drill/pull/1586#discussion_r244185154
########## File path: contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/HiveStoragePlugin.java ########## @@ -217,21 +216,36 @@ public synchronized void registerSchemas(SchemaConfig schemaConfig, SchemaPlus p ruleBuilder.add(ConvertHiveParquetScanToDrillParquetScan.INSTANCE); } if (options.getBoolean(ExecConstants.HIVE_OPTIMIZE_MAPRDB_JSON_SCAN_WITH_NATIVE_READER)) { - ruleBuilder.add(ConvertHiveMapRDBJsonScanToDrillMapRDBJsonScan.INSTANCE); + try { + Class<?> hiveToDrillMapRDBJsonRuleClass = + Class.forName("org.apache.drill.exec.planner.sql.logical.ConvertHiveMapRDBJsonScanToDrillMapRDBJsonScan"); + ruleBuilder.add((StoragePluginOptimizerRule) hiveToDrillMapRDBJsonRuleClass.getField("INSTANCE").get(null)); Review comment: I think it is safe to remove INSTANCE static filed in case of using reflection. Therefore direct instantiating of `hiveToDrillMapRDBJsonRuleClass` by `newInstance()` can be used here. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services