From 22e3ff999af28a886c6e11a3611680dab44ea226 Mon Sep 17 00:00:00 2001 From: yixinglu <2520865+yixinglu@users.noreply.github.com> Date: Wed, 7 Dec 2022 21:59:56 +0800 Subject: [PATCH] Log query for opt error --- src/graph/service/QueryInstance.cpp | 3 ++- .../PushFilterDownHashInnerJoinRule.feature | 26 +++++++++---------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/graph/service/QueryInstance.cpp b/src/graph/service/QueryInstance.cpp index 2d5107d9bbb..45d0ef02e88 100644 --- a/src/graph/service/QueryInstance.cpp +++ b/src/graph/service/QueryInstance.cpp @@ -93,7 +93,8 @@ Status QueryInstance::validateAndOptimize() { // Optimize the query, and get the execution plan. We should not pass the optimizer errors to user // since the message is often not easy to understand. Logging them is enough. if (auto status = findBestPlan(); !status.ok()) { - LOG(ERROR) << "Error found in optimization stage: " << status.message(); + LOG(ERROR) << "Error found in optimization stage for query: " << rctx->query() + << ", error: " << status.message(); return Status::Error( "There are some errors found in optimizer, " "please contact to the admin to learn more details"); diff --git a/tests/tck/features/optimizer/PushFilterDownHashInnerJoinRule.feature b/tests/tck/features/optimizer/PushFilterDownHashInnerJoinRule.feature index b884023c907..8cb8bb47cd7 100644 --- a/tests/tck/features/optimizer/PushFilterDownHashInnerJoinRule.feature +++ b/tests/tck/features/optimizer/PushFilterDownHashInnerJoinRule.feature @@ -178,20 +178,20 @@ Feature: Push Filter down HashInnerJoin rule | a | b | c | | ("Amar'e Stoudemire" :player{age: 36, name: "Amar'e Stoudemire"}) | ("Steve Nash" :player{age: 45, name: "Steve Nash"}) | ("Lakers" :team{name: "Lakers"}) | And the execution plan should be: - | id | name | dependencies | operator info | - | 16 | TopN | 25 | | - | 25 | HashInnerJoin | 27,29 | | - | 27 | Project | 30 | | + | id | name | dependencies | operator info | + | 16 | TopN | 25 | | + | 25 | HashInnerJoin | 27,29 | | + | 27 | Project | 30 | | | 30 | Filter | 4 | {"condition": "((($-.b.player.age+$-.a.player.age)>40) AND ($-.a.player.age<45) AND ($-.b.player.age>30))"} | - | 4 | AppendVertices | 24 | | - | 24 | Traverse | 1 | | - | 1 | IndexScan | 2 | | - | 2 | Start | | | - | 29 | Project | 28 | | - | 28 | Filter | 9 | {"condition": "($-.c.team.name>\"A\")"} | - | 9 | AppendVertices | 8 | | - | 8 | Traverse | 7 | | - | 7 | Argument | | | + | 4 | AppendVertices | 24 | | + | 24 | Traverse | 1 | | + | 1 | IndexScan | 2 | | + | 2 | Start | | | + | 29 | Project | 28 | | + | 28 | Filter | 9 | {"condition": "($-.c.team.name>\"A\")"} | + | 9 | AppendVertices | 8 | | + | 8 | Traverse | 7 | | + | 7 | Argument | | | When profiling query: """ match (a:player)-[:like]->(b)