score:1
Accepted answer
You have to provide a CodedInputStream.
Change:
persons.mergeFrom(new FileInputStream("path_of_file"))
To:
persons.mergeFrom(CodedInputStream.newInstance(new FileInputStream("path_of_file")))
Source: stackoverflow.com
Related Query
- Scala Set.contains doesn't give expected type mismatch error
- Type mismatch: expected A => NotInferedB, actual Any
- Type mismatch: expected String, actual Column
- Can Scala infer the actual type from the return type actually expected by the caller?
- Scala Pattern Matching returns expected type but generates type mismatch afterwards
- type mismatch found : Unit expected : RDD[XYZ...]
- Type mismatch, expected ((String,List[Product with Serializable])) => Boolean, actual ((String,List[Product with Serializable])) => Any
- Using TypeTags to Check if Expected Type Matches Actual
- scala type mismatch found Future[A] expected Future[B]
- Type mismatch, expected ListBuffer[Any], actual ListBuffer[CustomClass]
- Getting a type mismatch on String where CharSequence is expected in Scala on Avro generated java class
- Type mismatch from partition in Scala (expected (Set[String]...), actual (Set[String]...) )
- Type mismatch, expected ((Double,Double))=>Boolean, actual ((Double,Double))=>Any
- Composing Option with List in for-comprehension gives type mismatch depending on order
- Option getOrElse type mismatch error
- Scala type mismatch problem (expected Map, found scala.collection.mutable.HashMap)
- scala type mismatch error, GenTraversableOnce[?] required
- Type mismatch on abstract type used in pattern matching
- How to get the actual type of a generic type?
- How to solve type mismatch when compiler finds Serializable instead of the match type?
- Scala: Enforce compile error on type alias mismatch
- Scala 2.7.x type mismatch error when passing null for a reference type
- "return this" in a covariant trait that return actual type
- Scala Liftweb - pattern type is incompatible with expected type
- Scala type mismatch error in for loop
- Calling Java Generic Typed Method from Scala gives a Type mismatch error : Scala
- Scala ActionListener / anonymous function type mismatch
- scala: type mismatch error - found T, required String
- Error: type mismatch flatMap
- How to get the actual type of a generic function in Scala?
More Query from same tag
- What about a Scala Future#collectWith method?
- Scala with maven: Execute a -jar-with-dependencies with a class
- Will my this implementation of binary search always work correctly?
- Error during maven build in Scala-Spark
- The Future is not complete?
- Passing functions for all applicable types around
- Implicit conversion with future
- Passing parameter into sql string triple with using scala spark
- Waiting for another future to end to return a function
- read Json into Scalaz Tree
- In Scala, create a stream based on previous value and a second stream
- Meaning of exclamation mark in zipAll(s).takeWhile(!_._2.isEmpty)
- Scala slick left join doesnt work
- What is the range of Random.nextDouble in Scala?
- Better safe get from an array in scala?
- Higher kinded types scala for List, Options and other complex types
- Spark transform RDD
- What is the meaning of !# (bang-pound) in a sh / Bash shell script?
- Inject a dependency inside an object
- How to Transform a Spark Scala Nested Map within a Map Data Structure?
- What's the best way to handle invalid arguments in scala
- Scala Eclipse Error
- Spark scala - parse json from dataframe column and return RDD with columns
- Why does scala (1 to 1000).foreach throw an exception in this case?
- Spark - Merge two columns of array struct type
- Equivalent of Java '?' in Scala
- Spark SQL - Nested array conditional select
- Out of memory error Error while building spark
- Why use Specs2 over JUnit?
- Scala Spark, compare two DataFrames and select the value of another column