Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions cpp/velox/substrait/SubstraitToVeloxPlan.cc
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,21 @@ core::PlanNodePtr SubstraitToVeloxPlanConverter::toVeloxPlan(const ::substrait::
} else if (
sJoin.has_advanced_extension() &&
SubstraitParser::configSetInOptimization(sJoin.advanced_extension(), "isBHJ=")) {
const std::string hashTableId = sJoin.hashtableid();
bool useHashTableCache = false;
if (!hashTableId.empty()) {
try {
const auto handle = getJoin(hashTableId);
Comment on lines +461 to +465
if (handle != 0) {
auto hashTableBuilder = ObjectStore::retrieve<gluten::HashTableBuilder>(handle);
useHashTableCache = (hashTableBuilder != nullptr);
Comment on lines +464 to +468
}
} catch (const std::exception& e) {
LOG(WARNING) << "Failed to retrieve pre-built HashTableBuilder for cache key: " << hashTableId
<< ", error: " << e.what() << ". Disable hash table cache and build a new table.";
}
}
Comment on lines +461 to +474

// Create HashJoinNode node
return std::make_shared<core::HashJoinNode>(
nextPlanNodeId(),
Expand All @@ -469,11 +484,11 @@ core::PlanNodePtr SubstraitToVeloxPlanConverter::toVeloxPlan(const ::substrait::
leftNode,
rightNode,
getJoinOutputType(leftNode, rightNode, joinType),
true,
useHashTableCache,
false,
false,
nullptr,
sJoin.hashtableid());
useHashTableCache ? hashTableId : std::string());
} else {
// Create HashJoinNode node
return std::make_shared<core::HashJoinNode>(
Expand Down
Loading