| 41 | } |
| 42 | |
| 43 | std::unique_ptr<PhysicalOperator> PlanMapper::mapPathPropertyProbe( |
| 44 | const LogicalOperator* logicalOperator) { |
| 45 | auto& logicalProbe = logicalOperator->constCast<LogicalPathPropertyProbe>(); |
| 46 | if (logicalProbe.getJoinType() == RecursiveJoinType::TRACK_NONE) { |
| 47 | return mapOperator(logicalProbe.getChild(0).get()); |
| 48 | } |
| 49 | auto rel = logicalProbe.getRel(); |
| 50 | auto recursiveInfo = rel->getRecursiveInfo(); |
| 51 | std::vector<struct_field_idx_t> nodeFieldIndices; |
| 52 | std::vector<ft_col_idx_t> nodeTableColumnIndices; |
| 53 | std::shared_ptr<HashJoinSharedState> nodeBuildSharedState = nullptr; |
| 54 | std::unique_ptr<HashJoinBuild> nodeBuild = nullptr; |
| 55 | // Map build node property |
| 56 | if (logicalProbe.getNodeChild() != nullptr) { |
| 57 | auto nodeBuildPrevOperator = mapOperator(logicalProbe.getNodeChild().get()); |
| 58 | auto nodeBuildSchema = logicalProbe.getNodeChild()->getSchema(); |
| 59 | auto nodeKeys = expression_vector{recursiveInfo->node->getInternalID()}; |
| 60 | auto nodeKeyTypes = ExpressionUtil::getDataTypes(nodeKeys); |
| 61 | auto nodePayloads = |
| 62 | ExpressionUtil::excludeExpressions(nodeBuildSchema->getExpressionsInScope(), nodeKeys); |
| 63 | auto nodeBuildInfo = createHashBuildInfo(*nodeBuildSchema, nodeKeys, nodePayloads); |
| 64 | auto nodeHashTable = |
| 65 | std::make_unique<JoinHashTable>(*storage::MemoryManager::Get(*clientContext), |
| 66 | std::move(nodeKeyTypes), nodeBuildInfo.tableSchema.copy()); |
| 67 | nodeBuildSharedState = std::make_shared<HashJoinSharedState>(std::move(nodeHashTable)); |
| 68 | nodeBuild = make_unique<HashJoinBuild>(PhysicalOperatorType::HASH_JOIN_BUILD, |
| 69 | nodeBuildSharedState, std::move(nodeBuildInfo), std::move(nodeBuildPrevOperator), |
| 70 | getOperatorID(), std::make_unique<OPPrintInfo>()); |
| 71 | nodeBuild->setDescriptor(std::make_unique<ResultSetDescriptor>(nodeBuildSchema)); |
| 72 | auto [fieldIndices, columnIndices] = getColIdxToScan(nodePayloads, nodeKeys.size(), |
| 73 | ListType::getChildType( |
| 74 | StructType::getField(rel->getDataType(), InternalKeyword::NODES).getType())); |
| 75 | nodeFieldIndices = std::move(fieldIndices); |
| 76 | nodeTableColumnIndices = std::move(columnIndices); |
| 77 | } |
| 78 | std::vector<struct_field_idx_t> relFieldIndices; |
| 79 | std::vector<ft_col_idx_t> relTableColumnIndices; |
| 80 | std::shared_ptr<HashJoinSharedState> relBuildSharedState = nullptr; |
| 81 | std::unique_ptr<HashJoinBuild> relBuild = nullptr; |
| 82 | // Map build rel property |
| 83 | if (logicalProbe.getRelChild() != nullptr) { |
| 84 | auto relBuildPrvOperator = mapOperator(logicalProbe.getRelChild().get()); |
| 85 | auto relBuildSchema = logicalProbe.getRelChild()->getSchema(); |
| 86 | auto relKeys = expression_vector{recursiveInfo->rel->getInternalID()}; |
| 87 | auto relKeyTypes = ExpressionUtil::getDataTypes(relKeys); |
| 88 | auto relPayloads = |
| 89 | ExpressionUtil::excludeExpressions(relBuildSchema->getExpressionsInScope(), relKeys); |
| 90 | auto relBuildInfo = createHashBuildInfo(*relBuildSchema, relKeys, relPayloads); |
| 91 | auto relHashTable = |
| 92 | std::make_unique<JoinHashTable>(*storage::MemoryManager::Get(*clientContext), |
| 93 | std::move(relKeyTypes), relBuildInfo.tableSchema.copy()); |
| 94 | relBuildSharedState = std::make_shared<HashJoinSharedState>(std::move(relHashTable)); |
| 95 | relBuild = std::make_unique<HashJoinBuild>(PhysicalOperatorType::HASH_JOIN_BUILD, |
| 96 | relBuildSharedState, std::move(relBuildInfo), std::move(relBuildPrvOperator), |
| 97 | getOperatorID(), std::make_unique<OPPrintInfo>()); |
| 98 | relBuild->setDescriptor(std::make_unique<ResultSetDescriptor>(relBuildSchema)); |
| 99 | auto [fieldIndices, columnIndices] = getColIdxToScan(relPayloads, relKeys.size(), |
| 100 | ListType::getChildType( |
nothing calls this directly
no test coverage detected