2

Example :

object x {
 case object obj1
 case object obj2 
}

I am trying to use a scala function that takes as variables a case object(for example obj1 as shown above). I am doing that because i want to a call scala object using py4j from pyspark.

When i am trying to use something like package.x.obj1 i get the error

x.obj1 does not exist in the JVM.

So the question is: how can i import object x from py4j so that i can use obj1 and obj2.

  • See https://stackoverflow.com/questions/3559714/nested-scala-singletons-from-java-code (note it may depend on the Scala version). – Alexey Romanov Mar 09 '20 at 13:49

0 Answers0