diff --git a/gluten-substrait/src/main/scala/org/apache/spark/sql/execution/GlutenAutoAdjustStageResourceProfile.scala b/gluten-substrait/src/main/scala/org/apache/spark/sql/execution/GlutenAutoAdjustStageResourceProfile.scala index ac93301372cf..6698a61e4a73 100644 --- a/gluten-substrait/src/main/scala/org/apache/spark/sql/execution/GlutenAutoAdjustStageResourceProfile.scala +++ b/gluten-substrait/src/main/scala/org/apache/spark/sql/execution/GlutenAutoAdjustStageResourceProfile.scala @@ -58,6 +58,12 @@ case class GlutenAutoAdjustStageResourceProfile(glutenConf: GlutenConfig, spark: if (!SQLConf.get.adaptiveExecutionEnabled) { return plan } + if (!sparkConf.getBoolean(GlutenCoreConfig.SPARK_OFFHEAP_ENABLED_KEY, defaultValue = false)) { + logWarning( + s"${GlutenCoreConfig.SPARK_OFFHEAP_ENABLED_KEY} is not enabled, " + + s"Gluten auto adjust stage resource profile will not work.") + return plan + } // Starting here, the resource profile may differ between stages. Configure resource settings // using the default profile to prevent any impact from the previous stage. If a new resource // profile is applied, the settings will be updated accordingly.