|
| 1 | +/* |
| 2 | + * Copyright (c) Facebook, Inc. and its affiliates. |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + * you may not use this file except in compliance with the License. |
| 6 | + * You may obtain a copy of the License at |
| 7 | + * |
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * |
| 10 | + * Unless required by applicable law or agreed to in writing, software |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + * See the License for the specific language governing permissions and |
| 14 | + * limitations under the License. |
| 15 | + */ |
| 16 | + |
| 17 | +#include "velox/tool/trace/IndexLookupJoinReplayer.h" |
| 18 | +#include "velox/exec/TraceUtil.h" |
| 19 | +#include "velox/exec/tests/utils/PlanBuilder.h" |
| 20 | + |
| 21 | +using namespace facebook::velox; |
| 22 | +using namespace facebook::velox::exec; |
| 23 | +using namespace facebook::velox::exec::test; |
| 24 | + |
| 25 | +namespace facebook::velox::tool::trace { |
| 26 | +core::PlanNodePtr IndexLookupJoinReplayer::createPlanNode( |
| 27 | + const core::PlanNode* node, |
| 28 | + const core::PlanNodeId& nodeId, |
| 29 | + const core::PlanNodePtr& source) const { |
| 30 | + const auto* indexLookupJoinNode = |
| 31 | + dynamic_cast<const core::IndexLookupJoinNode*>(node); |
| 32 | + VELOX_CHECK_NOT_NULL(indexLookupJoinNode); |
| 33 | + return std::make_shared<core::IndexLookupJoinNode>( |
| 34 | + nodeId, |
| 35 | + indexLookupJoinNode->joinType(), |
| 36 | + indexLookupJoinNode->leftKeys(), |
| 37 | + indexLookupJoinNode->rightKeys(), |
| 38 | + indexLookupJoinNode->joinConditions(), |
| 39 | + source, // Probe side |
| 40 | + indexLookupJoinNode->lookupSource(), // Index side |
| 41 | + indexLookupJoinNode->outputType()); |
| 42 | +} |
| 43 | +} // namespace facebook::velox::tool::trace |
0 commit comments