1. 创建临时function (这里两个包都是hive自带的,不需要自己开发的,可以根据名称查找对应的版本) add jar /opt/local/hive/lib/hive-contrib-.jar; add jar /opt/local/hive/lib/mysql-connector-java--bin.jar; CREATE TEMPORARY FUNCTION dboutput AS 'org.apache.hadoop.hive.contrib.genericudf.example…
背景:根据业务需要需要把60张主子表批量入库到hive表. 创建测试数据: def createBatchTestFile(): Unit = { to ) { val sWriter = new PrintWriter(new File("D:\\server_" + layer + ".txt")) val nWriter = new PrintWriter(new File("D:\\neighour_" + layer + ".…