@@ -19,13 +19,12 @@ package org.apache.spark.sql.hive
19
19
20
20
import java .sql .Date
21
21
import java .util
22
- import java .util .TimeZone
23
22
24
23
import org .apache .hadoop .hive .serde2 .io .DoubleWritable
25
24
import org .apache .hadoop .hive .serde2 .objectinspector .primitive .PrimitiveObjectInspectorFactory
26
25
import org .apache .spark .sql .catalyst .types ._
27
26
import org .apache .spark .sql .catalyst .types .decimal .Decimal
28
- import org .scalatest .{ BeforeAndAfterAll , FunSuite }
27
+ import org .scalatest .FunSuite
29
28
30
29
import org .apache .hadoop .hive .ql .udf .UDAFPercentile
31
30
import org .apache .hadoop .hive .serde2 .objectinspector .{ObjectInspector , StructObjectInspector , ObjectInspectorFactory }
@@ -34,18 +33,7 @@ import org.apache.hadoop.io.LongWritable
34
33
35
34
import org .apache .spark .sql .catalyst .expressions .{Literal , Row }
36
35
37
- class HiveInspectorSuite extends FunSuite with HiveInspectors with BeforeAndAfterAll {
38
- private val originalTimeZone = TimeZone .getDefault
39
-
40
- override def beforeAll () {
41
- // Timezone is fixed to GMT
42
- TimeZone .setDefault(TimeZone .getTimeZone(" GMT" ))
43
- }
44
-
45
- override def afterAll () {
46
- TimeZone .setDefault(originalTimeZone)
47
- }
48
-
36
+ class HiveInspectorSuite extends FunSuite with HiveInspectors {
49
37
test(" Test wrap SettableStructObjectInspector" ) {
50
38
val udaf = new UDAFPercentile .PercentileLongEvaluator ()
51
39
udaf.init()
@@ -84,7 +72,7 @@ class HiveInspectorSuite extends FunSuite with HiveInspectors with BeforeAndAfte
84
72
Literal (0 .asInstanceOf [Float ]) ::
85
73
Literal (0 .asInstanceOf [Double ]) ::
86
74
Literal (" 0" ) ::
87
- Literal (new Date (0 )) ::
75
+ Literal (new Date (2014 , 9 , 23 )) ::
88
76
Literal (Decimal (BigDecimal (123.123 ))) ::
89
77
Literal (new java.sql.Timestamp (123123 )) ::
90
78
Literal (Array [Byte ](1 ,2 ,3 )) ::
0 commit comments