jinchengchenghh commented on code in PR #11898:
URL: https://github.com/apache/gluten/pull/11898#discussion_r3057128640
##########
cpp/velox/substrait/SubstraitToVeloxPlan.cc:
##########
@@ -399,24 +399,27 @@ core::PlanNodePtr
SubstraitToVeloxPlanConverter::toVeloxPlan(const ::substrait::
} else if (
sJoin.has_advanced_extension() &&
SubstraitParser::configSetInOptimization(sJoin.advanced_extension(),
"isBHJ=")) {
+ auto isHashTableBuildOncePerExecutor =
+ SubstraitParser::configSetInOptimization(sJoin.advanced_extension(),
"isHashTableBuildOncePerExecutor=");
std::string hashTableId = sJoin.hashtableid();
std::shared_ptr<core::OpaqueHashTable> opaqueSharedHashTable = nullptr;
bool joinHasNullKeys = false;
- try {
- auto hashTableBuilder =
ObjectStore::retrieve<gluten::HashTableBuilder>(getJoin(hashTableId));
- joinHasNullKeys = hashTableBuilder->joinHasNullKeys();
- auto originalShared = hashTableBuilder->hashTable();
- opaqueSharedHashTable = std::shared_ptr<core::OpaqueHashTable>(
- originalShared,
reinterpret_cast<core::OpaqueHashTable*>(originalShared.get()));
-
- LOG(INFO) << "Successfully retrieved and aliased HashTable for reuse.
ID: " << hashTableId;
- } catch (const std::exception& e) {
- LOG(WARNING)
- << "Error retrieving HashTable from ObjectStore: " << e.what()
- << ". Falling back to building new table. To ensure correct results,
please verify that spark.gluten.velox.buildHashTableOncePerExecutor.enabled is
set to false.";
- opaqueSharedHashTable = nullptr;
+ if (isHashTableBuildOncePerExecutor) {
Review Comment:
Could you read the config from the member veloxCfg_ of SubstraitToVeloxPlan?
##########
cpp/velox/substrait/SubstraitToVeloxPlan.cc:
##########
@@ -399,24 +399,27 @@ core::PlanNodePtr
SubstraitToVeloxPlanConverter::toVeloxPlan(const ::substrait::
} else if (
sJoin.has_advanced_extension() &&
SubstraitParser::configSetInOptimization(sJoin.advanced_extension(),
"isBHJ=")) {
+ auto isHashTableBuildOncePerExecutor =
+ SubstraitParser::configSetInOptimization(sJoin.advanced_extension(),
"isHashTableBuildOncePerExecutor=");
std::string hashTableId = sJoin.hashtableid();
std::shared_ptr<core::OpaqueHashTable> opaqueSharedHashTable = nullptr;
bool joinHasNullKeys = false;
- try {
- auto hashTableBuilder =
ObjectStore::retrieve<gluten::HashTableBuilder>(getJoin(hashTableId));
- joinHasNullKeys = hashTableBuilder->joinHasNullKeys();
- auto originalShared = hashTableBuilder->hashTable();
- opaqueSharedHashTable = std::shared_ptr<core::OpaqueHashTable>(
- originalShared,
reinterpret_cast<core::OpaqueHashTable*>(originalShared.get()));
-
- LOG(INFO) << "Successfully retrieved and aliased HashTable for reuse.
ID: " << hashTableId;
- } catch (const std::exception& e) {
- LOG(WARNING)
- << "Error retrieving HashTable from ObjectStore: " << e.what()
- << ". Falling back to building new table. To ensure correct results,
please verify that spark.gluten.velox.buildHashTableOncePerExecutor.enabled is
set to false.";
- opaqueSharedHashTable = nullptr;
+ if (isHashTableBuildOncePerExecutor) {
+ try {
+ auto hashTableBuilder =
ObjectStore::retrieve<gluten::HashTableBuilder>(getJoin(hashTableId));
+ joinHasNullKeys = hashTableBuilder->joinHasNullKeys();
+ auto originalShared = hashTableBuilder->hashTable();
+ opaqueSharedHashTable = std::shared_ptr<core::OpaqueHashTable>(
+ originalShared,
reinterpret_cast<core::OpaqueHashTable*>(originalShared.get()));
+
+ LOG(INFO) << "Successfully retrieved and aliased HashTable for reuse.
ID: " << hashTableId;
+ } catch (const std::exception& e) {
+ LOG(ERROR)
Review Comment:
LOG(ERROR) does not throw exception, if the config is false, please
interrupt here. throw e. Could you not use try catch for normal execution path?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]