Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.facebook.airlift</groupId>
<artifactId>airbase</artifactId>
<version>109</version>
<version>108</version>
</parent>

<groupId>com.facebook.presto</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -415,8 +415,7 @@ public String findMostSpecific(String attributeType)
}
if (chars[pos] == ',' || chars[pos] == ';') {
//Do nothing
}
else if (chars[pos] != '+') {
} else if (chars[pos] != '+') {
throw new IllegalStateException("Malformed DN: " + dn);
}
pos++;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ public InternalResourceGroupManager(
this.maxQueryAdmissionsPerSecond = queryManagerConfig.getMaxQueryAdmissionsPerSecond();
this.minRunningQueriesForPacing = queryManagerConfig.getMinRunningQueriesForPacing();
this.queryAdmissionIntervalNanos = (maxQueryAdmissionsPerSecond == Integer.MAX_VALUE)
? 0L
: 1_000_000_000L / maxQueryAdmissionsPerSecond;
? 0L
: 1_000_000_000L / maxQueryAdmissionsPerSecond;
this.queryPacingContext = new QueryPacingContext()
{
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public RaftPeer[] getPeers()
.map(resourceManager -> {
RaftPeer.Builder builder = RaftPeer.newBuilder();
builder.setId(RaftPeerId.valueOf(resourceManager.getNodeIdentifier()))
.setAddress(resourceManager.getHost() + ":" + resourceManager.getRaftPort().getAsInt());
.setAddress(resourceManager.getHost() + ":" + resourceManager.getRaftPort().getAsInt());
return builder.build();
}).toArray(RaftPeer[]::new);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ private static void swap(int[] order, int i, int j)
order[j] = t;
}

private static void swap(int i, int j, double[] key, double[]... values)
private static void swap(int i, int j, double[] key, double[]...values)
{
double t = key[i];
key[i] = key[j];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ public void setup()
call(
GREATER_THAN.name(),
greaterThan, BOOLEAN, ImmutableList.of(
new VariableReferenceExpression(Optional.empty(), "y", elementType),
constant(compareValue, elementType)))))));
new VariableReferenceExpression(Optional.empty(), "y", elementType),
constant(compareValue, elementType)))))));
Block block = createChannel(POSITIONS, mapType, elementType);

ImmutableList<RowExpression> projections = projectionsBuilder.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public void testRuleDisabledDoesNotFire()
p.values(p.variable("COL"))))
.addAggregation(p.variable("AVG", DOUBLE), p.rowExpression("avg(COL)"))
.singleGroupingSet(p.variable("CONST_COL"), p.variable("COL"))))
.doesNotFire();
.doesNotFire();
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,6 @@ public void testFeatureDisabled()

newTester.assertThat(ImmutableSet.of(new RemoveRedundantLimit()), logicalPropertiesProvider)
.on("select totalprice from orders o inner join customer c on o.custkey = c.custkey where o.orderkey=10 limit 2")
.validates(plan -> assertNodePresentInPlan(plan, LimitNode.class));
.validates(plan -> assertNodePresentInPlan(plan, LimitNode.class));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,7 @@ public Method getResourceMethod()
try {
method = clazz.getMethod(methodName, parameterTypes);
}
catch (NoSuchMethodException e) {
}
catch (NoSuchMethodException e) { }
return method;
}

Expand Down
2 changes: 0 additions & 2 deletions presto-native-execution/src/checkstyle/presto-checks.xml
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,6 @@

<module name="AnnotationUseStyle">
<property name="trailingArrayComma" value="ignore" />
<!-- see https://checkstyle.sourceforge.io/checks/annotation/annotationusestyle.html#Properties -->
<property name="elementStyle" value="ignore"/>
</module>

