查询cassandra转换为数据帧时出现Pyspark错误

时间:2015-08-26 11:48:14

标签: cassandra pyspark pyspark-sql

执行命令时出现以下错误:

user = sc.cassandraTable("DB NAME", "TABLE NAME").toDF()

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/src/spark/spark-1.4.1/python/pyspark/sql/context.py", line 60, in toDF
    return sqlContext.createDataFrame(self, schema, sampleRatio)
  File "/usr/local/src/spark/spark-1.4.1/python/pyspark/sql/context.py", line 333, in createDataFrame
    schema = self._inferSchema(rdd, samplingRatio)
  File "/usr/local/src/spark/spark-1.4.1/python/pyspark/sql/context.py", line 220, in _inferSchema
    raise ValueError("Some of types cannot be determined by the "
ValueError: Some of types cannot be determined by the first 100 rows, please try again with sampling

0 个答案:

没有答案