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 2014/07/30 07:43:01 UTC

git commit: [SQL] Handle null values in debug()

Repository: spark
Updated Branches:
  refs/heads/master 2e6efcace -> 077f633b4


[SQL] Handle null values in debug()

Author: Michael Armbrust <mi...@databricks.com>

Closes #1646 from marmbrus/nullDebug and squashes the following commits:

49050a8 [Michael Armbrust] Handle null values in debug()


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

Branch: refs/heads/master
Commit: 077f633b4720422c5efbf0382e869ead3dc49612
Parents: 2e6efca
Author: Michael Armbrust <mi...@databricks.com>
Authored: Tue Jul 29 22:42:54 2014 -0700
Committer: Michael Armbrust <mi...@databricks.com>
Committed: Tue Jul 29 22:42:54 2014 -0700

----------------------------------------------------------------------
 .../scala/org/apache/spark/sql/execution/debug/package.scala     | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/077f633b/sql/core/src/main/scala/org/apache/spark/sql/execution/debug/package.scala
----------------------------------------------------------------------
diff --git a/sql/core/src/main/scala/org/apache/spark/sql/execution/debug/package.scala b/sql/core/src/main/scala/org/apache/spark/sql/execution/debug/package.scala
index 5ef46c3..f31df05 100644
--- a/sql/core/src/main/scala/org/apache/spark/sql/execution/debug/package.scala
+++ b/sql/core/src/main/scala/org/apache/spark/sql/execution/debug/package.scala
@@ -105,7 +105,9 @@ package object debug {
             var i = 0
             while (i < numColumns) {
               val value = currentRow(i)
-              columnStats(i).elementTypes += HashSet(value.getClass.getName)
+              if (value != null) {
+                columnStats(i).elementTypes += HashSet(value.getClass.getName)
+              }
               i += 1
             }
             currentRow