So sorry , should be Seq, not sql . thanks for your help.




Ricky  Ou(欧   锐)


 
From: Dean Wampler
Date: 2015-12-23 00:46
To: our...@cnsuning.com
CC: user; t...@databricks.com
Subject: Re: spark streaming updateStateByKey state is nonsupport other type 
except ClassTag such as list?
There are ClassTags for Array, List, and Map, as well as for Int, etc. that you 
might have inside those collections. What do you mean by sql? Could you post 
more of your code?

Dean Wampler, Ph.D.
Author: Programming Scala, 2nd Edition (O'Reilly)
Typesafe
@deanwampler
http://polyglotprogramming.com

On Mon, Dec 21, 2015 at 8:51 PM, our...@cnsuning.com <our...@cnsuning.com> 
wrote:

spark streaming updateStateByKey state no support Array type  without classTag? 
 how to slove the problem?

def updateStateByKey[S: ClassTag]( 
updateFunc: (Seq[V], Option[S]) => Option[S] 
): DStream[(K, S)] = ssc.withScope { 
updateStateByKey(updateFunc, defaultPartitioner()) 
}

ClassTag  not support other type eg:hashmap ,list ,sql.


my usecase as following:
     save the lastest three click log with collecting   goods  from  different 
topic with same  member ID,  then  the system will recommend related products 
according to  lastest three click log with collecting   goods.
I want to use updateStateByKey  state to save it ,however  updateStateByKey 
state is  nonsupport  other type except ClassTag  such as list.
 


                                                                                
                                                                    thanks for 
your help






Ricky  Ou(欧   锐)




Reply via email to