|
@@ -126,95 +126,96 @@ public class BatchSinkHour extends RichSinkFunction<CostHourDM> {
|
|
|
"?,?,?,?,?,?,?,?,?,?,\n" +
|
|
|
"?,?,?,?,?,?,?,?)";
|
|
|
PreparedStatement preparedStatement = connection.prepareStatement(sql);
|
|
|
- preparedStatement.setString(1, costhour.dt);
|
|
|
- preparedStatement.setString(2, costhour.createTime);
|
|
|
- preparedStatement.setString(3, costhour.hour);
|
|
|
- preparedStatement.setString(4, costhour.adId);
|
|
|
- preparedStatement.setString(5, costhour.adgroupId);
|
|
|
- preparedStatement.setString(6, costhour.adcreativeId);
|
|
|
- preparedStatement.setString(7, costhour.accountId);
|
|
|
- preparedStatement.setString(8, costhour.campaignId);
|
|
|
- preparedStatement.setLong(9, costhour.costTotal);
|
|
|
- preparedStatement.setLong(10, costhour.costDay);
|
|
|
- preparedStatement.setLong(11, costhour.costHour);
|
|
|
- preparedStatement.setLong(12, costhour.costDiff);
|
|
|
- preparedStatement.setLong(13, costhour.costLastHour);
|
|
|
- preparedStatement.setLong(14, costhour.costLastHourDiff);
|
|
|
- preparedStatement.setLong(15, costhour.costLastTwoHour);
|
|
|
- preparedStatement.setLong(16, costhour.costLastTwoHourDiff);
|
|
|
- preparedStatement.setLong(17, costhour.costLastThreeTrend);
|
|
|
- preparedStatement.setDouble(18, costhour.costSpeed);
|
|
|
- preparedStatement.setLong(19, costhour.viewCountTotal);
|
|
|
- preparedStatement.setLong(20, costhour.viewCountDay);
|
|
|
- preparedStatement.setLong(21, costhour.viewCountHour);
|
|
|
- preparedStatement.setLong(22, costhour.thousandDisplayPriceAll);
|
|
|
- preparedStatement.setLong(23, costhour.thousandDisplayPriceDay);
|
|
|
- preparedStatement.setLong(24, costhour.thousandDisplayPriceHour);
|
|
|
- preparedStatement.setLong(25, costhour.validClickCountTotal);
|
|
|
- preparedStatement.setLong(26, costhour.validClickCountDay);
|
|
|
- preparedStatement.setLong(27, costhour.validClickCountHour);
|
|
|
- preparedStatement.setDouble(28, costhour.ctrAll);
|
|
|
- preparedStatement.setDouble(29, costhour.ctrDay);
|
|
|
- preparedStatement.setDouble(30, costhour.ctrHour);
|
|
|
- preparedStatement.setLong(31, costhour.cpcAll);
|
|
|
- preparedStatement.setLong(32, costhour.cpcDay);
|
|
|
- preparedStatement.setLong(33, costhour.cpcHour);
|
|
|
- preparedStatement.setLong(34, costhour.conversionsCountTotal);
|
|
|
- preparedStatement.setLong(35, costhour.conversionsCountDay);
|
|
|
- preparedStatement.setLong(36, costhour.conversionsCountHour);
|
|
|
- preparedStatement.setLong(37, costhour.conversionsCostTotal);
|
|
|
- preparedStatement.setLong(38, costhour.conversionsCostDay);
|
|
|
- preparedStatement.setLong(39, costhour.conversionsCostHour);
|
|
|
- preparedStatement.setDouble(40, costhour.conversionsRateAll);
|
|
|
- preparedStatement.setDouble(41, costhour.conversionsRateDay);
|
|
|
- preparedStatement.setDouble(42, costhour.conversionsRateHour);
|
|
|
- preparedStatement.setDouble(43, costhour.firstDayOrderRoiTotal);
|
|
|
- preparedStatement.setDouble(44, costhour.firstDayOrderRoiDay);
|
|
|
- preparedStatement.setDouble(45, costhour.firstDayOrderRoiHour);
|
|
|
- preparedStatement.setLong(46, costhour.firstDayOrderAmountTotal);
|
|
|
- preparedStatement.setLong(47, costhour.firstDayOrderAmountDay);
|
|
|
- preparedStatement.setLong(48, costhour.firstDayOrderAmountHour);
|
|
|
- preparedStatement.setLong(49, costhour.firstDayOrderCountTotal);
|
|
|
- preparedStatement.setLong(50, costhour.firstDayOrderCountDay);
|
|
|
- preparedStatement.setLong(51, costhour.firstDayOrderCountHour);
|
|
|
- preparedStatement.setLong(52, costhour.webOrderAmountTotal);
|
|
|
- preparedStatement.setLong(53, costhour.webOrderAmountDay);
|
|
|
- preparedStatement.setLong(54, costhour.webOrderAmountHour);
|
|
|
- preparedStatement.setLong(55, costhour.webOrderCostTotal);
|
|
|
- preparedStatement.setLong(56, costhour.webOrderCostDay);
|
|
|
- preparedStatement.setLong(57, costhour.webOrderCostHour);
|
|
|
- preparedStatement.setDouble(58, costhour.webOrderRateTotal);
|
|
|
- preparedStatement.setDouble(59, costhour.webOrderRateDay);
|
|
|
- preparedStatement.setDouble(60, costhour.webOrderRateHour);
|
|
|
- preparedStatement.setLong(61, costhour.webOrderCountTotal);
|
|
|
- preparedStatement.setLong(62, costhour.webOrderCountDay);
|
|
|
- preparedStatement.setLong(63, costhour.webOrderCountHour);
|
|
|
- preparedStatement.setDouble(64, costhour.orderRoiTotal);
|
|
|
- preparedStatement.setDouble(65, costhour.orderRoiDay);
|
|
|
- preparedStatement.setDouble(66, costhour.orderRoiHour);
|
|
|
- preparedStatement.setLong(67, costhour.orderUnitPriceTotal);
|
|
|
- preparedStatement.setLong(68, costhour.orderUnitPriceDay);
|
|
|
- preparedStatement.setLong(69, costhour.orderUnitPriceHour);
|
|
|
- preparedStatement.setLong(70, costhour.fromFollowUvTotal);
|
|
|
- preparedStatement.setLong(71, costhour.fromFollowUvDay);
|
|
|
- preparedStatement.setLong(72, costhour.fromFollowUvHour);
|
|
|
- preparedStatement.setLong(73, costhour.fromFollowCostTotal);
|
|
|
- preparedStatement.setLong(74, costhour.fromFollowCostDay);
|
|
|
- preparedStatement.setLong(75, costhour.fromFollowCostHour);
|
|
|
- preparedStatement.setDouble(76, costhour.fromFollowRateTotal);
|
|
|
- preparedStatement.setDouble(77, costhour.fromFollowRateDay);
|
|
|
- preparedStatement.setDouble(78, costhour.fromFollowRateHour);
|
|
|
- preparedStatement.setLong(79, costhour.webRegisterCountTotal);
|
|
|
- preparedStatement.setLong(80, costhour.webRegisterCountDay);
|
|
|
- preparedStatement.setLong(81, costhour.webRegisterCountHour);
|
|
|
- preparedStatement.setLong(82, costhour.webRegisterUvTotal);
|
|
|
- preparedStatement.setLong(83, costhour.webRegisterUvDay);
|
|
|
- preparedStatement.setLong(84, costhour.webRegisterUvHour);
|
|
|
- preparedStatement.setDouble(85, costhour.webRegisterCostTotal);
|
|
|
- preparedStatement.setDouble(86, costhour.webRegisterCostDay);
|
|
|
- preparedStatement.setDouble(87, costhour.webRegisterCostHour);
|
|
|
- preparedStatement.setString(88, costhour.agencyAccountId);
|
|
|
+ preparedStatement.setString(1, costhour.getDt());
|
|
|
+ preparedStatement.setString(2, costhour.getCreateTime());
|
|
|
+ preparedStatement.setString(3, costhour.getHour());
|
|
|
+ preparedStatement.setString(4, costhour.getAdId());
|
|
|
+ preparedStatement.setString(5, costhour.getAdgroupId());
|
|
|
+ preparedStatement.setString(6, costhour.getAdcreativeId());
|
|
|
+ preparedStatement.setString(7, costhour.getAccountId());
|
|
|
+ preparedStatement.setString(8, costhour.getCampaignId());
|
|
|
+ preparedStatement.setLong(9, costhour.getCostTotal());
|
|
|
+ preparedStatement.setLong(10, costhour.getCostDay());
|
|
|
+ preparedStatement.setLong(11, costhour.getCostHour());
|
|
|
+ preparedStatement.setLong(12, costhour.getCostDiff());
|
|
|
+ preparedStatement.setLong(13, costhour.getCostLastHour());
|
|
|
+ preparedStatement.setLong(14, costhour.getCostLastHourDiff());
|
|
|
+ preparedStatement.setLong(15, costhour.getCostLastTwoHour());
|
|
|
+ preparedStatement.setLong(16, costhour.getCostLastTwoHourDiff());
|
|
|
+ preparedStatement.setLong(17, costhour.getCostLastThreeTrend());
|
|
|
+ preparedStatement.setDouble(18, costhour.getCostSpeed());
|
|
|
+ preparedStatement.setLong(19, costhour.getViewCountTotal());
|
|
|
+ preparedStatement.setLong(20, costhour.getViewCountDay());
|
|
|
+ preparedStatement.setLong(21, costhour.getViewCountHour());
|
|
|
+ preparedStatement.setLong(22, costhour.getThousandDisplayPriceAll());
|
|
|
+ preparedStatement.setLong(23, costhour.getThousandDisplayPriceDay());
|
|
|
+ preparedStatement.setLong(24, costhour.getThousandDisplayPriceHour());
|
|
|
+ preparedStatement.setLong(25, costhour.getValidClickCountTotal());
|
|
|
+ preparedStatement.setLong(26, costhour.getValidClickCountDay());
|
|
|
+ preparedStatement.setLong(27, costhour.getValidClickCountHour());
|
|
|
+ preparedStatement.setDouble(28, costhour.getCtrAll());
|
|
|
+ preparedStatement.setDouble(29, costhour.getCtrDay());
|
|
|
+ preparedStatement.setDouble(30, costhour.getCtrHour());
|
|
|
+ preparedStatement.setLong(31, costhour.getCpcAll());
|
|
|
+ preparedStatement.setLong(32, costhour.getCpcDay());
|
|
|
+ preparedStatement.setLong(33, costhour.getCpcHour());
|
|
|
+ preparedStatement.setLong(34, costhour.getConversionsCountTotal());
|
|
|
+ preparedStatement.setLong(35, costhour.getConversionsCountDay());
|
|
|
+ preparedStatement.setLong(36, costhour.getConversionsCountHour());
|
|
|
+ preparedStatement.setLong(37, costhour.getConversionsCostTotal());
|
|
|
+ preparedStatement.setLong(38, costhour.getConversionsCostDay());
|
|
|
+ preparedStatement.setLong(39, costhour.getConversionsCostHour());
|
|
|
+ preparedStatement.setDouble(40, costhour.getConversionsRateAll());
|
|
|
+ preparedStatement.setDouble(41, costhour.getConversionsRateDay());
|
|
|
+ preparedStatement.setDouble(42, costhour.getConversionsRateHour());
|
|
|
+ preparedStatement.setDouble(43, costhour.getFirstDayOrderRoiTotal());
|
|
|
+ preparedStatement.setDouble(44, costhour.getFirstDayOrderRoiDay());
|
|
|
+ preparedStatement.setDouble(45, costhour.getFirstDayOrderRoiHour());
|
|
|
+ preparedStatement.setLong(46, costhour.getFirstDayOrderAmountTotal());
|
|
|
+ preparedStatement.setLong(47, costhour.getFirstDayOrderAmountDay());
|
|
|
+ preparedStatement.setLong(48, costhour.getFirstDayOrderAmountHour());
|
|
|
+ preparedStatement.setLong(49, costhour.getFirstDayOrderCountTotal());
|
|
|
+ preparedStatement.setLong(50, costhour.getFirstDayOrderCountDay());
|
|
|
+ preparedStatement.setLong(51, costhour.getFirstDayOrderCountHour());
|
|
|
+ preparedStatement.setLong(52, costhour.getWebOrderAmountTotal());
|
|
|
+ preparedStatement.setLong(53, costhour.getWebOrderAmountDay());
|
|
|
+ preparedStatement.setLong(54, costhour.getWebOrderAmountHour());
|
|
|
+ preparedStatement.setLong(55, costhour.getWebOrderCostTotal());
|
|
|
+ preparedStatement.setLong(56, costhour.getWebOrderCostDay());
|
|
|
+ preparedStatement.setLong(57, costhour.getWebOrderCostHour());
|
|
|
+ preparedStatement.setDouble(58, costhour.getWebOrderRateTotal());
|
|
|
+ preparedStatement.setDouble(59, costhour.getWebOrderRateDay());
|
|
|
+ preparedStatement.setDouble(60, costhour.getWebOrderRateHour());
|
|
|
+ preparedStatement.setLong(61, costhour.getWebOrderCountTotal());
|
|
|
+ preparedStatement.setLong(62, costhour.getWebOrderCountDay());
|
|
|
+ preparedStatement.setLong(63, costhour.getWebOrderCountHour());
|
|
|
+ preparedStatement.setDouble(64, costhour.getOrderRoiTotal());
|
|
|
+ preparedStatement.setDouble(65, costhour.getOrderRoiDay());
|
|
|
+ preparedStatement.setDouble(66, costhour.getOrderRoiHour());
|
|
|
+ preparedStatement.setLong(67, costhour.getOrderUnitPriceTotal());
|
|
|
+ preparedStatement.setLong(68, costhour.getOrderUnitPriceDay());
|
|
|
+ preparedStatement.setLong(69, costhour.getOrderUnitPriceHour());
|
|
|
+ preparedStatement.setLong(70, costhour.getFromFollowUvTotal());
|
|
|
+ preparedStatement.setLong(71, costhour.getFromFollowUvDay());
|
|
|
+ preparedStatement.setLong(72, costhour.getFromFollowUvHour());
|
|
|
+ preparedStatement.setLong(73, costhour.getFromFollowCostTotal());
|
|
|
+ preparedStatement.setLong(74, costhour.getFromFollowCostDay());
|
|
|
+ preparedStatement.setLong(75, costhour.getFromFollowCostHour());
|
|
|
+ preparedStatement.setDouble(76, costhour.getFromFollowRateTotal());
|
|
|
+ preparedStatement.setDouble(77, costhour.getFromFollowRateDay());
|
|
|
+ preparedStatement.setDouble(78, costhour.getFromFollowRateHour());
|
|
|
+ preparedStatement.setLong(79, costhour.getWebRegisterCountTotal());
|
|
|
+ preparedStatement.setLong(80, costhour.getWebRegisterCountDay());
|
|
|
+ preparedStatement.setLong(81, costhour.getWebRegisterCountHour());
|
|
|
+ preparedStatement.setLong(82, costhour.getWebRegisterUvTotal());
|
|
|
+ preparedStatement.setLong(83, costhour.getWebRegisterUvDay());
|
|
|
+ preparedStatement.setLong(84, costhour.getWebRegisterUvHour());
|
|
|
+ preparedStatement.setDouble(85, costhour.getWebRegisterCostTotal());
|
|
|
+ preparedStatement.setDouble(86, costhour.getWebRegisterCostDay());
|
|
|
+ preparedStatement.setDouble(87, costhour.getWebRegisterCostHour());
|
|
|
+ preparedStatement.setString(88, costhour.getAgencyAccountId());
|
|
|
preparedStatement.addBatch();
|
|
|
+ preparedStatement.executeBatch();
|
|
|
connection.commit();
|
|
|
//clickhouse 处理重复数据
|
|
|
//TODO:数据去重有问题,去除掉非最新的数据
|
|
@@ -222,7 +223,6 @@ public class BatchSinkHour extends RichSinkFunction<CostHourDM> {
|
|
|
// String sql_duplicate = "optimize table data_monitoring.cost_hour final;";
|
|
|
// statement_duplicate.executeQuery(sql_duplicate);
|
|
|
// connection.commit();
|
|
|
- long endTime_dp = System.currentTimeMillis();
|
|
|
|
|
|
}
|
|
|
|