score:3

Accepted answer

in your other question i said

and supplying the canbuildfrom argument from java is... technically possible, but not something you want to do.

unfortunately, for typetag it's even less possible: unlike canbuildfrom, they aren't supplied by a library, but built into scala compiler.

the best advice i can give is to create a scala file supplying the type tags you need to use from java, since you only should need a limited number of them:

object typetags {
  val seqinteger = typetag[seq[integer]]
  ...
  // or 
  val integer = typetag[integer]
  def seq[a](implicit tt: typetag[a]) = typetag[seq[a]]
}

and then from java typetags.seqinteger or typetags.seq(typetags.integer).

in other places spark provides special api for use from java (look for .java packages), but i couldn't find one for functions.typedlit.


Related Query

More Query from same tag