diff --git a/cpp/velox/compute/WholeStageResultIterator.cc b/cpp/velox/compute/WholeStageResultIterator.cc index 8439545ca382..bca6756964fc 100644 --- a/cpp/velox/compute/WholeStageResultIterator.cc +++ b/cpp/velox/compute/WholeStageResultIterator.cc @@ -321,7 +321,8 @@ void WholeStageResultIterator::collectMetrics() { return; } - if (veloxCfg_->get(kDebugModeEnabled, false)) { + if (veloxCfg_->get(kDebugModeEnabled, false) || + veloxCfg_->get(kShowTaskMetricsWhenFinished, kShowTaskMetricsWhenFinishedDefault)) { auto planWithStats = velox::exec::printPlanWithStats(*veloxPlan_.get(), task_->taskStats(), true); std::ostringstream oss; oss << "Native Plan with stats for: " << taskInfo_; diff --git a/cpp/velox/config/VeloxConfig.h b/cpp/velox/config/VeloxConfig.h index 7a96f03f4985..65c7cb61d94d 100644 --- a/cpp/velox/config/VeloxConfig.h +++ b/cpp/velox/config/VeloxConfig.h @@ -59,6 +59,9 @@ const std::string kBloomFilterNumBits = "spark.gluten.sql.columnar.backend.velox const std::string kBloomFilterMaxNumBits = "spark.gluten.sql.columnar.backend.velox.bloomFilter.maxNumBits"; const std::string kVeloxSplitPreloadPerDriver = "spark.gluten.sql.columnar.backend.velox.SplitPreloadPerDriver"; +const std::string kShowTaskMetricsWhenFinished = "spark.gluten.sql.columnar.backend.velox.showTaskMetricsWhenFinished"; +const bool kShowTaskMetricsWhenFinishedDefault = false; + const std::string kEnableUserExceptionStacktrace = "spark.gluten.sql.columnar.backend.velox.enableUserExceptionStacktrace"; const bool kEnableUserExceptionStacktraceDefault = true; diff --git a/shims/common/src/main/scala/org/apache/gluten/GlutenConfig.scala b/shims/common/src/main/scala/org/apache/gluten/GlutenConfig.scala index 4cf81af5ad88..0c3cefe35cb1 100644 --- a/shims/common/src/main/scala/org/apache/gluten/GlutenConfig.scala +++ b/shims/common/src/main/scala/org/apache/gluten/GlutenConfig.scala @@ -1692,6 +1692,13 @@ object GlutenConfig { .booleanConf .createWithDefault(true) + val COLUMNAR_VELOX_SHOW_TASK_METRICS_WHEN_FINISHED = + buildConf("spark.gluten.sql.columnar.backend.velox.showTaskMetricsWhenFinished") + .internal() + .doc("Show velox full task metrics when finished.") + .booleanConf + .createWithDefault(false) + val COLUMNAR_VELOX_MEMORY_USE_HUGE_PAGES = buildConf("spark.gluten.sql.columnar.backend.velox.memoryUseHugePages") .internal()