diff options
author | Xiangrui Meng <meng@databricks.com> | 2015-04-01 18:17:07 -0700 |
---|---|---|
committer | Xiangrui Meng <meng@databricks.com> | 2015-04-01 18:17:07 -0700 |
commit | 4815bc2128c7f6d4d21da730b8c72da087233b34 (patch) | |
tree | f026222d229b43ed57a64468e9bba177aacbd3c6 /python/pyspark/mllib | |
parent | 757b2e91756ba49d7d1ab89abf19b00c7f5fd721 (diff) | |
download | spark-4815bc2128c7f6d4d21da730b8c72da087233b34.tar.gz spark-4815bc2128c7f6d4d21da730b8c72da087233b34.tar.bz2 spark-4815bc2128c7f6d4d21da730b8c72da087233b34.zip |
[SPARK-6660][MLLIB] pythonToJava doesn't recognize object arrays
davies
Author: Xiangrui Meng <meng@databricks.com>
Closes #5318 from mengxr/SPARK-6660 and squashes the following commits:
0f66ec2 [Xiangrui Meng] recognize object arrays
ad8c42f [Xiangrui Meng] add a test for SPARK-6660
Diffstat (limited to 'python/pyspark/mllib')
-rw-r--r-- | python/pyspark/mllib/tests.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/python/pyspark/mllib/tests.py b/python/pyspark/mllib/tests.py index 893fc6f491..6e9c68ec8a 100644 --- a/python/pyspark/mllib/tests.py +++ b/python/pyspark/mllib/tests.py @@ -36,6 +36,7 @@ if sys.version_info[:2] <= (2, 6): else: import unittest +from pyspark.mllib.common import _to_java_object_rdd from pyspark.mllib.linalg import Vector, SparseVector, DenseVector, VectorUDT, _convert_to_vector,\ DenseMatrix, Vectors, Matrices from pyspark.mllib.regression import LabeledPoint @@ -641,6 +642,13 @@ class FeatureTest(PySparkTestCase): idf = model.idf() self.assertEqual(len(idf), 11) + +class SerDeTest(PySparkTestCase): + def test_to_java_object_rdd(self): # SPARK-6660 + data = RandomRDDs.uniformRDD(self.sc, 10, 5, seed=0L) + self.assertEqual(_to_java_object_rdd(data).count(), 10) + + if __name__ == "__main__": if not _have_scipy: print "NOTE: Skipping SciPy tests as it does not seem to be installed" |