spark git commit: [SPARK-24950][SQL] DateTimeUtilsSuite daysToMillis and millisToDays fails w/java 8 181-b13

2018-08-09 Thread srowen
Repository: spark
Updated Branches:
  refs/heads/branch-2.1 b2e0f68f6 -> 42229430f


[SPARK-24950][SQL] DateTimeUtilsSuite daysToMillis and millisToDays fails 
w/java 8 181-b13

- Update DateTimeUtilsSuite so that when testing roundtripping in daysToMillis 
and millisToDays multiple skipdates can be specified.
- Updated test so that both new years eve 2014 and new years day 2015 are 
skipped for kiribati time zones.  This is necessary as java versions pre 
181-b13 considered new years day 2015 to be skipped while susequent versions 
corrected this to new years eve.

Unit tests

Author: Chris Martin 

Closes #21901 from d80tb7/SPARK-24950_datetimeUtilsSuite_failures.

(cherry picked from commit c5b8d54c61780af6e9e157e6c855718df972efad)
Signed-off-by: Sean Owen 


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/42229430
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/42229430
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/42229430

Branch: refs/heads/branch-2.1
Commit: 42229430f94ba33fb614628b9438e699b4922099
Parents: b2e0f68
Author: Chris Martin 
Authored: Sat Jul 28 10:40:10 2018 -0500
Committer: Sean Owen 
Committed: Thu Aug 9 17:31:10 2018 -0500

--
 .../sql/catalyst/util/DateTimeUtilsSuite.scala  | 20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/spark/blob/42229430/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/DateTimeUtilsSuite.scala
--
diff --git 
a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/DateTimeUtilsSuite.scala
 
