Skip to content

Commit

Permalink
Delete leftJoin from the C++ client API. Needs protoc and documentati…
Browse files Browse the repository at this point in the history
…on generation, still.
  • Loading branch information
rcaudy committed Dec 1, 2021
1 parent b680338 commit 0becd1d
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 73 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,6 @@ class TableHandleImpl {
std::shared_ptr<TableHandleImpl> exactJoin(const TableHandleImpl &rightSide,
std::vector<std::string> columnsToMatch, std::vector<std::string> columnsToAdd) const;

std::shared_ptr<TableHandleImpl> leftJoin(const TableHandleImpl &rightSide,
std::vector<std::string> columnsToMatch, std::vector<std::string> columnsToAdd) const;

std::shared_ptr<TableHandleImpl> asOfJoin(AsOfJoinTablesRequest::MatchRule matchRule,
const TableHandleImpl &rightSide, std::vector<std::string> columnsToMatch,
std::vector<std::string> columnsToAdd);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,6 @@ class Server {
std::vector<std::string> columnsToMatch, std::vector<std::string> columnsToAdd,
std::shared_ptr<EtcCallback> etcCallback);

Ticket leftJoinAsync(Ticket leftTableTicket, Ticket rightTableTicket,
std::vector<std::string> columnsToMatch, std::vector<std::string> columnsToAdd,
std::shared_ptr<EtcCallback> etcCallback);

Ticket asOfJoinAsync(AsOfJoinTablesRequest::MatchRule matchRule, Ticket leftTableTicket,
Ticket rightTableTicket, std::vector<std::string> columnsToMatch,
std::vector<std::string> columnsToAdd, std::shared_ptr<EtcCallback> etcCallback);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -962,7 +962,7 @@ class TableHandle {
* the columns in `columnsToMatch`, and columns from `rightSide` are brought in and optionally
* renamed by `columnsToAdd`. Example:
* @code
* t1.naturalJoin({"Col1", "Col2"}, {"Col3", "NewCol=Col4"})
* t1.exactJoin({"Col1", "Col2"}, {"Col3", "NewCol=Col4"})
* @endcode
* @param rightSide The table to join with this table
* @param columnsToMatch The columns to join on
Expand All @@ -985,34 +985,6 @@ class TableHandle {
TableHandle exactJoin(const TableHandle &rightSide, std::vector<MatchWithColumn> columnsToMatch,
std::vector<SelectColumn> columnsToAdd) const;

/**
* Creates a new table by left joining this table with `rightSide`. The tables are joined by
* the columns in `columnsToMatch`, and columns from `rightSide` are brought in and optionally
* renamed by `columnsToAdd`. Example:
* @code
* t1.naturalJoin({"Col1", "Col2"}, {"Col3", "NewCol=Col4"})
* @endcode
* @param rightSide The table to join with this table
* @param columnsToMatch The columns to join on
* @param columnsToAdd The columns from the right side to add, and possibly rename.
* @return A TableHandle referencing the new table
*/
TableHandle leftJoin(const TableHandle &rightSide, std::vector<std::string> columnsToMatch,
std::vector<std::string> columnsToAdd) const;
/**
* The fluent version of leftJoin(const TableHandle &, std::vector<std::string>, std::vector<std::string>) const.
* @code
* t1.leftJoin(col1, col2}, {col3, col4.as("NewCol"})
* @endcode
* @param rightSide The table to join with this table
* @param columnsToMatch The columns to join on
* @param columnsToAdd The columns from the right side to add, and possibly rename.
* @return
*/
TableHandle leftJoin(const TableHandle &rightSide, std::vector<MatchWithColumn> columnsToMatch,
std::vector<SelectColumn> columnsToAdd) const;

/**
* Binds this table to a variable name in the QueryScope.
* @param variable
Expand Down
14 changes: 0 additions & 14 deletions cpp-client/deephaven/client/src/highlevel/client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -495,20 +495,6 @@ TableHandle TableHandle::exactJoin(const TableHandle &rightSide,
return exactJoin(rightSide, std::move(ctmStrings), std::move(ctaStrings));
}

TableHandle TableHandle::leftJoin(const TableHandle &rightSide,
std::vector<std::string> columnsToMatch, std::vector<std::string> columnsToAdd) const {
auto qtImpl = impl_->leftJoin(*rightSide.impl_, std::move(columnsToMatch),
std::move(columnsToAdd));
return TableHandle(std::move(qtImpl));
}

TableHandle TableHandle::leftJoin(const TableHandle &rightSide,
std::vector<MatchWithColumn> columnsToMatch, std::vector<SelectColumn> columnsToAdd) const {
auto ctmStrings = toIrisRepresentation(columnsToMatch);
auto ctaStrings = toIrisRepresentation(columnsToAdd);
return leftJoin(rightSide, std::move(ctmStrings), std::move(ctaStrings));
}

void TableHandle::bindToVariable(std::string variable) const {
auto res = SFCallback<>::createForFuture();
bindToVariableAsync(std::move(variable), std::move(res.first));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,14 +303,6 @@ std::shared_ptr<TableHandleImpl> TableHandleImpl::exactJoin(const TableHandleImp
return TableHandleImpl::create(managerImpl_, std::move(resultTicket), std::move(cb));
}

std::shared_ptr<TableHandleImpl> TableHandleImpl::leftJoin(const TableHandleImpl &rightSide,
std::vector<std::string> columnsToMatch, std::vector<std::string> columnsToAdd) const {
auto cb = TableHandleImpl::createEtcCallback(managerImpl_.get());
auto resultTicket = managerImpl_->server()->leftJoinAsync(ticket_, rightSide.ticket_,
std::move(columnsToMatch), std::move(columnsToAdd), cb);
return TableHandleImpl::create(managerImpl_, std::move(resultTicket), std::move(cb));
}

std::shared_ptr<TableHandleImpl> TableHandleImpl::asOfJoin(AsOfJoinTablesRequest::MatchRule matchRule,
const TableHandleImpl &rightSide, std::vector<std::string> columnsToMatch,
std::vector<std::string> columnsToAdd) {
Expand Down
15 changes: 0 additions & 15 deletions cpp-client/deephaven/client/src/lowlevel/server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ using io::deephaven::proto::backplane::grpc::FetchTableRequest;
using io::deephaven::proto::backplane::grpc::HandshakeRequest;
using io::deephaven::proto::backplane::grpc::HeadOrTailRequest;
using io::deephaven::proto::backplane::grpc::HeadOrTailByRequest;
using io::deephaven::proto::backplane::grpc::LeftJoinTablesRequest;
using io::deephaven::proto::backplane::grpc::MergeTablesRequest;
using io::deephaven::proto::backplane::grpc::NaturalJoinTablesRequest;
using io::deephaven::proto::backplane::grpc::SelectOrUpdateRequest;
Expand Down Expand Up @@ -361,20 +360,6 @@ Ticket Server::exactJoinAsync(Ticket leftTableTicket, Ticket rightTableTicket,
return result;
}

Ticket Server::leftJoinAsync(Ticket leftTableTicket, Ticket rightTableTicket,
std::vector<std::string> columnsToMatch, std::vector<std::string> columnsToAdd,
std::shared_ptr<EtcCallback> etcCallback) {
auto result = newTicket();
LeftJoinTablesRequest req;
*req.mutable_result_id() = result;
*req.mutable_left_id()->mutable_ticket() = std::move(leftTableTicket);
*req.mutable_right_id()->mutable_ticket() = std::move(rightTableTicket);
moveVectorData(std::move(columnsToMatch), req.mutable_columns_to_match());
moveVectorData(std::move(columnsToAdd), req.mutable_columns_to_add());
sendRpc(req, std::move(etcCallback), tableStub(), &TableService::Stub::AsyncLeftJoinTables, true);
return result;
}

Ticket Server::asOfJoinAsync(AsOfJoinTablesRequest::MatchRule matchRule, Ticket leftTableTicket,
Ticket rightTableTicket, std::vector<std::string> columnsToMatch,
std::vector<std::string> columnsToAdd, std::shared_ptr<EtcCallback> etcCallback) {
Expand Down

0 comments on commit 0becd1d

Please sign in to comment.