<module name="AvoidStarImport" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1788,10 +1788,10 @@ public void testSelectFieldsWithCapitalLetters()
ColumnMetadata.builder()
.setName("col")
.setType(RowType.from(ImmutableList.of(
new RowType.Field(Optional.of("NationKey"), BIGINT),
new RowType.Field(Optional.of("NAME"), VARCHAR),
new RowType.Field(Optional.of("ReGiOnKeY"), BIGINT),
new RowType.Field(Optional.of("commenT"), VARCHAR))))
new RowType.Field(Optional.of("NationKey"), BIGINT),
new RowType.Field(Optional.of("NAME"), VARCHAR),
new RowType.Field(Optional.of("ReGiOnKeY"), BIGINT),
new RowType.Field(Optional.of("commenT"), VARCHAR))))
.build()),
tableProperties);
transaction(queryRunner.getTransactionManager(), queryRunner.getAccessControl())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public static PrestoSparkQueryRunner createHiveRunner(
// Add connectors on the native side to make them available during execution.
ImmutableMap.Builder<String, Map<String, String>> catalogBuilder = ImmutableMap.builder();
catalogBuilder.put("hive", ImmutableMap.of("connector.name", "hive"))
.putAll(additionalCatalogs);
.putAll(additionalCatalogs);
PrestoSparkQueryRunner queryRunner = createRunner(
"hive",
new NativeExecutionModule(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,9 @@ protected void setRows(String query, List<BlockBuilder> blockBuilders, List<Type
JsonNode result = rows.get(rowNumber);
if (result == null || result.size() < blockBuilders.size()) {
throw new PinotException(
PINOT_UNEXPECTED_RESPONSE,
Optional.of(query),
String.format("Expected row of %d columns", blockBuilders.size()));
PINOT_UNEXPECTED_RESPONSE,
Optional.of(query),
String.format("Expected row of %d columns", blockBuilders.size()));
}
for (int columnNumber = 0; columnNumber < blockBuilders.size(); columnNumber++) {
setValue(types.get(columnNumber), blockBuilders.get(columnNumber), result.get(columnNumber));
Expand All @@ -280,25 +280,25 @@ protected static void handleCommonResponse(String pinotQuery, JsonNode jsonBody)

if (numServersQueried == null || numServersResponded == null || numServersQueried.asInt() > numServersResponded.asInt()) {
throw new PinotException(
PINOT_INSUFFICIENT_SERVER_RESPONSE,
Optional.of(pinotQuery),
String.format("Only %s out of %s servers responded for query %s", numServersResponded.asInt(), numServersQueried.asInt(), pinotQuery));
PINOT_INSUFFICIENT_SERVER_RESPONSE,
Optional.of(pinotQuery),
String.format("Only %s out of %s servers responded for query %s", numServersResponded.asInt(), numServersQueried.asInt(), pinotQuery));
}

JsonNode exceptions = jsonBody.get("exceptions");
if (exceptions != null && exceptions.isArray() && exceptions.size() > 0) {
if (exceptions.get(0).get("errorCode").asInt() == 180) {
throw new PinotException(
PINOT_UNAUTHENTICATED_EXCEPTION,
Optional.empty(),
"Query authentication failed.");
PINOT_UNAUTHENTICATED_EXCEPTION,
Optional.empty(),
"Query authentication failed.");
}
// Pinot is known to return exceptions with benign errorcodes like 200
// so we treat any exception as an error
throw new PinotException(
PINOT_EXCEPTION,
Optional.of(pinotQuery),
String.format("Query %s encountered exception %s", pinotQuery, exceptions.get(0)));
PINOT_EXCEPTION,
Optional.of(pinotQuery),
String.format("Query %s encountered exception %s", pinotQuery, exceptions.get(0)));
}
}

Expand Down Expand Up @@ -389,9 +389,9 @@ public int populateFromQueryResults(
JsonNode dataSchema = resultTable.get("dataSchema");
if (dataSchema == null) {
throw new PinotException(
PINOT_UNEXPECTED_RESPONSE,
Optional.of(sql),
"Expected data schema in the response");
PINOT_UNEXPECTED_RESPONSE,
Optional.of(sql),
"Expected data schema in the response");
}
JsonNode columnDataTypes = dataSchema.get("columnDataTypes");
JsonNode columnNames = dataSchema.get("columnNames");
Expand All @@ -400,17 +400,17 @@ public int populateFromQueryResults(
|| !columnDataTypes.isArray()
|| columnDataTypes.size() < blockBuilders.size()) {
throw new PinotException(
PINOT_UNEXPECTED_RESPONSE,
Optional.of(sql),
String.format("ColumnDataTypes and results expected for %s, expected %d columnDataTypes but got %d", sql, blockBuilders.size(), columnDataTypes == null ? 0 : columnDataTypes.size()));
PINOT_UNEXPECTED_RESPONSE,
Optional.of(sql),
String.format("ColumnDataTypes and results expected for %s, expected %d columnDataTypes but got %d", sql, blockBuilders.size(), columnDataTypes == null ? 0 : columnDataTypes.size()));
}
if (columnNames == null
|| !columnNames.isArray()
|| columnNames.size() < blockBuilders.size()) {
throw new PinotException(
PINOT_UNEXPECTED_RESPONSE,
Optional.of(sql),
String.format("ColumnNames and results expected for %s, expected %d columnNames but got %d", sql, blockBuilders.size(), columnNames == null ? 0 : columnNames.size()));
PINOT_UNEXPECTED_RESPONSE,
Optional.of(sql),
String.format("ColumnNames and results expected for %s, expected %d columnNames but got %d", sql, blockBuilders.size(), columnNames == null ? 0 : columnNames.size()));
}

