Commit 224949ac authored by data爬虫-冯 军凯's avatar data爬虫-冯 军凯

transactionLog 数据清洗 main类修改1234567

parent 05f4eaa2
...@@ -28,10 +28,11 @@ public class CleanningTransactionLogMain { ...@@ -28,10 +28,11 @@ public class CleanningTransactionLogMain {
Dataset<String> dataset = ss.read().textFile(hdfsArr); Dataset<String> dataset = ss.read().textFile(hdfsArr);
dataset.repartition(4).foreachPartition(func -> { dataset.repartition(4).foreachPartition(func -> {
System.out.println("开始执行数据清洗");
ArrayList<TransactionLog> transactionLogs = new ArrayList<>(); ArrayList<TransactionLog> transactionLogs = new ArrayList<>();
String sql = "INSERT INTO `call_record` (`request_url`, `transaction_id`, `uuid`, `url_type`, `code`, `created_at`, `updated_at`) VALUES (?,?,?,?,?,?,?)"; String sql = "INSERT INTO `call_record` (`request_url`, `transaction_id`, `uuid`, `url_type`, `code`, `created_at`, `updated_at`) VALUES (?,?,?,?,?,?,?)";
func.forEachRemaining(item -> { func.forEachRemaining(item -> {
System.out.println("单条数据清洗");
try { try {
String[] split = item.split("\t"); String[] split = item.split("\t");
TransactionLog transactionLog = new TransactionLog(); TransactionLog transactionLog = new TransactionLog();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment