vendredi 7 octobre 2016

Scala Reflection: how to get class given String name of the class

I read a few posts on Scala Reflection. e.g. http://ift.tt/1tqvAq4

In my case, I want to see if given class name can be instantiated. e.g. org.apache.spark.sql.catalyst.SqlLexical

I cannot directly use SqlLexical (defined in Spark 1.6) because the runtime may be Spark 2.0

How can I retrieve the class given the String classname ?

Thanks





Aucun commentaire:

Enregistrer un commentaire