spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yogesh Vyas <>
Subject Fwd: Get the previous state string
Date Thu, 15 Oct 2015 12:41:45 GMT
---------- Forwarded message ----------
From: Yogesh Vyas <>
Date: Thu, Oct 15, 2015 at 6:08 PM
Subject: Get the previous state string

I am new to Spark and was trying to do some experiments with it.

I had a JavaPairDStream<String, List<String>> RDD.
I want to get the list of string from its previous state. For that I
use updateStateByKey function as follows:

final Function2<List<String>, Optional<List<String>>,
Optional<List<String>>> updateFunc =
       new Function2<List<String>, Optional<List<String>>,
Optional<List<String>>>() {

        public Optional<List<String>> call(List<String> arg0,
Optional<List<String>> arg1) throws Exception {
        // TODO Auto-generated method stub
               return Optional.of(arg0);
            else {
               return Optional.of(arg0);

I want the function to append the new list of string to the previous
list and return the new list. But I am not able to do so. I am getting
the " java.lang.UnsupportedOperationException" error.
Can anyone which help me out in getting the desired output?

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message