score:2
don't forget that val
s are immutable, this means that you can't reassign something to a previously defined variable. however if you want to do this, you can replace it for a var
, which is not recommended, this question is more related to scala
's feature than to apache-spark
's one. besides, if you want more information you can consult this post use of def val and vars in scala.
score:3
the compiler is telling you that you're attempting to define a variable with itself and use it in it's own definition within an action. to say this another way, you're attempting to use something that doesn't exist in an action to define it.
edit:
if you have a list of actions that produce new rdd that you'd like to zip together, perhaps you should look at a fold:
listmyactions.foldleft(origrdd){ (rdd, f) =>
val temprdd = f(rdd)
rdd.zip(temprdd)
}
Source: stackoverflow.com
Related Query
- Scala - error: recursive variable name needs type
- error scala: recursive value variable needs type
- recursive variable needs type
- recursive value yyy needs type in scala
- Why this scala code reports compilation error: recursive value x needs type
- Error on scala class : recursive method printExpr needs result type
- Recursive value needs type - Scala Swing
- scala: error: recursive value needs type
- Variable Setter Type Error: Overloaded method needs result type
- scala parallel set recursive value needs type
- Recursive value chain0 needs type
- Scala code during compilation runs into error: recursive value info needs type
- cumulative sum error in scala - recursive value needs type
- Scala: recursive value listHuman needs type
- Json4S Recursive method parse needs a result type
- Creating Vertices and Edges in Apache Spark results in error: recursive value fields needs type
- recursive value x$5 needs type
- I want to get the type of a variable at runtime
- print type of variable in Scala
- Why does Scala require a return type for recursive functions?
- Compiler error about class graph being not finitary due to a expansively recursive type parameter
- Use case and examples for type pattern with type variable
- What is the most concise way to increment a variable of type Short in Scala?
- Indirect recursive generic type definitions in scala
- Scala recursive type alias error
- Scala recursive type and type constructor implementation
- How to cast a variable to certain runtime type got from TypeCast in Scala
- Scala : Does variable type inference affect performance?
- How can I determine the type of a variable when it is not given?
- Providing implicit instances in the inheritor of a type that needs them
More Query from same tag
- Cached Spark RDD ( read from Sequence File) has invalid entries, how do i fix this?
- Function with Future return type always returns None
- Proguard - java.lang.IllegalArgumentException: Can't find common super class of
- class needs to be abstract since method in trait is not defined error
- Transform Rows to Columns
- spark 2.2 illegal pattern component: yyy java.lang.illegalargumentexception: illegal pattern component: yyy
- How to get out value from Scala Future onComplete/onSuccess
- Playframework: DRY way to write I18n files
- How to return a plain text string back to browser in lift views?
- Priority queue with custom ordering
- scala/play - Make a File object from an uploaded file
- Mixin in a trait parameterized with Enumeration into Enumeration
- Understanding spark process behaviour
- BSONObjectIDFormat in trait BSONFormats is deprecated
- Adding element to a scala set which is a map value
- Pass/Parameterize the function's return subtype
- How to implement simple retry using AsyncHttpClient and scala
- Does the AnyVal with AnyRef as a parameter make sense in Scala?
- run multiclass classification using spark ml pipeline
- scala spray respondWithHeader dynamic value?
- Calling multiple notebook from other in databricks
- How to use thenCallRealMethod in Mockito Scala test cases for testing trait method?
- Scala: getting rid of type argument in a function
- Get time duration in scala
- Scala Pattern-matching on a constructor with parameters, but also reusing the object
- Filter rows based on a time stamp in another column Spark Scala
- Type mismatch error when trying to format float variable inside string interpolator
- Inheritance with Scala 'object'
- Import works, but does not import everything in the package?
- Defining and editing variables inside template