cloud-fan commented on a change in pull request #35113:
URL: https://github.com/apache/spark/pull/35113#discussion_r779321985
##########
File path:
sql/core/src/test/scala/org/apache/spark/sql/execution/command/TestsV1AndV2Commands.scala
##########
@@ -28,14 +28,21 @@ import org.apache.spark.sql.internal.SQLConf
trait TestsV1AndV2Commands extends DDLCommandTestUtils {
private var _version: String = ""
override def commandVersion: String = _version
+ def runningV1Command: Boolean = commandVersion == "V1"
// Tests using V1 catalogs will run with `spark.sql.legacy.useV1Command` on
and off
// to test both V1 and V2 commands.
override def test(testName: String, testTags: Tag*)(testFun: => Any)
(implicit pos: Position): Unit = {
Seq(true, false).foreach { useV1Command =>
- _version = if (useV1Command) "V1" else "V2"
+ def setCommandVersion(): Unit = {
+ _version = if (useV1Command) "V1" else "V2"
+ }
+ setCommandVersion()
super.test(testName, testTags: _*) {
+ // Need to set command version inside this test function so that
+ // the correct command version is available in each test.
+ setCommandVersion()
Review comment:
sorry I'm confused. We set the version right before `super.test(....)`,
do you mean it's being set again during `super.test(....)`?
--
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]