score:2
Accepted answer
the problem is that you assigned boolean result of method contains
to a val inspectvariable
. this operation has a return type of unit. but filter
method requires boolean.
just remove val inspectvariable =
and this should fix it.
or return the value by adding new line with content inspectvariable
after assigning the value.
as shown here
val filteredwordcounts = sortedwordcounts.filter { x =>
val inspectvariable = commonenglishstopwords.contains(x._1)//put your breakpoint here
inspectvariable
}
Source: stackoverflow.com
Related Query
- Debugging a filter operation in scala through `in-code variable inspection`
- Variable not appearing when debugging scala code with IntelliJ IDEA
- Debugging Scala code with simple-build-tool (sbt) and IntelliJ
- Debugging functional code in Scala
- Scala sbt assembly jar does not work (class implementation not found) but code works when through IntelliJ
- Initialize variable in Scala Object through some method (similar to init method in class)
- How to inject dependencies through Scala Reader from Java code
- Scala Generic, specify generic through variable
- Scala code analyzer targets case variable names that are identical to the outer matched varables - "suspicous shadowing"
- how to run export command from Scala code to add new environment variable on Linux?
- How to extract filter code to local variable
- How to filter a dataframe based on column values(multiple values through a arraybuffer) in scala
- Scala iterable map filter using single operation
- Use variable for type checking code in Scala
- Debugging scala code with recursive function in Intellij Idea
- Interactively execute code while debugging in Scala
- Scala code compiles through command-line sbt but fails when compiled through Intellij Idea - how set up Intellij to use external sbt?
- Intellij IDEA 2017 Scala code inspection problems
- Is there any video tutorial for setting up Scala IDE with usage of both external libraries and debugging your own source code projects dependencies?
- Debugging Scala compiler code
- Using a Scala filter inside a Spark map operation
- Hide a Variable in Scala source code
- Execution of scala Code through command line using spark-submit
- I want to create variable from dataframe and need to use in spark scala code
- Spark Scala - Bitwise operation in filter
- Iterate through the json and parse the result to variable in scala
- Scala - Get value of variable through another variable of same object
- is there a way to write coalesce query to remove null from a file and use in scala code with a filter after extracting from a file?
- Samples of Scala and Java code where Scala code looks simpler/has fewer lines?
- Drop into interpreter during arbitrary scala code location
More Query from same tag
- scala range returns Long instead of Int
- Using Apache Spark's Time class/type
- Flink Custom Partition Function
- How to turn an Anorm RowParser[A] into RowParser[Option[A]]
- How to avoid `missing type` error while chaining partial functions
- Error not found value in Spark Scala
- How to get all function arguments in scala
- Scala slf4j logging issue when given multiple (>2) params
- Karate-Gatling: Not able to use object fields inside Karate features
- Calculate min max using Spark dataframe and vertically align output
- Building an SBT project using Maven
- How to Partition records by column and assign sequential number to another column
- Using Squeryl with Akka Actors
- Scalatra / Slick and insert IF NOT EXISTS
- Is it possible to define a Scala function that can only be accessed from another trait?
- How to create a UDF to find index in an array column
- error from slick in play scala
- How to create a Source which is not affected by backpressure
- Switch if empty in Scala
- How to explain the following code about path-dependent type and polymorphism
- Is it possible to have the view implementation hidden in a Scala application?
- How to run Scala 3 applications in the command line with Coursier
- A function to determine whether one number is a factor of another in an argument to foldLeft in Scala
- Could we use sleuth without spring cloud?
- Is it possible to pass values from two instances of the same Scala class
- How can I find the definition of methods/operations defined in an implicitly-converted class?
- Generate companion object for case class with methods (field = method)
- Scala Play convert a request to JSON and write it to MongoDB
- Repeat asynchronous requests to the server
- Type not found: type .. when type is in src_managed folder