b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/DateTimeUtilsSuite.scala
index e0a9a0c..a62a3d0 100644
--- 
a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/DateTimeUtilsSuite.scala
+++ 
b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/DateTimeUtilsSuite.scala
@@ -538,19 +538,19 @@ class DateTimeUtilsSuite extends SparkFunSuite {
 
   test("daysToMillis and millisToDays") {
 // There are some days are skipped entirely in some timezone, skip them 
here.
-val skipped_days = Map[String, Int](
-  "Kwajalein" -> 8632,
-  "Pacific/Apia" -> 15338,
-  "Pacific/Enderbury" -> 9131,
-  "Pacific/Fakaofo" -> 15338,
-  "Pacific/Kiritimati" -> 9131,
-  "Pacific/Kwajalein" -> 8632,
-  "MIT" -> 15338)
+val skipped_days = Map[String, Set[Int]](
+  "Kwajalein" -> Set(8632),
+  "Pacific/Apia" -> Set(15338),
+  "Pacific/Enderbury" -> Set(9130, 9131),
+  "Pacific/Fakaofo" -> Set(15338),
+  "Pacific/Kiritimati" -> Set(9130, 9131),
+  "Pacific/Kwajalein" -> Set(8632),
+  "MIT" -> Set(15338))
 for (tz <- DateTimeTestUtils.ALL_TIMEZONES) {
   DateTimeTestUtils.withDefaultTimeZone(tz) {
-val skipped = skipped_days.getOrElse(tz.getID, Int.MinValue)
+val skipped = skipped_days.getOrElse(tz.getID, Set.empty)
 (-2 to 2).foreach { d =>
-  if (d != skipped) {
+  if (!skipped.contains(d)) {
 assert(millisToDays(daysToMillis(d)) === d,
   s"Round trip of ${d} did not work in tz ${tz}")
   }


-
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org



spark git commit: [SPARK-24950][SQL] DateTimeUtilsSuite daysToMillis and millisToDays fails w/java 8 181-b13

2018-08-09 Thread srowen
Repository: spark
Updated Branches:
  refs/heads/branch-2.3 9bfc55b1b -> b426ec583


[SPARK-24950][SQL] DateTimeUtilsSuite daysToMillis and millisToDays fails 
w/java 8 181-b13

## What changes were proposed in this pull request?

- Update DateTimeUtilsSuite so that when testing roundtripping in daysToMillis 
and millisToDays multiple skipdates can be specified.
- Updated test so that both new years eve 2014 and new years day 2015 are 
skipped for kiribati time zones.  This is necessary as java versions pre 
181-b13 considered new years day 2015 to be skipped while susequent versions 
corrected this to new years eve.

## How was this patch tested?
Unit tests

Author: Chris Martin 

Closes #21901 from d80tb7/SPARK-24950_datetimeUtilsSuite_failures.

(cherry picked from commit c5b8d54c61780af6e9e157e6c855718df972efad)
Signed-off-by: Sean Owen 


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/b426ec58
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/b426ec58
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/b426ec58

Branch: refs/heads/branch-2.3
Commit: b426ec583fb5176461c5b0c7112d2194af66d93d
Parents: 9bfc55b
Author: Chris Martin 
Authored: Sat Jul 28 10:40:10 2018 -0500
Committer: Sean Owen 
Committed: Thu Aug 9 17:24:24 2018 -0500

--
 .../sql/catalyst/util/DateTimeUtilsSuite.scala  | 20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/spark/blob/b426ec58/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/DateTimeUtilsSuite.scala
--
diff --git 
a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/DateTimeUtilsSuite.scala
 
b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/DateTimeUtilsSuite.scala
index 625ff38..b025b85 100644
--- 
a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/DateTimeUtilsSuite.scala
+++ 
b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/DateTimeUtilsSuite.scala
@@ -650,18 +650,18 @@ class DateTimeUtilsSuite extends SparkFunSuite {
 assert(daysToMillis(16800, TimeZoneGMT) === c.getTimeInMillis)
 
 // There are some days are skipped entirely in some timezone, skip them 
here.
-val skipped_days = Map[String, Int](
-  "Kwajalein" -> 8632,
-  "Pacific/Apia" -> 15338,
-  "Pacific/Enderbury" -> 9131,
-  "Pacific/Fakaofo" -> 15338,
-  "Pacific/Kiritimati" -> 9131,
-  "Pacific/Kwajalein" -> 8632,
-  "MIT" -> 15338)
+val skipped_days = Map[String, Set[Int]](
+  "Kwajalein" -> Set(8632),
+  "Pacific/Apia" -> Set(15338),
+  "Pacific/Enderbury" -> Set(9130, 9131),
+  "Pacific/Fakaofo" -> Set(15338),
+  "Pacific/Kiritimati" -> Set(9130, 9131),
+  "Pacific/Kwajalein" -> Set(8632),
+  "MIT" -> Set(15338))
 for (tz <- DateTimeTestUtils.ALL_TIMEZONES) {
-  val skipped = skipped_days.getOrElse(tz.getID, Int.MinValue)
+  val skipped = skipped_days.getOrElse(tz.getID, Set.empty)
   (-2 to 2).foreach { d =>
-if (d != skipped) {
+if (!skipped.contains(d)) {
   assert(millisToDays(daysToMillis(d, tz), tz) === d,
 s"Round trip of ${d} did not work in tz ${tz}")
 }


-
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org



spark git commit: [SPARK-24950][SQL] DateTimeUtilsSuite daysToMillis and millisToDays fails w/java 8 181-b13

2018-08-09 Thread srowen
Repository: spark
Updated Branches:
  refs/heads/branch-2.2 53ac8504b -> b283c1f05


[SPARK-24950][SQL] DateTimeUtilsSuite daysToMillis and millisToDays fails 
w/java 8 181-b13

## What changes were proposed in this pull request?

- Update DateTimeUtilsSuite so that when testing roundtripping in daysToMillis 
and millisToDays multiple skipdates can be specified.
- Updated test so that both new years eve 2014 and new years day 2015 are 
skipped for kiribati time zones.  This is necessary as java versions pre 
181-b13 considered new years day 2015 to be skipped while susequent versions 
corrected this to new years eve.

## How was this patch tested?
Unit tests

Author: Chris Martin 

Closes #21901 from d80tb7/SPARK-24950_datetimeUtilsSuite_failures.

(cherry picked from commit c5b8d54c61780af6e9e157e6c855718df972efad)
Signed-off-by: Sean Owen 


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/b283c1f0
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/b283c1f0
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/b283c1f0

Branch: refs/heads/branch-2.2
Commit: b283c1f055521e4090a9829924e5c63810bb0c89
Parents: 53ac850
Author: Chris Martin 
Authored: Sat Jul 28 10:40:10 2018 -0500
Committer: Sean Owen 
Committed: Thu Aug 9 17:24:43 2018 -0500

--
 .../sql/catalyst/util/DateTimeUtilsSuite.scala  | 20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/spark/blob/b283c1f0/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/DateTimeUtilsSuite.scala
--
diff --git 
a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/DateTimeUtilsSuite.scala
 
b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/DateTimeUtilsSuite.scala
index c8cf16d..deaf2f9 100644
--- 
a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/DateTimeUtilsSuite.scala
+++ 
b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/DateTimeUtilsSuite.scala
@@ -580,18 +580,18 @@ class DateTimeUtilsSuite extends SparkFunSuite {
 assert(daysToMillis(16800, TimeZoneGMT) === c.getTimeInMillis)
 
 // There are some days are skipped entirely in some timezone, skip them 
here.
-val skipped_days = Map[String, Int](
-  "Kwajalein" -> 8632,
-  "Pacific/Apia" -> 15338,
-  "Pacific/Enderbury" -> 9131,
-  "Pacific/Fakaofo" -> 15338,
-  "Pacific/Kiritimati" -> 9131,
-  "Pacific/Kwajalein" -> 8632,
-  "MIT" -> 15338)
+val skipped_days = Map[String, Set[Int]](
+  "Kwajalein" -> Set(8632),
+  "Pacific/Apia" -> Set(15338),
+  "Pacific/Enderbury" -> Set(9130, 9131),
+  "Pacific/Fakaofo" -> Set(15338),
+  "Pacific/Kiritimati" -> Set(9130, 9131),
+  "Pacific/Kwajalein" -> Set(8632),
+  "MIT" -> Set(15338))
 for (tz <- DateTimeTestUtils.ALL_TIMEZONES) {
-  val skipped = skipped_days.getOrElse(tz.getID, Int.MinValue)
+  val skipped = skipped_days.getOrElse(tz.getID, Set.empty)
   (-2 to 2).foreach { d =>
-if (d != skipped) {
+if (!skipped.contains(d)) {
   assert(millisToDays(daysToMillis(d, tz), tz) === d,
 s"Round trip of ${d} did not work in tz ${tz}")
 }


-
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org



spark git commit: [SPARK-24950][SQL] DateTimeUtilsSuite daysToMillis and millisToDays fails w/java 8 181-b13

2018-07-28 Thread srowen
Repository: spark
Updated Branches:
  refs/heads/master c6a3db2fb -> c5b8d54c6


[SPARK-24950][SQL] DateTimeUtilsSuite daysToMillis and millisToDays fails 
w/java 8 181-b13

## What changes were proposed in this pull request?

- Update DateTimeUtilsSuite so that when testing roundtripping in daysToMillis 
and millisToDays multiple skipdates can be specified.
- Updated test so that both new years eve 2014 and new years day 2015 are 
skipped for kiribati time zones.  This is necessary as java versions pre 
181-b13 considered new years day 2015 to be skipped while susequent versions 
corrected this to new years eve.

## How was this patch tested?
Unit tests

Author: Chris Martin 

Closes #21901 from d80tb7/SPARK-24950_datetimeUtilsSuite_failures.


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/c5b8d54c
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/c5b8d54c
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/c5b8d54c

Branch: refs/heads/master
Commit: c5b8d54c61780af6e9e157e6c855718df972efad
Parents: c6a3db2
Author: Chris Martin 
Authored: Sat Jul 28 10:40:10 2018 -0500
Committer: Sean Owen 
Committed: Sat Jul 28 10:40:10 2018 -0500

--
 .../sql/catalyst/util/DateTimeUtilsSuite.scala  | 20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/spark/blob/c5b8d54c/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/DateTimeUtilsSuite.scala
--
diff --git 
a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/DateTimeUtilsSuite.scala
 
b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/DateTimeUtilsSuite.scala
index cbf6106..2423668 100644
--- 
a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/DateTimeUtilsSuite.scala
+++ 
b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/DateTimeUtilsSuite.scala
@@ -662,18 +662,18 @@ class DateTimeUtilsSuite extends SparkFunSuite {
 assert(daysToMillis(16800, TimeZoneGMT) === c.getTimeInMillis)
 
 // There are some days are skipped entirely in some timezone, skip them 
here.
-val skipped_days = Map[String, Int](
-  "Kwajalein" -> 8632,
-  "Pacific/Apia" -> 15338,
-  "Pacific/Enderbury" -> 9131,
-  "Pacific/Fakaofo" -> 15338,
-  "Pacific/Kiritimati" -> 9131,
-  "Pacific/Kwajalein" -> 8632,
-  "MIT" -> 15338)
+val skipped_days = Map[String, Set[Int]](
+  "Kwajalein" -> Set(8632),
+  "Pacific/Apia" -> Set(15338),
+  "Pacific/Enderbury" -> Set(9130, 9131),
+  "Pacific/Fakaofo" -> Set(15338),
+  "Pacific/Kiritimati" -> Set(9130, 9131),
+  "Pacific/Kwajalein" -> Set(8632),
+  "MIT" -> Set(15338))
 for (tz <- DateTimeTestUtils.ALL_TIMEZONES) {
-  val skipped = skipped_days.getOrElse(tz.getID, Int.MinValue)
+  val skipped = skipped_days.getOrElse(tz.getID, Set.empty)
   (-2 to 2).foreach { d =>
-if (d != skipped) {
+if (!skipped.contains(d)) {
   assert(millisToDays(daysToMillis(d, tz), tz) === d,
 s"Round trip of ${d} did not work in tz ${tz}")
 }


-
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org