我正在尝试在Spark 2.0.1中运行基本的Spark代码。
sdf_content_cat=sqlContext.createDataFrame(content_catalogue)
sdf_content_cat.cache().take(2)
这里content_catalogue是一个pandas数据框>前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 Runtime Recursion错误。当我使用这样的代码时,我从来没有这样做过。
/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