JsonNode rows = resultTable.get("rows");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,21 +88,21 @@ public ConnectorPageSource createPageSource(
switch (pinotSplit.getSplitType()) {
case SEGMENT:
return new PinotSegmentPageSource(
session,
pinotConfig,
pinotStreamingQueryClient,
pinotSplit,
handles);
session,
pinotConfig,
pinotStreamingQueryClient,
pinotSplit,
handles);
case BROKER:
return new PinotBrokerPageSource(
pinotConfig,
session,
pinotSplit.getBrokerPinotQuery().get(),
handles,
pinotSplit.getExpectedColumnHandles(),
clusterInfoFetcher,
objectMapper,
brokerAuthenticationProvider);
pinotConfig,
session,
pinotSplit.getBrokerPinotQuery().get(),
handles,
pinotSplit.getExpectedColumnHandles(),
clusterInfoFetcher,
objectMapper,
brokerAuthenticationProvider);
default:
throw new UnsupportedOperationException("Unknown Pinot split type: " + pinotSplit.getSplitType());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,10 @@ public Page getNextPage()
}
catch (IOException e) {
throw new PinotException(
PINOT_DATA_FETCH_EXCEPTION,
split.getSegmentPinotQuery(),
String.format("Encountered Pinot exceptions when fetching data table from Split: < %s >", split), e);
PINOT_DATA_FETCH_EXCEPTION,
split.getSegmentPinotQuery(),
String.format("Encountered Pinot exceptions when fetching data table from Split: < %s >", split),
e);
}
break;
case CommonConstants.Query.Response.ResponseType.METADATA:
Expand All @@ -223,9 +224,9 @@ public Page getNextPage()
return null;
default:
throw new PinotException(
PINOT_UNEXPECTED_RESPONSE,
split.getSegmentPinotQuery(),
String.format("Encountered Pinot exceptions, unknown response type - %s", responseType));
PINOT_UNEXPECTED_RESPONSE,
split.getSegmentPinotQuery(),
String.format("Encountered Pinot exceptions, unknown response type - %s", responseType));
}
}
Page page = fillNextPage();
Expand All @@ -246,9 +247,9 @@ private Iterator<Server.ServerResponse> queryPinot(PinotSplit split)
int grpcPort = split.getGrpcPort().orElseThrow(() -> new PinotException(PINOT_INVALID_SEGMENT_QUERY_GENERATED, Optional.empty(), "Expected the segment split to contain the grpc port"));
if (grpcPort <= 0) {
throw new PinotException(
PINOT_INVALID_SEGMENT_QUERY_GENERATED,
Optional.empty(),
"Expected the grpc port > 0 always");
PINOT_INVALID_SEGMENT_QUERY_GENERATED,
Optional.empty(),
"Expected the grpc port > 0 always");
}
PinotProxyGrpcRequestBuilder grpcRequestBuilder = new PinotProxyGrpcRequestBuilder()
.setSegments(split.getSegments())
Expand Down
7 changes: 1 addition & 6 deletions presto-product-tests/conf/docker/files/presto-cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,4 @@

set -euxo pipefail

echo "java --version"
echo $(java --version)
export JAVA_HOME=/docker/volumes/overridejdk
echo "/docker/volumes/overridejdk/bin/java --version"
echo $(/docker/volumes/overridejdk/bin/java --version)
/docker/volumes/overridejdk/bin/java -jar /docker/volumes/presto-cli/presto-cli-executable.jar ${CLI_ARGUMENTS} "$@"
java -jar /docker/volumes/presto-cli/presto-cli-executable.jar ${CLI_ARGUMENTS} "$@"
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ protected void configure()
bind(new TypeLiteral<Map<String, Map<String, String>>>() {})
.annotatedWith(
Names.named(NativeExecutionCatalogConfig.NATIVE_EXECUTION_CATALOG_CONFIG))
.toInstance(catalogConfigs);
.toInstance(catalogConfigs);

bind(NativeExecutionSystemConfig.class).in(Scopes.SINGLETON);
bind(NativeExecutionCatalogConfig.class).in(Scopes.SINGLETON);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -340,16 +340,16 @@ public PrestoSparkQueryRunner(
// Sql-Standard Access Control Checker
// needs us to specify our role
.setIdentity(
new Identity(
"hive",
Optional.empty(),
ImmutableMap.of(defaultCatalog,
new SelectedRole(Type.ROLE, Optional.of("admin"))),
ImmutableMap.of(),
ImmutableMap.of(),
Optional.empty(),
Optional.empty()))
.build();
new Identity(
"hive",
Optional.empty(),
ImmutableMap.of(defaultCatalog,
new SelectedRole(Type.ROLE, Optional.of("admin"))),
ImmutableMap.of(),
ImmutableMap.of(),
Optional.empty(),
Optional.empty()))
.build();

transactionManager = injector.getInstance(TransactionManager.class);
metadata = injector.getInstance(Metadata.class);
Expand Down
2 changes: 0 additions & 2 deletions src/checkstyle/presto-checks.xml
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,6 @@

<module name="AnnotationUseStyle">
<property name="trailingArrayComma" value="ignore" />
<!-- see https://checkstyle.sourceforge.io/checks/annotation/annotationusestyle.html#Properties -->
<property name="elementStyle" value="ignore"/>
</module>

<module name="AvoidStarImport" />
Expand Down
Loading