@@ -0,0 +1,1210 @@
+/**%0A * Illustrates loading data from Hive with Spark SQL%0A */%0Apackage com.oreilly.learningsparkexamples.java;%0A%0Aimport java.io.StringReader;%0Aimport java.util.Arrays;%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0Aimport scala.Tuple2;%0A%0Aimport au.com.bytecode.opencsv.CSVReader;%0A%0Aimport org.apache.commons.lang.StringUtils;%0Aimport org.apache.spark.api.java.JavaRDD;%0Aimport org.apache.spark.api.java.JavaPairRDD;%0Aimport org.apache.spark.api.java.JavaSparkContext;%0Aimport org.apache.spark.api.java.function.FlatMapFunction;%0Aimport org.apache.spark.api.java.function.Function;%0Aimport org.apache.spark.sql.api.java.JavaSQLContext;%0Aimport org.apache.spark.sql.api.java.Row;%0Aimport org.apache.spark.sql.api.java.JavaSchemaRDD;%0A%0Apublic class LoadJsonWithSparkSQL %7B%0A%0A%0A  public static void main(String%5B%5D args) throws Exception %7B%0A%09%09if (args.length != 3) %7B%0A      throw new Exception(%22Usage LoadJsonWithSparkSQL sparkMaster jsonFile%22);%0A%09%09%7D%0A    String master = args%5B0%5D;%0A    String jsonFile = args%5B1%5D;%0A%0A%09%09JavaSparkContext sc = new JavaSparkContext(%0A      master, %22loadJsonwithsparksql%22);%0A    JavaSQLContext sqlCtx = new JavaSQLContext(sc);%0A    JavaSchemaRDD input = sqlCtx.jsonFile(jsonFile);%0A    input.printSchema();%0A  %7D%0A%7D%0A

add java version