Skip to content

Commit

Permalink
fix scala-2.13.6 compile
Browse files Browse the repository at this point in the history
  • Loading branch information
LuciferYang committed May 24, 2021
1 parent 1530876 commit b46c58a
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 14 deletions.
2 changes: 1 addition & 1 deletion core/src/main/scala/org/apache/spark/SparkContext.scala
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ class SparkContext(config: SparkConf) extends Logging {

// Thread Local variable that can be used by users to pass information down the stack
protected[spark] val localProperties = new InheritableThreadLocal[Properties] {
override protected def childValue(parent: Properties): Properties = {
override def childValue(parent: Properties): Properties = {
// Note: make a clone such that changes in the parent properties aren't reflected in
// the those of the children threads, which has confusing semantics (SPARK-10563).
Utils.cloneProperties(parent)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ private[spark] class DiskBlockObjectWriter(
}

// For testing
private[spark] override def flush(): Unit = {
override def flush(): Unit = {
objOut.flush()
bs.flush()
}
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3342,7 +3342,7 @@
<profile>
<id>scala-2.13</id>
<properties>
<scala.version>2.13.5</scala.version>
<scala.version>2.13.6</scala.version>
<scala.binary.version>2.13</scala.binary.version>
</properties>
<dependencyManagement>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ class Iso8601DateFormatter(
try {
formatter
} catch checkLegacyFormatter(pattern, legacyFormatter.validatePatternString)
()
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ class Iso8601TimestampFormatter(
try {
formatter
} catch checkLegacyFormatter(pattern, legacyFormatter.validatePatternString)
()
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ object EpochTracker {
// update the underlying AtomicLong as it finishes epochs. Other code should only read the value.
private val currentEpoch: InheritableThreadLocal[AtomicLong] = {
new InheritableThreadLocal[AtomicLong] {
override protected def childValue(parent: AtomicLong): AtomicLong = {
override def childValue(parent: AtomicLong): AtomicLong = {
// Note: make another instance so that changes in the parent epoch aren't reflected in
// those in the children threads. This is required at `ContinuousCoalesceRDD`.
new AtomicLong(parent.get)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,13 +222,13 @@ class SQLQueryTestSuite extends QueryTest with SharedSparkSession with SQLHelper
// Create a test case to ignore this case.
ignore(testCase.name) { /* Do nothing */ }
} else testCase match {
case udfTestCase: UDFTest
case udfTestCase: SQLQueryTestSuite#UDFTest
if udfTestCase.udf.isInstanceOf[TestPythonUDF] && !shouldTestPythonUDFs =>
ignore(s"${testCase.name} is skipped because " +
s"[$pythonExec] and/or pyspark were not available.") {
/* Do nothing */
}
case udfTestCase: UDFTest
case udfTestCase: SQLQueryTestSuite#UDFTest
if udfTestCase.udf.isInstanceOf[TestScalarPandasUDF] && !shouldTestScalarPandasUDFs =>
ignore(s"${testCase.name} is skipped because pyspark," +
s"pandas and/or pyarrow were not available in [$pythonExec].") {
Expand Down Expand Up @@ -354,21 +354,21 @@ class SQLQueryTestSuite extends QueryTest with SharedSparkSession with SQLHelper
val localSparkSession = spark.newSession()

testCase match {
case udfTestCase: UDFTest =>
case udfTestCase: SQLQueryTestSuite#UDFTest =>
registerTestUDF(udfTestCase.udf, localSparkSession)
case _ =>
}

testCase match {
case _: PgSQLTest =>
case _: SQLQueryTestSuite#PgSQLTest =>
// booleq/boolne used by boolean.sql
localSparkSession.udf.register("booleq", (b1: Boolean, b2: Boolean) => b1 == b2)
localSparkSession.udf.register("boolne", (b1: Boolean, b2: Boolean) => b1 != b2)
// vol used by boolean.sql and case.sql.
localSparkSession.udf.register("vol", (s: String) => s)
localSparkSession.conf.set(SQLConf.ANSI_ENABLED.key, true)
localSparkSession.conf.set(SQLConf.LEGACY_INTERVAL_ENABLED.key, true)
case _: AnsiTest =>
case _: SQLQueryTestSuite#AnsiTest =>
localSparkSession.conf.set(SQLConf.ANSI_ENABLED.key, true)
case _ =>
}
Expand Down Expand Up @@ -411,10 +411,10 @@ class SQLQueryTestSuite extends QueryTest with SharedSparkSession with SQLHelper
// See also SPARK-29127. It is difficult to see the version information in the failed test
// cases so the version information related to Python was also added.
val clue = testCase match {
case udfTestCase: UDFTest
case udfTestCase: SQLQueryTestSuite#UDFTest
if udfTestCase.udf.isInstanceOf[TestPythonUDF] && shouldTestPythonUDFs =>
s"${testCase.name}${System.lineSeparator()}Python: $pythonVer${System.lineSeparator()}"
case udfTestCase: UDFTest
case udfTestCase: SQLQueryTestSuite#UDFTest
if udfTestCase.udf.isInstanceOf[TestScalarPandasUDF] && shouldTestScalarPandasUDFs =>
s"${testCase.name}${System.lineSeparator()}" +
s"Python: $pythonVer Pandas: $pandasVer PyArrow: $pyarrowVer${System.lineSeparator()}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ case class NoCloseColumnVector(wrapped: ColumnVector) extends ColumnVector(wrapp

override def getBinary(rowId: Int): Array[Byte] = wrapped.getBinary(rowId)

override protected def getChild(ordinal: Int): ColumnVector = wrapped.getChild(ordinal)
override def getChild(ordinal: Int): ColumnVector = wrapped.getChild(ordinal)
}

trait ColumnarExpression extends Expression with Serializable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,10 @@ class ThriftServerQueryTestSuite extends SQLQueryTestSuite with SharedThriftServ
}

testCase match {
case _: PgSQLTest =>
case _: SQLQueryTestSuite#PgSQLTest =>
statement.execute(s"SET ${SQLConf.ANSI_ENABLED.key} = true")
statement.execute(s"SET ${SQLConf.LEGACY_INTERVAL_ENABLED.key} = true")
case _: AnsiTest =>
case _: SQLQueryTestSuite#AnsiTest =>
statement.execute(s"SET ${SQLConf.ANSI_ENABLED.key} = true")
case _ =>
statement.execute(s"SET ${SQLConf.ANSI_ENABLED.key} = false")
Expand Down

0 comments on commit b46c58a

Please sign in to comment.