Commit f0c963b1 by WangJinfeng

update lazada_rtdmp,fix RTDmpFetch

parent bcad12be
......@@ -161,7 +161,7 @@ public class RTDmpFetch {
} catch (InterruptedException e) {
LOGGER.info(e.getMessage());
}
kv = mySqlUtil.getPartitionTime("dwh", " audience_merge_v1");
kv = mySqlUtil.getPartitionTime("dwh", "audience_merge_v1");
dt = DateUtil.format(DateUtil.parse(kv.getK().substring(0, 8), "yyyyMMdd"), "yyyy-MM-dd");
hour = kv.getK().substring(8, 10);
utime = kv.getV();
......@@ -192,7 +192,7 @@ public class RTDmpFetch {
String sql = buildSql(dt, hour, jsonObject)
.replace("@key", "device_type")
.replace("@table", " audience_merge_v1_all") + " GROUP BY device_type";
.replace("@table", "audience_merge_v1_all") + " GROUP BY device_type";
LOGGER.info("checkDeviceType -->> audienceId:" + audienceId + ", sql -->>" + sql);
ClickHouseDataSource dataSource0 = new ClickHouseDataSource(URL.replace("host", ips0[random0]), properties);
......@@ -219,7 +219,7 @@ public class RTDmpFetch {
sql = buildSql(dt, hour, jsonObject)
.replace("@key", "COUNT(1) counts")
.replace("@table", " audience_merge_v1_all");
.replace("@table", "audience_merge_v1_all");
int counts = 0;
try {
connection0 = dataSource0.getConnection();
......@@ -242,7 +242,7 @@ public class RTDmpFetch {
for (String devType : devTypeSet) {
sql = buildSql(dt, hour, jsonObject)
.replace("@key", "devid")
.replace("@table", " audience_merge_v1") + " AND device_type = '" + devType + "'";
.replace("@table", "audience_merge_v1") + " AND device_type = '" + devType + "'";
LOGGER.info("checkDeviceId -->> audienceId:" + audienceId + ",sql -->> " + sql);
for (int i = 0; i < SET_VALUES.length; i++) {
......
......@@ -143,13 +143,13 @@ public class MySQLUtil {
}
public static void main(String[] args) {
KV kv = getPartitionTime("dwh", " audience_merge_v1");
KV kv = getPartitionTime("dwh", "audience_merge_v1");
long nowTime = DateUtil.parse(DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss"), "yyyy-MM-dd HH:mm:ss").getTime() / 1000;
System.out.println(kv.getV());
System.out.println(Long.parseLong(kv.getV()) > nowTime - 1200);
// System.out.println(getLastPartition("dwh", " audience_merge_v1"));
// System.out.println(update("dwh", " audience_merge_v1", "2021072913"));
// System.out.println(getLastPartition("dwh", "audience_merge_v1"));
// System.out.println(update("dwh", "audience_merge_v1", "2021072913"));
}
}
\ No newline at end of file
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