Skip to content

Commit

Permalink
Removed a case in pruning properties on aggregation.
Browse files Browse the repository at this point in the history
  • Loading branch information
xtcyclist committed Dec 5, 2022
1 parent 8fff4aa commit d8727f9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/common/function/AggFunctionManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ AggFunctionManager::AggFunctionManager() {
if (res.isNull()) {
res = 0;
}
if (val.isNull() || val.empty()) {
// val.isNull() ||
if (val.empty()) {
return;
}

Expand Down
9 changes: 9 additions & 0 deletions src/graph/executor/query/ProjectExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,15 @@ DataSet ProjectExecutor::handleJob(size_t begin, size_t end, Iterator *iter) {
Row row;
for (auto &col : columns->columns()) {
Value val = col->expr()->eval(ctx(iter));
if (iter->row()->values[0].type() == Value::Type::INT) {
VLOG(1) << "Value read from dataset: " << iter->row()->values[0].getInt()
<< iter->row()->values[0].type();
VLOG(1) << "Value inserted into row in project: " << val.getInt() << "\t" << val.type();
} else {
VLOG(1) << "Value read from dataset: " << iter->row()->values[0].getInt()
<< iter->row()->values[0].type();
VLOG(1) << "Value inserted into row in project: " << val.getInt() << "\t" << val.type();
}
row.values.emplace_back(std::move(val));
}
ds.rows.emplace_back(std::move(row));
Expand Down
3 changes: 1 addition & 2 deletions src/graph/visitor/PropertyTrackerVisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,7 @@ void PropertyTrackerVisitor::visit(AggregateExpression *expr) {
std::transform(funName.begin(), funName.end(), funName.begin(), ::tolower);
if (funName == "count") {
auto kind = expr->arg()->kind();
if (kind == Expression::Kind::kConstant || kind == Expression::Kind::kInputProperty ||
kind == Expression::Kind::kVarProperty) {
if (kind == Expression::Kind::kConstant || kind == Expression::Kind::kInputProperty) {
return;
}
}
Expand Down

0 comments on commit d8727f9

Please sign in to comment.