Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/293.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/apache-spark/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python运行时递归错误_Python_Apache Spark_Pyspark - Fatal编程技术网

Python运行时递归错误

Python运行时递归错误,python,apache-spark,pyspark,Python,Apache Spark,Pyspark,我试图在Spark 2.0.1中运行一个基本的Spark代码 sdf_content_cat=sqlContext.createDataFrame(content_catalogue) sdf_content_cat.cache().take(2) 此处内容目录为熊猫数据框>前5行: com.learnfit.tax.core.externalID com.learnfit.tax.core.label com.learnfit.tax.core.textContent 0

我试图在Spark 2.0.1中运行一个基本的Spark代码

sdf_content_cat=sqlContext.createDataFrame(content_catalogue)
sdf_content_cat.cache().take(2)
此处内容目录为熊猫数据框>前5行:

    com.learnfit.tax.core.externalID    com.learnfit.tax.core.label com.learnfit.tax.core.textContent
0   28245   DLR_MA-MFG Planning–Demand Processing Procedure DLR Maintenance Demand Processing Procedure for Manufacturing Planning
1   16583   TWDC_Harvard:Implementing Strategy  In many companies, senior business units and management are involved in the strategic planning process. Why? This ensures that a company’s strategies—both corporate and the business unit—are tightly aligned and that successful implementation can follow. \r \r This topic will help you understand what strategy is, the elements of a strategic plan, and the strategic planning process. \r \r You will also learn to develop action plans for strategic initiatives that support your company's strateg...
2   158021  Marketing   Presenter: Chad Sesser
3   68640   DLR_AO_UPD-California Screamin' 100705  Attractions Operations Cast Member On-the-Job Training
在[15]中:

但是我得到了这个Python运行时递归错误。当我使用这样的代码时,我从来没有得到过这个

/Users/i854319/spark2/python/pyspark/sql/types.pyc in _infer_type(obj)
    967     else:
    968         try:
--> 969             return _infer_schema(obj)
    970         except TypeError:
    971             raise TypeError("not supported type: %s" % type(obj))

... last 2 frames repeated, from the frame below ...

/Users/i854319/spark2/python/pyspark/sql/types.pyc in _infer_schema(row)
    992         raise TypeError("Can not infer schema for type: %s" % type(row))
    993 
--> 994     fields = [StructField(k, _infer_type(v), True) for k, v in items]
    995     return StructType(fields)
    996 

RuntimeError: maximum recursion depth exceeded

在<代码>内容目录> /代码>中,请使代码完全可重复。添加详细说明,您应该考虑清理包含文本的列。所以在此之前,我需要将它转换为Spark数据帧。在转换的过程中,我看到了问题所在