You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@spark.apache.org by Yogesh Vyas <in...@gmail.com> on 2017/04/06 06:44:55 UTC
use UTF-16 decode in pyspark streaming
Hi,
I am trying to decode the binary data using UTF-16 decode in Kafka consumer
using spark streaming. But it is giving error:
TypeError: 'str' object is not callable
I am doing it in following way:
kvs = KafkaUtils.createStream(ssc, zkQuorum, "spark-streaming-consumer",
{topic: 1},valueDecoder="utfTo16")
def utfTo16(msg):
return msg.decode("utf-16")
Please suggest if I am doing it right or not??
Regards,
Yogesh