Skip to content

Commit

Permalink
[SPARK-6121][SQL][MLLIB] simpleString for UDT
Browse files Browse the repository at this point in the history
`df.dtypes` shows `null` for UDTs. This PR uses `udt` by default and `VectorUDT` overwrites it with `vector`.

jkbradley davies

Author: Xiangrui Meng <meng@databricks.com>

Closes apache#4858 from mengxr/SPARK-6121 and squashes the following commits:

34f0a77 [Xiangrui Meng] simpleString for UDT
  • Loading branch information
mengxr committed Mar 3, 2015
1 parent e3a88d1 commit 2db6a85
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions python/pyspark/mllib/linalg.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ def deserialize(self, datum):
else:
raise ValueError("do not recognize type %r" % tpe)

def simpleString(self):
return "vector"


class Vector(object):

Expand Down
2 changes: 1 addition & 1 deletion python/pyspark/sql/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ def deserialize(self, datum):
raise NotImplementedError("UDT must implement deserialize().")

def simpleString(self):
return 'null'
return 'udt'

def json(self):
return json.dumps(self.jsonValue(), separators=(',', ':'), sort_keys=True)
Expand Down

0 comments on commit 2db6a85

Please sign in to comment.