Skip to content
This repository has been archived by the owner on Dec 1, 2022. It is now read-only.

Commit

Permalink
Fix compile error
Browse files Browse the repository at this point in the history
  • Loading branch information
Aiee committed Jul 30, 2021
1 parent db84ec4 commit e68b136
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
3 changes: 0 additions & 3 deletions src/util/ExpressionUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,6 @@ class ExpressionUtils {
// Clone and reduce unaryNot expression
static Expression* reduceUnaryNotExpr(const Expression* expr);

// Rewrite IN expression into OR expression
// static Expression* rewriteInExpr(const Expression* expr, ObjectPool* pool);

// Transform filter using multiple expression rewrite strategies
// 1. rewrite relational expressions containing arithmetic operands so that
// all constants are on the right side of relExpr.
Expand Down
7 changes: 3 additions & 4 deletions src/validator/LookupValidator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ StatusOr<Expression*> LookupValidator::rewriteRelExpr(RelationalExpression* expr
}

// fold constant expression
auto pool = qctx_->objPool();
auto foldRes = ExpressionUtils::foldConstantExpr(expr);
NG_RETURN_IF_ERROR(foldRes);
expr = static_cast<RelationalExpression*>(foldRes.value());
Expand All @@ -223,7 +222,7 @@ StatusOr<Expression*> LookupValidator::rewriteRelExpr(RelationalExpression* expr
// Check schema and value type
std::string prop = la->right()->value().getStr();
auto relExprType = expr->kind();
auto c = checkConstExpr(expr->right(), pool, prop, relExprType);
auto c = checkConstExpr(expr->right(), prop, relExprType);
NG_RETURN_IF_ERROR(c);
expr->setRight(std::move(c).value());

Expand Down Expand Up @@ -288,9 +287,9 @@ Expression* LookupValidator::rewriteInExpr(const Expression* expr) {
}

StatusOr<Expression*> LookupValidator::checkConstExpr(Expression* expr,
ObjectPool* pool,
const std::string& prop,
const Expression::Kind kind) {
auto* pool = expr->getObjPool();
if (!evaluableExpr(expr)) {
return Status::SemanticError("'%s' is not an evaluable expression.",
expr->toString().c_str());
Expand All @@ -309,7 +308,7 @@ StatusOr<Expression*> LookupValidator::checkConstExpr(Expression* expr,
// comparisons.
// Allow different numeric types to compare
if (graph::SchemaUtil::propTypeToValueType(type) == Value::Type::FLOAT && v.isInt()) {
return ConstantExpression::make(expr->getObjPool(), v.toFloat());
return ConstantExpression::make(pool, v.toFloat());
} else if (graph::SchemaUtil::propTypeToValueType(type) == Value::Type::INT && v.isFloat()) {
// col1 < 10.5 range: [min, 11), col1 < 10 range: [min, 10)
double f = v.getFloat();
Expand Down
2 changes: 1 addition & 1 deletion src/validator/LookupValidator.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ class LookupValidator final : public Validator {
Status checkRelExpr(RelationalExpression* expr);
StatusOr<std::string> checkTSExpr(Expression* expr);
StatusOr<Expression*> checkConstExpr(Expression* expr,
ObjectPool* pool,
const std::string& prop,
const Expression::Kind kind);

StatusOr<Expression*> rewriteRelExpr(RelationalExpression* expr);
// Rewrite IN expression into OR expression or relEQ expression
Expression* rewriteInExpr(const Expression* expr);
Expression* reverseRelKind(RelationalExpression* expr);

Expand Down

0 comments on commit e68b136

Please sign in to comment.