HiveContext hiveCtx = new HiveContext(jsc);
hiveCtx.sql("use xx");//xx为Hive分配给部门的权限
Dataset<Row> rows = hiveCtx.sql("select * from xx.table_name where ds = 'dd'");
JavaPairRDD<String, String> jpair = rows.javaRDD().mapPartitionsToPair(new PairFlatMapFunction<Iterator<Row>, String, String>(){
public Iterator<Tuple2<String, String>> call(Iterator<Row> rows) throws Exception {
List<Tuple2<String, String>> resultList=new ArrayList<Tuple2<String, String>>();
while (rows.hasNext()) {
try{
Row row= rows.next();