异常:Some of types cannot be determined by the first 100 rows, please try again with sampling

将RDD转为DataFrame的方式有: 1. 将RDD转换为Row,之后创建dataframe rdd = stringCSVRDD.map(lambda p: Row(id=p[0], name=p[1], age=p[2], eyeColor=p[3])) df = spark.createDataFrame(rdd) 通过该方式创建dataframe,书写简单,字段类型通过前100条数据类
相关文章
相关标签/搜索