diff --git a/presto-native-execution/src/test/java/com/facebook/presto/nativeworker/PrestoNativeQueryRunnerUtils.java b/presto-native-execution/src/test/java/com/facebook/presto/nativeworker/PrestoNativeQueryRunnerUtils.java index 238c7855662e3..83a28231b67f4 100644 --- a/presto-native-execution/src/test/java/com/facebook/presto/nativeworker/PrestoNativeQueryRunnerUtils.java +++ b/presto-native-execution/src/test/java/com/facebook/presto/nativeworker/PrestoNativeQueryRunnerUtils.java @@ -37,7 +37,6 @@ public class PrestoNativeQueryRunnerUtils { private static final String DEFAULT_STORAGE_FORMAT = "DWRF"; - private PrestoNativeQueryRunnerUtils() {} public static QueryRunner createQueryRunner() @@ -82,14 +81,12 @@ public static QueryRunner createQueryRunner( return createNativeQueryRunner(dataDirectory.get().toString(), prestoServerPath.get(), workerCount, cacheMaxSize, true, storageFormat); } - public static QueryRunner createJavaQueryRunner() - throws Exception + public static QueryRunner createJavaQueryRunner() throws Exception { return createJavaQueryRunner(DEFAULT_STORAGE_FORMAT); } - public static QueryRunner createJavaQueryRunner(String storageFormat) - throws Exception + public static QueryRunner createJavaQueryRunner(String storageFormat) throws Exception { String dataDirectory = System.getProperty("DATA_DIR"); return createJavaQueryRunner(Optional.of(Paths.get(dataDirectory)), storageFormat); @@ -108,7 +105,10 @@ public static QueryRunner createJavaQueryRunner(Optional baseDataDirectory hivePropertiesBuilder .put("hive.storage-format", storageFormat) .put("hive.pushdown-filter-enabled", "true"); - hivePropertiesBuilder.put("hive.allow-drop-table", "true"); + + if ("legacy".equals(security)) { + hivePropertiesBuilder.put("hive.allow-drop-table", "true"); + } Optional dataDirectory = baseDataDirectory.map(path -> Paths.get(path.toString() + '/' + storageFormat)); DistributedQueryRunner queryRunner = @@ -173,8 +173,8 @@ public static QueryRunner createNativeQueryRunner( if (cacheMaxSize > 0) { Files.write(catalogDirectoryPath.resolve("hive.properties"), format("connector.name=hive%n" + - "cache.enabled=true%n" + - "cache.max-cache-size=%s", cacheMaxSize).getBytes()); + "cache.enabled=true%n" + + "cache.max-cache-size=%s", cacheMaxSize).getBytes()); } else { Files.write(catalogDirectoryPath.resolve("hive.properties"),