From d8727f9e5acde782bfa0bccbba0ed595257280cb Mon Sep 17 00:00:00 2001 From: xtcyclist <7731943+xtcyclist@users.noreply.github.com> Date: Fri, 2 Dec 2022 18:41:04 +0800 Subject: [PATCH] Removed a case in pruning properties on aggregation. --- src/common/function/AggFunctionManager.cpp | 3 ++- src/graph/executor/query/ProjectExecutor.cpp | 9 +++++++++ src/graph/visitor/PropertyTrackerVisitor.cpp | 3 +-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/common/function/AggFunctionManager.cpp b/src/common/function/AggFunctionManager.cpp index 4621143b4b1..4d01222af46 100644 --- a/src/common/function/AggFunctionManager.cpp +++ b/src/common/function/AggFunctionManager.cpp @@ -32,7 +32,8 @@ AggFunctionManager::AggFunctionManager() { if (res.isNull()) { res = 0; } - if (val.isNull() || val.empty()) { + // val.isNull() || + if (val.empty()) { return; } diff --git a/src/graph/executor/query/ProjectExecutor.cpp b/src/graph/executor/query/ProjectExecutor.cpp index 64db18cede0..ff97e7799d0 100644 --- a/src/graph/executor/query/ProjectExecutor.cpp +++ b/src/graph/executor/query/ProjectExecutor.cpp @@ -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)); diff --git a/src/graph/visitor/PropertyTrackerVisitor.cpp b/src/graph/visitor/PropertyTrackerVisitor.cpp index 293fa77ebe8..d2d6dbcc2c4 100644 --- a/src/graph/visitor/PropertyTrackerVisitor.cpp +++ b/src/graph/visitor/PropertyTrackerVisitor.cpp @@ -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; } }