From dd76ee59d440b71138bc745e6756c15f10fa6d39 Mon Sep 17 00:00:00 2001 From: "kyle.cao" Date: Thu, 18 Aug 2022 15:38:55 +0800 Subject: [PATCH] fix lookup (#4552) fix Co-authored-by: jimingquan Co-authored-by: Sophie <84560950+Sophie-Xie@users.noreply.github.com> --- .../optimizer/rule/OptimizeEdgeIndexScanByFilterRule.cpp | 2 +- tests/tck/features/lookup/LookUp.feature | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/graph/optimizer/rule/OptimizeEdgeIndexScanByFilterRule.cpp b/src/graph/optimizer/rule/OptimizeEdgeIndexScanByFilterRule.cpp index f02f025d5e7..8b4fb01aa39 100644 --- a/src/graph/optimizer/rule/OptimizeEdgeIndexScanByFilterRule.cpp +++ b/src/graph/optimizer/rule/OptimizeEdgeIndexScanByFilterRule.cpp @@ -118,7 +118,7 @@ StatusOr OptimizeEdgeIndexScanByFilterRule::transform( if (static_cast(inExpr->right())->size() > 1) { return TransformResult::noTransform(); } else { - transformedExpr = graph::ExpressionUtils::rewriteInExpr(condition); + transformedExpr = graph::ExpressionUtils::rewriteInExpr(inExpr); } if (OptimizerUtils::relExprHasIndex(inExpr, indexItems)) { return TransformResult::noTransform(); diff --git a/tests/tck/features/lookup/LookUp.feature b/tests/tck/features/lookup/LookUp.feature index 2c54e6fe452..769d1503148 100644 --- a/tests/tck/features/lookup/LookUp.feature +++ b/tests/tck/features/lookup/LookUp.feature @@ -71,6 +71,13 @@ Feature: LookUpTest_Vid_String Then the result should be, in any order: | src | dst | rank | | "200" | "201" | 0 | + When executing query: + """ + LOOKUP ON lookup_edge_1 WHERE lookup_edge_1.col2 IN [201] and lookup_edge_1.col2>3 YIELD src(edge) as src, dst(Edge) as dst, rank(edge) as rank + """ + Then the result should be, in any order: + | src | dst | rank | + | "200" | "201" | 0 | When executing query: """ LOOKUP ON lookup_edge_2 WHERE lookup_edge_2.col1 == 200 YIELD edge as e