Spark:UnpicklingError:当尝试将数据推送到Kinesis Firehose时,NEWOBJ类参数具有NULL tp_new

时间:2015-11-16 07:26:40

标签: python apache-spark pyspark amazon-kinesis amazon-kinesis-firehose

我正在通过spark尝试数据到kinesis firehose:

我收到的错误很像 UnpicklingError:NEWOBJ类参数具有NULL tp_new

我使用的是python版本:2.10(Anaconda版) Spark - 2.4.6-hadoop版本。 我正在使用Boto3 - 将数据推送到Amazon Kinesis。

当我尝试使用python脚本将数据推送到带有示例数据的kinesis时 - 它运行良好,我得到如下所示的结果输出。

In [21]: aws_client.put_record_batch(DeliveryStreamName='streamname',Records=Records)

And I am getting a success message that it is pushed to kinesis : 

Out[16]: 
{u'FailedPutCount': 0,
 u'RequestResponses': [{u'RecordId': u'gfdgfdgdtgrt4rt4trfg'},
  {u'RecordId': u'hggfhhy7686ghytryhfgfdgdgtrged'}],
 'ResponseMetadata': {'HTTPStatusCode': 200,
  'RequestId': 'u'ytutujguiuuuiiuuu'}}

http://boto3.readthedocs.org/en/latest/guide/configuration.html http://boto3.readthedocs.org/en/latest/reference/services/kinesis.html#client

同样如果我尝试火花 - (进行处理以从twitter推送丰富的推文并推送到kinesis)..

sc = SparkContext(appName="PythonStreamingKafkaWordCount")
ssc = StreamingContext(sc, 1)

zkQuorum, topic = sys.argv[1:]
kvs = KafkaUtils.createStream(ssc, zkQuorum, "spark-streaming-consumer", {topic: 1})
lines = kvs.map(lambda x: x[1])
enrichedData = lines.flatMap(f1)
enrichedData.foreachRDD(lambda rdd: rdd.foreachPartition(sendToKinesis))
# simplejson.l1oad()
ssc.start()
ssc.awaitTermination()

我收到的错误很像 UnpicklingError:NEWOBJ类参数具有NULL tp_new

enter image description here

任何人都可以帮我弄清楚为什么它不能与Spark一起使用?

0 个答案:

没有答案