Skip to content
Advertisement

Tag: scala

Is it possible to shade some package in only one package in sbt?

let’s consider a following source code: It renames com.google.common and change package names as well. Additionally, thanks to inAll it rewrites all imports and another references in all classes in jar. It works fine. However, the question is: Is it possible to rewrite only chosen references? I mean pointed by me using path to package? Let’s say something like: I

Akka Quickstart: An illegal reflective access operation has occurred

When running the official Akka Quickstart on my Mac terminal, I get this error: Is this the intended result? How can I go about fixing this? Answer This is a warning, not an error. Here is a quote from Oracle JDK 9 Migration Guide https://docs.oracle.com/javase/9/migrate/toc.htm#JSMIG-GUID-7BB28E4D-99B3-4078-BDC4-FC24180CE82B Understanding Runtime Access Warnings Some tools and libraries use reflection to access parts of the

is scala OpenHashMap remove operator threadsafe

Sorry but I cannot find in the network a direct answer to a very simple questions. is scala OpenHashMap remove operator threadsafe? Regrds. Answer Seems it is not thread safe: Scala OpenHashMap def: Ref link: https://alvinalexander.com/java/jwarehouse/scala-2.11/library/scala/collection/mutable/OpenHashMap.scala.shtml

Apache spark and scala, error while executing queries

I am working with a dataset whose sample is as follows: I have executed the following commands successfully: I am getting following error: java.lang.RuntimeException: Error while encoding: java.lang.RuntimeException: java.lang.Character is not a valid external type for schema of string I am getting the same error when executing any query against the data. Can you please have a look and provide

NoSuchMethodError in shapeless seen only in Spark

I am trying to write a Spark connector to pull AVRO messages off a RabbitMQ message queue. When decoding the AVRO messages, there is a NoSuchMethodError error that occurs only when running in Spark. I could not reproduce the Spark code exactly outside of spark, but I believe the two examples are sufficiently similar. I think this is the smallest

Java Array vs Scala Array

Seems one difference between Java Array and Scala Array is Java Array is co variant. Scala Array is not. Both are mutable. In java, sort method can take different arrays, such as arrays of String or Int. This is often quoted as a good example of Liskov substitution principle. Seems a good design to me? In Scala we know Array

Advertisement