Re: how to convert the binary from kafak to srring pleaae

2017-07-24 Thread ??????????
Hi Armbrust,


It works well.


Thanks.


 
---Original---
From: "Michael Armbrust"
Date: 2017/7/25 04:58:44
To: "??"<1427357...@qq.com>;
Cc: "user";
Subject: Re: how to convert the binary from kafak to srring pleaae


There are end to end examples of using Kafka in in this 
blog:https://databricks.com/blog/2017/04/26/processing-data-in-apache-kafka-with-structured-streaming-in-apache-spark-2-2.html



On Sun, Jul 23, 2017 at 7:44 PM, ?? <1427357...@qq.com> wrote:
Hi all 


I want to change the binary from kafka to string. Would you like help me please?


val df = ss.readStream.format("kafka").option("kafka.bootstrap.server","")
.option("subscribe","")
.load


val value = df.select("value")


value.writeStream
.outputMode("append")
.format("console")
.start()
.awaitTermination()




Above code outputs result like:


++
|value|
+-+
|[61,61]|
+-+




61 is character a receiced from kafka.
I want to print [a,a] or aa.
How should I do please?

Re: how to convert the binary from kafak to srring pleaae

2017-07-24 Thread Michael Armbrust
There are end to end examples of using Kafka in in this blog:
https://databricks.com/blog/2017/04/26/processing-data-in-apache-kafka-with-structured-streaming-in-apache-spark-2-2.html

On Sun, Jul 23, 2017 at 7:44 PM, 萝卜丝炒饭 <1427357...@qq.com> wrote:

> Hi all
>
> I want to change the binary from kafka to string. Would you like help me
> please?
>
> val df = ss.readStream.format("kafka").option("kafka.bootstrap.
> server","")
> .option("subscribe","")
> .load
>
> val value = df.select("value")
>
> value.writeStream
> .outputMode("append")
> .format("console")
> .start()
> .awaitTermination()
>
>
> Above code outputs result like:
>
> ++
> |value|
> +-+
> |[61,61]|
> +-+
>
>
> 61 is character a receiced from kafka.
> I want to print [a,a] or aa.
> How should I do please?
>


Re: how to convert the binary from kafak to srring pleaae

2017-07-24 Thread ??????????
Hi cheers,


Would you like  write samw code please?
I check the select method, i do not know how to cast it and how to set the 
value.deserialize.


Thanks


 
---Original---
From: "Szuromi Tam??s"
Date: 2017/7/24 16:32:52
To: "??"<1427357...@qq.com>;
Cc: "user";
Subject: Re: how to convert the binary from kafak to srring pleaae


Hi, 

You can cast it to string in a select or you can set the value.deserializer 
parameter for kafka.


cheers,


2017-07-24 4:44 GMT+02:00 ?? <1427357...@qq.com>:
Hi all 


I want to change the binary from kafka to string. Would you like help me please?


val df = ss.readStream.format("kafka").option("kafka.bootstrap.server","")
.option("subscribe","")
.load


val value = df.select("value")


value.writeStream
.outputMode("append")
.format("console")
.start()
.awaitTermination()




Above code outputs result like:


++
|value|
+-+
|[61,61]|
+-+




61 is character a receiced from kafka.
I want to print [a,a] or aa.
How should I do please?

Re: how to convert the binary from kafak to srring pleaae

2017-07-24 Thread Szuromi Tamás
Hi,

You can cast it to string in a select or you can set the value.deserializer
parameter for kafka.

cheers,

2017-07-24 4:44 GMT+02:00 萝卜丝炒饭 <1427357...@qq.com>:

> Hi all
>
> I want to change the binary from kafka to string. Would you like help me
> please?
>
> val df = ss.readStream.format("kafka").option("kafka.bootstrap.
> server","")
> .option("subscribe","")
> .load
>
> val value = df.select("value")
>
> value.writeStream
> .outputMode("append")
> .format("console")
> .start()
> .awaitTermination()
>
>
> Above code outputs result like:
>
> ++
> |value|
> +-+
> |[61,61]|
> +-+
>
>
> 61 is character a receiced from kafka.
> I want to print [a,a] or aa.
> How should I do please?
>


how to convert the binary from kafak to srring pleaae

2017-07-23 Thread ??????????
Hi all 


I want to change the binary from kafka to string. Would you like help me please?


val df = ss.readStream.format("kafka").option("kafka.bootstrap.server","")
.option("subscribe","")
.load


val value = df.select("value")


value.writeStream
.outputMode("append")
.format("console")
.start()
.awaitTermination()




Above code outputs result like:


++
|value|
+-+
|[61,61]|
+-+




61 is character a receiced from kafka.
I want to print [a,a] or aa.
How should I do please?