diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/objects.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/objects.scala index ad93ef347a97..0fa29e87e5f3 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/objects.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/objects.scala @@ -235,8 +235,6 @@ object ObjectSerializerPruning extends Rule[LogicalPlan] { */ object ReassignLambdaVariableID extends Rule[LogicalPlan] { override def apply(plan: LogicalPlan): LogicalPlan = { - if (!SQLConf.get.getConf(SQLConf.OPTIMIZER_REASSIGN_LAMBDA_VARIABLE_ID)) return plan - // The original LambdaVariable IDs are all positive. To avoid conflicts, the new IDs are all // negative and starts from -1. var newId = 0L diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala index 6fde8ce9f7f3..9515861a01e4 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala @@ -234,13 +234,6 @@ object SQLConf { .stringConf .createOptional - val OPTIMIZER_REASSIGN_LAMBDA_VARIABLE_ID = - buildConf("spark.sql.optimizer.reassignLambdaVariableID.enabled") - .doc("When true, Spark optimizer reassigns per-query unique IDs to LambdaVariable, so that " + - "it's more likely to hit codegen cache.") - .booleanConf - .createWithDefault(true) - val DYNAMIC_PARTITION_PRUNING_ENABLED = buildConf("spark.sql.optimizer.dynamicPartitionPruning.enabled") .doc("When true, we will generate predicate for partition column when it's used as join key") diff --git a/sql/core/src/test/scala/org/apache/spark/sql/DatasetOptimizationSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/DatasetOptimizationSuite.scala index 892122b94b97..0ac99905f35f 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/DatasetOptimizationSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/DatasetOptimizationSuite.scala @@ -181,15 +181,6 @@ class DatasetOptimizationSuite extends QueryTest with SharedSparkSession { // codegen cache should work for Datasets of same type. val count3 = getCodegenCount() assert(count3 == count2) - - withSQLConf(SQLConf.OPTIMIZER_REASSIGN_LAMBDA_VARIABLE_ID.key -> "false") { - // trigger codegen for another Dataset of same type - createDataset().collect() - // with the rule disabled, codegen happens again for encoder serializer and encoder - // deserializer - val count4 = getCodegenCount() - assert(count4 == (count3 + 2)) - } } withClue("array type") {