Repository: spark
Updated Branches:
  refs/heads/branch-1.3 2cdcfe382 -> 513bb2c84


[SQL] Correct the default size of TimestampType and expose NumericType

Author: Yin Huai <[email protected]>

Closes #4314 from yhuai/minor and squashes the following commits:

d3870a7 [Yin Huai] Update test.
6e4b0c0 [Yin Huai] Two minor changes.

(cherry picked from commit 0d81645f776aeca6a48322da392d4fac18431556)
Signed-off-by: Michael Armbrust <[email protected]>


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

Branch: refs/heads/branch-1.3
Commit: 513bb2c84da75ec4ef959034f4292ecc2ae5d0aa
Parents: 2cdcfe3
Author: Yin Huai <[email protected]>
Authored: Wed Feb 4 15:14:49 2015 -0800
Committer: Michael Armbrust <[email protected]>
Committed: Wed Feb 4 15:15:02 2015 -0800

----------------------------------------------------------------------
 .../src/main/scala/org/apache/spark/sql/types/dataTypes.scala  | 6 +++---
 .../test/scala/org/apache/spark/sql/types/DataTypeSuite.scala  | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/513bb2c8/sql/catalyst/src/main/scala/org/apache/spark/sql/types/dataTypes.scala
----------------------------------------------------------------------
diff --git 
a/sql/catalyst/src/main/scala/org/apache/spark/sql/types/dataTypes.scala 
b/sql/catalyst/src/main/scala/org/apache/spark/sql/types/dataTypes.scala
index 4825d1f..a6d6ddd 100644
--- a/sql/catalyst/src/main/scala/org/apache/spark/sql/types/dataTypes.scala
+++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/types/dataTypes.scala
@@ -371,9 +371,9 @@ case object TimestampType extends NativeType {
   }
 
   /**
-   * The default size of a value of the TimestampType is 8 bytes.
+   * The default size of a value of the TimestampType is 12 bytes.
    */
-  override def defaultSize: Int = 8
+  override def defaultSize: Int = 12
 }
 
 
@@ -400,7 +400,7 @@ case object DateType extends NativeType {
 }
 
 
-protected[sql] abstract class NumericType extends NativeType with 
PrimitiveType {
+abstract class NumericType extends NativeType with PrimitiveType {
   // Unfortunately we can't get this implicitly as that breaks Spark 
Serialization. In order for
   // implicitly[Numeric[JvmType]] to be valid, we have to change JvmType from 
a type variable to a
   // type parameter and and add a numeric annotation (i.e., [JvmType : 
Numeric]). This gets

http://git-wip-us.apache.org/repos/asf/spark/blob/513bb2c8/sql/catalyst/src/test/scala/org/apache/spark/sql/types/DataTypeSuite.scala
----------------------------------------------------------------------
diff --git 
a/sql/catalyst/src/test/scala/org/apache/spark/sql/types/DataTypeSuite.scala 
b/sql/catalyst/src/test/scala/org/apache/spark/sql/types/DataTypeSuite.scala
index 7bcd668..c97e0be 100644
--- a/sql/catalyst/src/test/scala/org/apache/spark/sql/types/DataTypeSuite.scala
+++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/types/DataTypeSuite.scala
@@ -107,7 +107,7 @@ class DataTypeSuite extends FunSuite {
   checkDefaultSize(DecimalType(10, 5), 4096)
   checkDefaultSize(DecimalType.Unlimited, 4096)
   checkDefaultSize(DateType, 4)
-  checkDefaultSize(TimestampType, 8)
+  checkDefaultSize(TimestampType,12)
   checkDefaultSize(StringType, 4096)
   checkDefaultSize(BinaryType, 4096)
   checkDefaultSize(ArrayType(DoubleType, true), 800)


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to