spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sivarani <>
Subject Re: Spark Streaming getOrCreate
Date Wed, 05 Nov 2014 05:25:07 GMT
Anybody any luck? I am also trying to set NONE to delete key from state, will
null help? how to use scala none in java

My code goes this way 

	public static class ScalaLang {

	    public  static <T> Option<T> none() {
	        return (Option<T>) None$.MODULE$;

 Function2<List&lt;Double>, Optional<Double>, Optional<Double>>
updateFunction =
		    		  new Function2<List&lt;Double>, Optional<Double>,
Optional<Double>>() {
		    		    @Override public Optional<Double> call(List<Double> values,
Optional<Double> state) {
 Double newSum = state.or(0D); 
		    		    	  System.out.println("empty value");
		    		    	  return null;  I WANT TO RETURN NONE TO DELETE KEY but when i
set ScalaLang.<>none(); it shows error
		    		    	  for (double i : values) {
		    			         newSum += i;
		    		    	  return Optional.of(newSum);

View this message in context:
Sent from the Apache Spark User List mailing list archive at

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

View raw message