diff options
author | Daoyuan Wang <daoyuan.wang@intel.com> | 2015-05-12 10:23:41 -0700 |
---|---|---|
committer | Reynold Xin <rxin@databricks.com> | 2015-05-12 10:23:41 -0700 |
commit | d86ce845840a92b4dde7975082738ed94ab8c570 (patch) | |
tree | 7c1f437169cf8132bd5c6b70bc374bea717e13ab /core/src/main/scala/org | |
parent | ec6f2a9774167014566fb9608ee4394d2ce5fd6a (diff) | |
download | spark-d86ce845840a92b4dde7975082738ed94ab8c570.tar.gz spark-d86ce845840a92b4dde7975082738ed94ab8c570.tar.bz2 spark-d86ce845840a92b4dde7975082738ed94ab8c570.zip |
[SPARK-6876] [PySpark] [SQL] add DataFrame na.replace in pyspark
Author: Daoyuan Wang <daoyuan.wang@intel.com>
Closes #6003 from adrian-wang/pynareplace and squashes the following commits:
672efba [Daoyuan Wang] remove py2.7 feature
4a148f7 [Daoyuan Wang] to_replace support dict, value support single value, and add full tests
9e232e7 [Daoyuan Wang] rename scala map
af0268a [Daoyuan Wang] remove na
63ac579 [Daoyuan Wang] add na.replace in pyspark
Diffstat (limited to 'core/src/main/scala/org')
-rw-r--r-- | core/src/main/scala/org/apache/spark/api/python/PythonUtils.scala | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/core/src/main/scala/org/apache/spark/api/python/PythonUtils.scala b/core/src/main/scala/org/apache/spark/api/python/PythonUtils.scala index 9eff0a230c..efb6b93cfc 100644 --- a/core/src/main/scala/org/apache/spark/api/python/PythonUtils.scala +++ b/core/src/main/scala/org/apache/spark/api/python/PythonUtils.scala @@ -53,4 +53,11 @@ private[spark] object PythonUtils { def toSeq[T](cols: JList[T]): Seq[T] = { cols.toList.toSeq } + + /** + * Convert java map of K, V into Map of K, V (for calling API with varargs) + */ + def toScalaMap[K, V](jm: java.util.Map[K, V]): Map[K, V] = { + jm.toMap + } } |