Skip to content

Commit

Permalink
fix scala style
Browse files Browse the repository at this point in the history
  • Loading branch information
Davies Liu committed Jun 11, 2015
1 parent 361fd62 commit 5233974
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,8 @@ class CastSuite extends SparkFunSuite with ExpressionEvalHelper {
checkEvaluation(cast(ts, FloatType), 15.002f)
checkEvaluation(cast(ts, DoubleType), 15.002)
checkEvaluation(cast(cast(tss, ShortType), TimestampType), DateTimeUtils.fromJavaTimestamp(ts))
checkEvaluation(cast(cast(tss, IntegerType), TimestampType), DateTimeUtils.fromJavaTimestamp(ts))
checkEvaluation(cast(cast(tss, IntegerType), TimestampType),
DateTimeUtils.fromJavaTimestamp(ts))
checkEvaluation(cast(cast(tss, LongType), TimestampType), DateTimeUtils.fromJavaTimestamp(ts))
checkEvaluation(
cast(cast(millis.toFloat / 1000, TimestampType), FloatType),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,13 @@ class JsonSuite extends QueryTest with TestJsonData {
val ISO8601Time1 = "1970-01-01T01:00:01.0Z"
checkTypePromotion(DateTimeUtils.fromJavaTimestamp(new Timestamp(3601000)),
enforceCorrectType(ISO8601Time1, TimestampType))
checkTypePromotion(DateTimeUtils.millisToDays(3601000), enforceCorrectType(ISO8601Time1, DateType))
checkTypePromotion(DateTimeUtils.millisToDays(3601000),
enforceCorrectType(ISO8601Time1, DateType))
val ISO8601Time2 = "1970-01-01T02:00:01-01:00"
checkTypePromotion(DateTimeUtils.fromJavaTimestamp(new Timestamp(10801000)),
enforceCorrectType(ISO8601Time2, TimestampType))
checkTypePromotion(DateTimeUtils.millisToDays(10801000), enforceCorrectType(ISO8601Time2, DateType))
checkTypePromotion(DateTimeUtils.millisToDays(10801000),
enforceCorrectType(ISO8601Time2, DateType))
}

test("Get compatible type") {
Expand Down

0 comments on commit 5233974

Please sign in to comment.