Skip to content

Commit 1a0c891

Browse files
BryanCutleryingsu00
authored andcommitted
Adjust testing Arrow connector name to arrow-flight
1 parent 3b5a705 commit 1a0c891

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

presto-base-arrow-flight/src/test/java/com/facebook/plugin/arrow/ArrowFlightQueryRunner.java

+21-3
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727

2828
import java.io.File;
2929
import java.util.Map;
30+
import java.util.Optional;
3031

3132
import static com.facebook.presto.testing.TestingSession.testSessionBuilder;
3233

@@ -53,11 +54,15 @@ private static DistributedQueryRunner createQueryRunner(
5354
throws Exception
5455
{
5556
Session session = testSessionBuilder()
56-
.setCatalog("arrow")
57+
.setCatalog("arrowflight")
5758
.setSchema("tpch")
5859
.build();
5960

60-
DistributedQueryRunner queryRunner = DistributedQueryRunner.builder(session).setExtraProperties(extraProperties).build();
61+
DistributedQueryRunner.Builder queryRunnerBuilder = DistributedQueryRunner.builder(session);
62+
Optional<Integer> workerCount = getProperty("WORKER_COUNT").map(Integer::parseInt);
63+
workerCount.ifPresent(queryRunnerBuilder::setNodeCount);
64+
65+
DistributedQueryRunner queryRunner = queryRunnerBuilder.setExtraProperties(extraProperties).build();
6166

6267
try {
6368
queryRunner.installPlugin(new TestingArrowFlightPlugin());
@@ -69,7 +74,7 @@ private static DistributedQueryRunner createQueryRunner(
6974
.put("arrow-flight.server-ssl-certificate", "src/test/resources/server.crt")
7075
.put("arrow-flight.server.verify", "true");
7176

72-
queryRunner.createCatalog("arrow", "arrow", properties.build());
77+
queryRunner.createCatalog("arrowflight", "arrow-flight", properties.build());
7378

7479
return queryRunner;
7580
}
@@ -78,6 +83,19 @@ private static DistributedQueryRunner createQueryRunner(
7883
}
7984
}
8085

86+
private static Optional<String> getProperty(String name)
87+
{
88+
String systemPropertyValue = System.getProperty(name);
89+
if (systemPropertyValue != null) {
90+
return Optional.of(systemPropertyValue);
91+
}
92+
String environmentVariableValue = System.getenv(name);
93+
if (environmentVariableValue != null) {
94+
return Optional.of(environmentVariableValue);
95+
}
96+
return Optional.empty();
97+
}
98+
8199
public static void main(String[] args)
82100
throws Exception
83101
{

presto-base-arrow-flight/src/test/java/com/facebook/plugin/arrow/testingConnector/TestingArrowFlightPlugin.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ public class TestingArrowFlightPlugin
2121
{
2222
public TestingArrowFlightPlugin()
2323
{
24-
super("arrow", new TestingArrowModule(), new JsonModule());
24+
super("arrow-flight", new TestingArrowModule(), new JsonModule());
2525
}
2626
}

0 commit comments

Comments
 (0)