score:2
Accepted answer
have you tried this signature?
override def call(t: string): java.util.iterator[any] = {
...
because this code example is compiled successfully:
import org.apache.spark.api.java.function.flatmapfunction
import collection.javaconverters._
class custominputmapperwkt extends flatmapfunction[string, any] {
override def call(t: string): java.util.iterator[any] = {
...
result.iterator.asjava
}
}
Source: stackoverflow.com
Related Query
- Automatically convert Scala code to Java code
- Convert java code contain generic to scala
- Unable to convert Java code to Scala one
- Convert Java map into Scala immutable map in Java code with Scala-2.13
- Convert java to scala code
- how to convert scala code to java to read xml files
- convert java to scala code - change of method signatures
- Convert legacy Java code into Scala functional idioms
- I'm trying to convert some scala code to Java 8 to fell the new Lambda and parallel collections
- I am trying to convert Java code to scala
- Samples of Scala and Java code where Scala code looks simpler/has fewer lines?
- How can I convert a Java Iterable to a Scala Iterable?
- Convert Java Map to Scala Map
- Automated Java to Scala source code conversion?
- Convert Java List to Scala Seq
- How can I convert Scala Map to Java Map with scala.Float to java.Float k/v conversion
- How to convert a Java Stream to a Scala Stream?
- Convert from scala.collection.Seq<String> to java.util.List<String> in Java code
- Convert Scala Set into Java (java.util.Set)?
- Convert a Java Future to a Scala Future
- Convert Scala Option to Java Optional
- Convert Scala Any to Java Object
- How to use Scala varargs from Java code
- How to convert a nested scala collection to a nested Java collection
- Convert scala future to java future
- Nested Scala singletons from Java code
- How to convert a Scala Array[Byte] to Java byte[]?
- How to convert a scala Int to a java Integer?
- How to refer to protected inner class in Scala when inheriting from Java (with byte code only)
- Is there a quick way to convert Java xml objects to Scala xml objects?
More Query from same tag
- create project jar in scala
- Slick left/right/outer joins with Option
- Problems with Scala constructors and enums
- How to convert Scala Document to JSON in Scala
- Error when attempting Option(Option(Some)).flatten in Scala
- Option.zip returns List, not Option
- Scala cannot infer
- Publish SBT project with sub-projects as a single Maven artifact
- Wait on asynchronous Future call before processing next message in Akka
- Play framework Json output issue
- Scala: Returning a mutable buffer from a function that returns a Seq
- Scala create array of empty arrays
- fail to online install sbt (following official guide)
- Scala: create a dependent type variable from Any
- In Java code, how to properly handle scala future in format of Future[Try[Option[Map[String, Any]]]]
- foldLeft on Iterable(String, (Long,Long))
- Functional equivalent of if (p(f(a), f(b)) a else b
- Extension, super constructor and static methods
- Patterns for same method & same parameters but different parameter names in scala
- How to write universal combination in Scala
- Form handling for generic class in Play Framework 2.3.x
- How to filter nested Lists and Maps in scala
- Spark Cassandra Join ClassCastException
- Why I receive error for a specific method in Play 2?
- Scala List[Int] becomes List<Object> in Java
- How does one provide an unmarshaller for a Scala trait in Akka HTTP?
- Higher order filter function
- How to delete in MongoDB records whose hour is not a multiple of 12
- org.apache.spark.sql.catalyst.parser.ParseException: in spark scala cassandra api
- Scala - trouble with type inference in lambda expression