Skip to content

Commit

Permalink
Revert the 2087 workaround. (#2168)
Browse files Browse the repository at this point in the history
  • Loading branch information
Shylock-Hg authored Jun 10, 2020
1 parent 1f69dd1 commit 06a5db4
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 41 deletions.
20 changes: 2 additions & 18 deletions src/graph/GoExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -491,14 +491,6 @@ Status GoExecutor::setupStarts() {
return std::move(result).status();
}
starts_ = std::move(result).value();
std::unordered_set<VertexID> uni;
uni.reserve(starts_.size());
uni.insert(starts_.begin(), starts_.end());
if (starts_.size() == uni.size()) {
uniqueStart_ = true;
} else {
uniqueStart_ = false;
}

auto indexResult = inputs->buildIndex(*colname_);
if (!indexResult.ok()) {
Expand Down Expand Up @@ -1151,19 +1143,11 @@ bool GoExecutor::processFinalResult(Callback cb) const {
return ret.value();
};
getters.getVariableProp = [&srcId,
this] (const std::string &prop) -> OptVariantType {
if (!uniqueStart_) {
return Status::NotSupported(
"Not supported duplicate start from variable");
}
this] (const std::string &prop) {
return getPropFromInterim(srcId, prop);
};
getters.getInputProp = [&srcId,
this] (const std::string &prop) -> OptVariantType {
if (!uniqueStart_) {
return Status::NotSupported(
"Not supported duplicate start from input");
}
this] (const std::string &prop) {
return getPropFromInterim(srcId, prop);
};

Expand Down
2 changes: 0 additions & 2 deletions src/graph/GoExecutor.h
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,6 @@ class GoExecutor final : public TraverseExecutor {
std::unique_ptr<cpp2::ExecutionResponse> resp_;
// Record the data of response in GO step
std::vector<RpcResponse> records_;
// TODO(shylock) Join lose the data with duplicate input(VID) map
bool uniqueStart_{false}; // #2087 Workaround
// The name of Tag or Edge, index of prop in data
using SchemaPropIndex = std::unordered_map<std::pair<std::string, std::string>, int64_t>;
};
Expand Down
21 changes: 0 additions & 21 deletions src/graph/test/GoTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2618,27 +2618,6 @@ TEST_P(GoTest, ErrorMsg) {
}
}

TEST_P(GoTest, issue2087) {
// from input
{
cpp2::ExecutionResponse resp;
auto *fmt = "GO FROM %ld OVER like YIELD like._src as src, like._dst as dst "
"| GO FROM $-.src OVER like YIELD $-.src as src, like._dst as dst";
auto query = folly::stringPrintf(fmt, players_["Tim Duncan"].vid());
auto code = client_->execute(query, resp);
ASSERT_EQ(cpp2::ErrorCode::E_EXECUTION_ERROR, code);
}
// from variable
{
cpp2::ExecutionResponse resp;
auto *fmt = "$a = GO FROM %ld OVER like YIELD like._src as src, like._dst as dst; "
"GO FROM $a.src OVER like YIELD $-.src as src, like._dst as dst";
auto query = folly::stringPrintf(fmt, players_["Tim Duncan"].vid());
auto code = client_->execute(query, resp);
ASSERT_EQ(cpp2::ErrorCode::E_EXECUTION_ERROR, code);
}
}

TEST_P(GoTest, ZeroStep) {
// Zero step
{
Expand Down

0 comments on commit 06a5db4

Please sign in to comment.