Skip to content

Commit

Permalink
Report errors in the executor when an unwind operator is applied on a…
Browse files Browse the repository at this point in the history
… non-list data type.
  • Loading branch information
xtcyclist committed Dec 13, 2022
1 parent 573f7f4 commit ce89ea9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/graph/executor/query/UnwindExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ folly::Future<Status> UnwindExecutor::execute() {
ds.colNames = unwind->colNames();
for (; iter->valid(); iter->next()) {
const Value &list = unwindExpr->eval(ctx(iter.get()));
if (!list.isList()) {
std::stringstream ss;
ss << "Unwind on types other than list for " << unwindExpr->toString()
<< ". This is not supported.";
return Status::Error(ss.str());
}
std::vector<Value> vals = extractList(list);
for (auto &v : vals) {
Row row;
Expand Down

0 comments on commit ce89ea9

Please sign in to comment.