Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
public class PrestoNativeQueryRunnerUtils
{
private static final String DEFAULT_STORAGE_FORMAT = "DWRF";

private PrestoNativeQueryRunnerUtils() {}

public static QueryRunner createQueryRunner()
Expand Down Expand Up @@ -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);
Expand All @@ -108,7 +105,10 @@ public static QueryRunner createJavaQueryRunner(Optional<Path> 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<Path> dataDirectory = baseDataDirectory.map(path -> Paths.get(path.toString() + '/' + storageFormat));
DistributedQueryRunner queryRunner =
Expand Down Expand Up @@ -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"),
Expand Down