Skip to content

Commit cdcb55a

Browse files
committed
address comments
1 parent 7392e00 commit cdcb55a

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/DateTimeRebaseBenchmark.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import org.apache.spark.sql.DataFrame
2525
import org.apache.spark.sql.catalyst.util.DateTimeConstants.SECONDS_PER_DAY
2626
import org.apache.spark.sql.catalyst.util.DateTimeTestUtils.{withDefaultTimeZone, LA}
2727
import org.apache.spark.sql.internal.SQLConf
28+
import org.apache.spark.sql.internal.SQLConf.LegacyBehaviorPolicy._
2829
import org.apache.spark.sql.internal.SQLConf.ParquetOutputTimestampType
2930

3031
object DateTime extends Enumeration {
@@ -161,10 +162,10 @@ object DateTimeRebaseBenchmark extends SqlBasedBenchmark {
161162
Seq(true, false).foreach { modernDates =>
162163
Seq(false, true).foreach { rebase =>
163164
benchmark.addCase(caseName(modernDates, dateTime, Some(rebase)), 1) { _ =>
164-
val mode = if (rebase) "LEGACY" else "CORRECTED"
165+
val mode = if (rebase) LEGACY else CORRECTED
165166
withSQLConf(
166167
SQLConf.PARQUET_OUTPUT_TIMESTAMP_TYPE.key -> getOutputType(dateTime),
167-
SQLConf.LEGACY_PARQUET_REBASE_MODE_IN_WRITE.key -> mode) {
168+
SQLConf.LEGACY_PARQUET_REBASE_MODE_IN_WRITE.key -> mode.toString) {
168169
genDF(rowsNum, dateTime, modernDates)
169170
.write
170171
.mode("overwrite")

sql/hive/src/test/scala/org/apache/spark/sql/sources/HadoopFsRelationTest.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import org.apache.spark.sql.execution.DataSourceScanExec
2929
import org.apache.spark.sql.execution.datasources._
3030
import org.apache.spark.sql.hive.test.TestHiveSingleton
3131
import org.apache.spark.sql.internal.SQLConf
32+
import org.apache.spark.sql.internal.SQLConf.LegacyBehaviorPolicy._
3233
import org.apache.spark.sql.test.SQLTestUtils
3334
import org.apache.spark.sql.types._
3435

@@ -163,8 +164,8 @@ abstract class HadoopFsRelationTest extends QueryTest with SQLTestUtils with Tes
163164
val df = spark.createDataFrame(rdd, schema).orderBy("index").coalesce(1)
164165

165166
withSQLConf(
166-
SQLConf.LEGACY_PARQUET_REBASE_MODE_IN_WRITE.key -> "CORRECTED",
167-
SQLConf.LEGACY_AVRO_REBASE_MODE_IN_WRITE.key -> "CORRECTED") {
167+
SQLConf.LEGACY_PARQUET_REBASE_MODE_IN_WRITE.key -> CORRECTED.toString,
168+
SQLConf.LEGACY_AVRO_REBASE_MODE_IN_WRITE.key -> CORRECTED.toString) {
168169
df.write
169170
.mode("overwrite")
170171
.format(dataSourceName)

0 commit comments

Comments
 (0)