MCPcopy Create free account
hub / github.com/LadybugDB/ladybug / getRoot

Method getRoot

test/optimizer/optimizer_test.cpp:25–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23 return planner::LogicalPlanUtil::encodeJoin(*TestRunner::getLogicalPlan(query, *conn));
24 }
25 std::unique_ptr<planner::LogicalPlan> getRoot(const std::string& query) {
26 auto preparedStatement = conn->prepare(query);
27 if (!preparedStatement->isSuccess()) {
28 throw std::runtime_error("Failed to prepare optimizer test query:\n" + query +
29 "\nError:\n" + preparedStatement->getErrorMessage());
30 }
31 auto cachedStatement =
32 conn->getClientContext()->getCachedPreparedStatementManager().getCachedStatement(
33 preparedStatement->getName());
34 return std::move(cachedStatement->logicalPlan);
35 }
36
37 // Helper to check if a specific operator type exists in the plan
38 static bool hasOperatorType(planner::LogicalOperator* op, planner::LogicalOperatorType type) {

Callers

nothing calls this directly

Calls 6

getCachedStatementMethod · 0.80
prepareMethod · 0.45
isSuccessMethod · 0.45
getErrorMessageMethod · 0.45
getClientContextMethod · 0.45
getNameMethod · 0.45

Tested by

no test coverage detected