|
|
@@ -213,7 +213,7 @@ public class MaterialQualitySyncJob {
|
|
|
.append("WHERE dt >= '").append(start).append("' AND dt <= '").append(end).append("'\n");
|
|
|
|
|
|
if (creativeStatus != null && !creativeStatus.isEmpty()) {
|
|
|
- sql.append(" AND `创意状态` = '").append(creativeStatus).append("'\n");
|
|
|
+ sql.append(" AND `创意状态` = '").append(creativeStatus.replace("'", "''")).append("'\n");
|
|
|
}
|
|
|
|
|
|
sql.append("GROUP BY `创意id`\n")
|
|
|
@@ -250,10 +250,15 @@ public class MaterialQualitySyncJob {
|
|
|
+ "WHERE dt >= '" + start + "' AND dt <= '" + end + "'";
|
|
|
log.info("探针-范围 SQL (dt >= {}, dt <= {}): {}", start, end, rangeSql);
|
|
|
try {
|
|
|
+ long[] rowCount = {0};
|
|
|
OdpsUtil.getOdpsDataStream(rangeSql, record -> {
|
|
|
- long total = record.getBigint("total") != null ? record.getBigint("total") : 0;
|
|
|
- log.info(" 时间范围行数: {}", total);
|
|
|
+ rowCount[0] = record.getBigint("total") != null ? record.getBigint("total") : 0;
|
|
|
+ log.info(" 时间范围行数: {}", rowCount[0]);
|
|
|
});
|
|
|
+ if (rowCount[0] == 0) {
|
|
|
+ log.warn("探针-范围:时间范围内无数据, dt=[{}, {}]", start, end);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
} catch (Exception e) {
|
|
|
log.error("探针-范围 查询失败: {}", e.getMessage(), e);
|
|
|
return false;
|