在pyspark中删除累积对时抛出异常的异常

时间:2019-05-22 09:00:13

标签: python pyspark

我有下面的数据框,该数据框是在交叉联接之​​后生成的。我想根据dump列删除累积对。

我在pyspark中使用了下面的行。问题是执行dropDuplicates命令后,当我尝试运行df.show()时jupyter显示异常。 我不明白为什么df.show()会给出异常,因为dropDuplicate命令没有引发异常。


Note : I am getting the following exception :

---------------------------------------------------------------------------
Py4JJavaError                             Traceback (most recent call last)
<ipython-input-30-5dd79f052d72> in <module>()
      1 m_f_1 = m_f_1.dropDuplicates(subset=['dump']).drop('dump')
----> 2 m_f_1.show()

~/spark-2.3.2-bin-hadoop2.7/python/pyspark/sql/dataframe.py in show(self, n, truncate, vertical)
    348         """
    349         if isinstance(truncate, bool) and truncate:
--> 350             print(self._jdf.showString(n, 20, vertical))
    351         else:
    352             print(self._jdf.showString(n, int(truncate), vertical))

~/spark-2.3.2-bin-hadoop2.7/python/lib/py4j-0.10.7-src.zip/py4j/java_gateway.py in __call__(self, *args)
   1255         answer = self.gateway_client.send_command(command)
   1256         return_value = get_return_value(
-> 1257             answer, self.gateway_client, self.target_id, self.name)
   1258 
   1259         for temp_arg in temp_args:

~/spark-2.3.2-bin-hadoop2.7/python/pyspark/sql/utils.py in deco(*a, **kw)
     61     def deco(*a, **kw):
     62         try:
---> 63             return f(*a, **kw)
     64         except py4j.protocol.Py4JJavaError as e:
     65             s = e.java_exception.toString()

~/spark-2.3.2-bin-hadoop2.7/python/lib/py4j-0.10.7-src.zip/py4j/protocol.py in get_return_value(answer, gateway_client, target_id, name)
    326                 raise Py4JJavaError(
    327                     "An error occurred while calling {0}{1}{2}.\n".
--> 328                     format(target_id, ".", name), value)
    329             else:
    330                 raise Py4JError(

Py4JJavaError: An error occurred while calling o543.showString.
: org.apache.spark.SparkException: Job aborted due to stage failure: Task 2 in stage 835.0 failed 1 times, most recent failure: Lost task 2.0 in stage 835.0 (TID 38241, localhost, executor driver): java.lang.OutOfMemoryError: Java heap space

非常感谢您的帮助。

0 个答案:

没有答案