You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by ma...@apache.org on 2015/02/05 00:14:52 UTC

spark git commit: [SQL] Correct the default size of TimestampType and expose NumericType

Repository: spark
Updated Branches:
  refs/heads/master b73d5fff7 -> 0d81645f7


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

Author: Yin Huai <yh...@databricks.com>

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

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


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

Branch: refs/heads/master
Commit: 0d81645f776aeca6a48322da392d4fac18431556
Parents: b73d5ff
Author: Yin Huai <yh...@databricks.com>
Authored: Wed Feb 4 15:14:49 2015 -0800
Committer: Michael Armbrust <mi...@databricks.com>
Committed: Wed Feb 4 15:14:49 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/0d81645f/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/0d81645f/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: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org