Skip to content

Commit

Permalink
fix rebase issue after PQL deprecation (apache#8652)
Browse files Browse the repository at this point in the history
Co-authored-by: Rong Rong <[email protected]>
  • Loading branch information
walterddr and Rong Rong committed May 17, 2022
1 parent 3b01b2d commit 30bc434
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
* the worker manager later when we split out the query-spi layer.
*/
public class WorkerManager {
private static final CalciteSqlCompiler CALCITE_SQL_COMPILER = new CalciteSqlCompiler();

private final String _hostName;
private final int _port;
Expand Down Expand Up @@ -90,7 +89,7 @@ private RoutingTable getRoutingTable(String tableName) {
String rawTableName = TableNameBuilder.extractRawTableName(tableName);
// TODO: support both offline and realtime, now we hard code offline table.
String tableNameWithType = TableNameBuilder.forType(TableType.OFFLINE).tableNameWithType(rawTableName);
return _routingManager.getRoutingTable(CALCITE_SQL_COMPILER.compileToBrokerRequest(
return _routingManager.getRoutingTable(CalciteSqlCompiler.compileToBrokerRequest(
"SELECT * FROM " + tableNameWithType));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,18 @@ public void testQueryAndAssertStageContentForJoin()
// table scan stages; for tableA it should have 2 hosts, for tableB it should have only 1
Assert.assertEquals(
e.getValue().getServerInstances().stream().map(ServerInstance::toString).collect(Collectors.toList()),
tables.get(0).equals("a") ? ImmutableList.of("Server_localhost_1", "Server_localhost_2")
: ImmutableList.of("Server_localhost_1"));
tables.get(0).equals("a") ? ImmutableList.of("localhost_1", "localhost_2")
: ImmutableList.of("localhost_1"));
} else if (!PlannerUtils.isRootStage(e.getKey())) {
// join stage should have both servers used.
Assert.assertEquals(
e.getValue().getServerInstances().stream().map(ServerInstance::toString).collect(Collectors.toList()),
ImmutableList.of("Server_localhost_1", "Server_localhost_2"));
ImmutableList.of("localhost_1", "localhost_2"));
} else {
// reduce stage should have the reducer instance.
Assert.assertEquals(
e.getValue().getServerInstances().stream().map(ServerInstance::toString).collect(Collectors.toList()),
ImmutableList.of("Server_localhost_3"));
ImmutableList.of("localhost_3"));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
* <p>For each of the data block received from the left table, it will generate a joint data block.
*/
public class HashJoinOperator extends BaseOperator<DataTableBlock> {
private static final String OPERATOR_NAME = "BroadcastJoinOperator";
private static final String EXPLAIN_NAME = "BROADCAST_JOIN";

private final HashMap<Object, List<Object[]>> _broadcastHashTable;
Expand All @@ -68,11 +67,6 @@ public HashJoinOperator(BaseOperator<DataTableBlock> leftTableOperator,
_broadcastHashTable = new HashMap<>();
}

@Override
public String getOperatorName() {
return OPERATOR_NAME;
}

@Override
public List<Operator> getChildOperators() {
// WorkerExecutor doesn't use getChildOperators, returns null here.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
*/
public class MailboxReceiveOperator extends BaseOperator<DataTableBlock> {
private static final Logger LOGGER = LoggerFactory.getLogger(MailboxReceiveOperator.class);
private static final String OPERATOR_NAME = "MailboxReceiveOperator";
private static final String EXPLAIN_NAME = "MAILBOX_RECEIVE";
private static final long DEFAULT_TIMEOUT_NANO = 10_000_000_000L;

Expand All @@ -68,11 +67,6 @@ public MailboxReceiveOperator(MailboxService<Mailbox.MailboxContent> mailboxServ
_stageId = stageId;
}

@Override
public String getOperatorName() {
return OPERATOR_NAME;
}

@Override
public List<Operator> getChildOperators() {
// WorkerExecutor doesn't use getChildOperators, returns null here.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
*/
public class MailboxSendOperator extends BaseOperator<DataTableBlock> {
private static final Logger LOGGER = LoggerFactory.getLogger(MailboxSendOperator.class);
private static final String OPERATOR_NAME = "MailboxSendOperator";
private static final String EXPLAIN_NAME = "MAILBOX_SEND";
private static final Set<RelDistribution.Type> SUPPORTED_EXCHANGE_TYPE =
ImmutableSet.of(RelDistribution.Type.SINGLETON, RelDistribution.Type.RANDOM_DISTRIBUTED,
Expand Down Expand Up @@ -101,11 +100,6 @@ public MailboxSendOperator(MailboxService<Mailbox.MailboxContent> mailboxService
_stageId = stageId;
}

@Override
public String getOperatorName() {
return OPERATOR_NAME;
}

@Override
public List<Operator> getChildOperators() {
// WorkerExecutor doesn't use getChildOperators, returns null here.
Expand Down

0 comments on commit 30bc434

Please sign in to comment.