You need to add the Datanucleus jars explicitly. Please try:
$ ./bin/spark-submit –class org.apache.spark.examples.sql.hive.HiveFromSpark –master yarn-cluster –num-executors 2 –driver-memory 512m –executor-memory 512m –executor-cores 1 –jars lib/datanucleus-api-jdo-3.2.6.jar,lib/datanucleus-rdbms-3.2.9.jar,lib/datanucleus-core-3.2.10.jar lib/spark-examples*.jar
Alternatively, you can run in the yarn-client mode:
$ ./bin/spark-submit –class org.apache.spark.examples.sql.hive.HiveFromSpark –master yarn-client –num-executors 2 –driver-memory 512m –executor-memory 512m –executor-cores 1 lib/spark-examples*.jar