You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@spark.apache.org by shyla deshpande <de...@gmail.com> on 2016/11/30 20:30:53 UTC

updateStateByKey -- when the key is multi-column (like a composite key )

updateStateByKey - Can this be used when the key is multi-column (like a
composite key ) and the value is not numeric. All the examples I have come
across is where the key is a simple String and the Value is numeric.

Appreciate any help.

Thanks

Re: updateStateByKey -- when the key is multi-column (like a composite key )

Posted by shyla deshpande <de...@gmail.com>.
Thanks Miguel for the response.

Works great. I am having a tuple for my key and the values are String and
returning String to the updateStateByKey.

On Wed, Nov 30, 2016 at 12:33 PM, Miguel Morales <th...@gmail.com>
wrote:

> I *think* you can return a map to updateStateByKey which would include
> your fields.  Another approach would be to create a hash (like create a
> json version of the hash and return that.)
>
> On Wed, Nov 30, 2016 at 12:30 PM, shyla deshpande <
> deshpandeshyla@gmail.com> wrote:
>
>> updateStateByKey - Can this be used when the key is multi-column (like a
>> composite key ) and the value is not numeric. All the examples I have come
>> across is where the key is a simple String and the Value is numeric.
>>
>> Appreciate any help.
>>
>> Thanks
>>
>
>

Re: updateStateByKey -- when the key is multi-column (like a composite key )

Posted by Miguel Morales <th...@gmail.com>.
I *think* you can return a map to updateStateByKey which would include your
fields.  Another approach would be to create a hash (like create a json
version of the hash and return that.)

On Wed, Nov 30, 2016 at 12:30 PM, shyla deshpande <de...@gmail.com>
wrote:

> updateStateByKey - Can this be used when the key is multi-column (like a
> composite key ) and the value is not numeric. All the examples I have come
> across is where the key is a simple String and the Value is numeric.
>
> Appreciate any help.
>
> Thanks
>