diff --git a/src/graph/validator/LookupValidator.cpp b/src/graph/validator/LookupValidator.cpp index 7da955281b5..5395ebaed6f 100644 --- a/src/graph/validator/LookupValidator.cpp +++ b/src/graph/validator/LookupValidator.cpp @@ -41,7 +41,7 @@ Status LookupValidator::validateImpl() { lookupCtx_ = getContext(); NG_RETURN_IF_ERROR(validateFrom()); - NG_RETURN_IF_ERROR(validateFilter()); + NG_RETURN_IF_ERROR(validateWhere()); NG_RETURN_IF_ERROR(validateYield()); return Status::OK(); } @@ -57,19 +57,6 @@ Status LookupValidator::validateFrom() { return Status::OK(); } -Status LookupValidator::extractSchemaProp() { - shared_ptr schema; - NG_RETURN_IF_ERROR(getSchemaProvider(&schema)); - for (std::size_t i = 0; i < schema->getNumFields(); ++i) { - const auto& propName = schema->getFieldName(i); - auto iter = std::find(idxReturnCols_.begin(), idxReturnCols_.end(), propName); - if (iter == idxReturnCols_.end()) { - idxReturnCols_.emplace_back(propName); - } - } - return Status::OK(); -} - void LookupValidator::extractExprProps() { auto addProps = [this](const std::set& propNames) { for (const auto& propName : propNames) { @@ -108,9 +95,6 @@ Status LookupValidator::validateYieldEdge() { {Expression::Kind::kAggregate, Expression::Kind::kVertex})) { return Status::SemanticError("illegal yield clauses `%s'", col->toString().c_str()); } - if (ExpressionUtils::hasAny(col->expr(), {Expression::Kind::kEdge})) { - NG_RETURN_IF_ERROR(extractSchemaProp()); - } if (col->expr()->kind() == Expression::Kind::kLabelAttribute) { const auto& schemaName = static_cast(col->expr())->left()->name(); if (schemaName != sentence()->from()) { @@ -138,9 +122,6 @@ Status LookupValidator::validateYieldTag() { {Expression::Kind::kAggregate, Expression::Kind::kEdge})) { return Status::SemanticError("illegal yield clauses `%s'", col->toString().c_str()); } - if (ExpressionUtils::hasAny(col->expr(), {Expression::Kind::kVertex})) { - NG_RETURN_IF_ERROR(extractSchemaProp()); - } if (col->expr()->kind() == Expression::Kind::kLabelAttribute) { const auto& schemaName = static_cast(col->expr())->left()->name(); if (schemaName != sentence()->from()) { @@ -188,7 +169,7 @@ Status LookupValidator::validateYield() { return Status::OK(); } -Status LookupValidator::validateFilter() { +Status LookupValidator::validateWhere() { auto whereClause = sentence()->whereClause(); if (whereClause == nullptr) { return Status::OK(); diff --git a/src/graph/validator/LookupValidator.h b/src/graph/validator/LookupValidator.h index 56236bdd92c..9889d99971e 100644 --- a/src/graph/validator/LookupValidator.h +++ b/src/graph/validator/LookupValidator.h @@ -29,7 +29,7 @@ class LookupValidator final : public Validator { Status validateFrom(); Status validateYield(); - Status validateFilter(); + Status validateWhere(); Status validateYieldTag(); Status validateYieldEdge(); @@ -53,7 +53,6 @@ class LookupValidator final : public Validator { Status getSchemaProvider(std::shared_ptr* provider) const; StatusOr genTsFilter(Expression* filter); StatusOr handleLogicalExprOperands(LogicalExpression* lExpr); - Status extractSchemaProp(); void extractExprProps(); std::unique_ptr lookupCtx_; diff --git a/src/graph/validator/YieldValidator.cpp b/src/graph/validator/YieldValidator.cpp index e622eda743d..901774e8697 100644 --- a/src/graph/validator/YieldValidator.cpp +++ b/src/graph/validator/YieldValidator.cpp @@ -65,7 +65,7 @@ Status YieldValidator::makeOutputColumn(YieldColumn *column) { DCHECK(colExpr != nullptr); auto expr = colExpr->clone(); - NG_RETURN_IF_ERROR(deduceProps(expr, exprProps_, {}, {})); + NG_RETURN_IF_ERROR(deduceProps(expr, exprProps_)); auto status = deduceExprType(expr); NG_RETURN_IF_ERROR(status);