[GitHub] [spark] cloud-fan commented on a change in pull request #33736: [SPARK-35991][SQL] Add PlanStability suite for TPCH
cloud-fan commented on a change in pull request #33736: URL: https://github.com/apache/spark/pull/33736#discussion_r690045699 ## File path: sql/core/src/test/scala/org/apache/spark/sql/TPCDSBase.scala ## @@ -79,6 +79,17 @@ trait TPCDSBase extends SharedSparkSession with TPCDSSchema { """.stripMargin) } + def createTables(): Unit = { Review comment: where else do we call this method? -- 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: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org
[GitHub] [spark] cloud-fan commented on a change in pull request #33736: [SPARK-35991][SQL] Add PlanStability suite for TPCH
cloud-fan commented on a change in pull request #33736: URL: https://github.com/apache/spark/pull/33736#discussion_r690046057 ## File path: sql/core/src/test/scala/org/apache/spark/sql/PlanStabilitySuite.scala ## @@ -333,3 +340,22 @@ class TPCDSModifiedPlanStabilityWithStatsSuite extends PlanStabilitySuite { } } } + +abstract class TPCHPlanStabilitySuiteBase extends PlanStabilitySuite { Review comment: why add an abstract class that has only one child? -- 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: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org
[GitHub] [spark] cloud-fan commented on a change in pull request #33736: [SPARK-35991][SQL] Add PlanStability suite for TPCH
cloud-fan commented on a change in pull request #33736: URL: https://github.com/apache/spark/pull/33736#discussion_r690234889 ## File path: sql/core/src/test/scala/org/apache/spark/sql/PlanStabilitySuite.scala ## @@ -66,7 +66,7 @@ import org.apache.spark.sql.internal.SQLConf * }}} */ // scalastyle:on line.size.limit -trait PlanStabilitySuite extends TPCDSBase with DisableAdaptiveExecutionSuite { +trait PlanStabilitySuite extends TPCDSBase with TPCHBase with DisableAdaptiveExecutionSuite { Review comment: It's a bit weird that `TPCDSBase` and `TPCHBase` are not at the same level (`TPCDSBase` is much more complicated). Can we do a bit more refactoring? Probably pull out some logic (e.g. `createTable`) from `TPCDSBase` to `PlanStabilitySuite` or a new `trait`. -- 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: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org
[GitHub] [spark] cloud-fan commented on a change in pull request #33736: [SPARK-35991][SQL] Add PlanStability suite for TPCH
cloud-fan commented on a change in pull request #33736: URL: https://github.com/apache/spark/pull/33736#discussion_r691305225 ## File path: sql/core/src/test/scala/org/apache/spark/sql/PlanSuiteBase.scala ## @@ -0,0 +1,54 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + *http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql + +import org.apache.spark.sql.internal.SQLConf +import org.apache.spark.sql.test.SharedSparkSession + +trait PlanSuiteBase extends SharedSparkSession { + + private val originalCBCEnabled = conf.cboEnabled Review comment: ```suggestion private val originalCBOEnabled = conf.cboEnabled ``` -- 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: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org
[GitHub] [spark] cloud-fan commented on a change in pull request #33736: [SPARK-35991][SQL] Add PlanStability suite for TPCH
cloud-fan commented on a change in pull request #33736: URL: https://github.com/apache/spark/pull/33736#discussion_r691307948 ## File path: sql/core/src/test/scala/org/apache/spark/sql/TPCDSBase.scala ## @@ -102,15 +88,9 @@ trait TPCDSBase extends SharedSparkSession with TPCDSSchema { } } - override def afterAll(): Unit = { -conf.setConf(SQLConf.CBO_ENABLED, originalCBCEnabled) -conf.setConf(SQLConf.PLAN_STATS_ENABLED, originalPlanStatsEnabled) -conf.setConf(SQLConf.JOIN_REORDER_ENABLED, originalJoinReorderEnabled) + override def dropTables(): Unit = { tableNames.foreach { tableName => spark.sessionState.catalog.dropTable(TableIdentifier(tableName), true, true) } -super.afterAll() } - - protected def injectStats: Boolean = false Review comment: where is `injectStats` defined now? -- 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: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org
[GitHub] [spark] cloud-fan commented on a change in pull request #33736: [SPARK-35991][SQL] Add PlanStability suite for TPCH
cloud-fan commented on a change in pull request #33736: URL: https://github.com/apache/spark/pull/33736#discussion_r691305225 ## File path: sql/core/src/test/scala/org/apache/spark/sql/PlanSuiteBase.scala ## @@ -0,0 +1,54 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + *http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql + +import org.apache.spark.sql.internal.SQLConf +import org.apache.spark.sql.test.SharedSparkSession + +trait PlanSuiteBase extends SharedSparkSession { + + private val originalCBCEnabled = conf.cboEnabled Review comment: ```suggestion private val originalCBOEnabled = conf.cboEnabled ``` ## File path: sql/core/src/test/scala/org/apache/spark/sql/TPCDSBase.scala ## @@ -102,15 +88,9 @@ trait TPCDSBase extends SharedSparkSession with TPCDSSchema { } } - override def afterAll(): Unit = { -conf.setConf(SQLConf.CBO_ENABLED, originalCBCEnabled) -conf.setConf(SQLConf.PLAN_STATS_ENABLED, originalPlanStatsEnabled) -conf.setConf(SQLConf.JOIN_REORDER_ENABLED, originalJoinReorderEnabled) + override def dropTables(): Unit = { tableNames.foreach { tableName => spark.sessionState.catalog.dropTable(TableIdentifier(tableName), true, true) } -super.afterAll() } - - protected def injectStats: Boolean = false Review comment: where is `injectStats` defined now? -- 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: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org
[GitHub] [spark] cloud-fan commented on a change in pull request #33736: [SPARK-35991][SQL] Add PlanStability suite for TPCH
cloud-fan commented on a change in pull request #33736: URL: https://github.com/apache/spark/pull/33736#discussion_r694054229 ## File path: sql/core/src/test/scala/org/apache/spark/sql/TPCBase.scala ## @@ -0,0 +1,53 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + *http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql + +import org.apache.spark.SparkConf +import org.apache.spark.sql.internal.SQLConf +import org.apache.spark.sql.test.SharedSparkSession + +trait TPCBase extends SharedSparkSession { + + protected def injectStats: Boolean = false + + override def sparkConf: SparkConf = { Review comment: nit: we should not remove the `protected` modifier here. It forces all the traits/classes extending this trait to also remove the `protected` modifier, which is an unnecessary breaking. See https://github.com/apache/spark/pull/33736/files#diff-67f98139e0b98db9e0e896ffbfe9d4a761bd579c8047c304bdca12906c476384L76 -- 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: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org