refactor(info-query): 优化跨天信息和基本信息查询
This commit is contained in:
@@ -22,6 +22,7 @@ public class SqlBuilderTests {
|
||||
private static final String TABLE_INFO_FLINK_JOB_ID = column(TABLE_INFO, "flink_job_id");
|
||||
private static final String TABLE_INFO_ALIAS = column(TABLE_INFO, "alias");
|
||||
private static final String TABLE_INFO_PRIORITY = column(TABLE_INFO, "priority");
|
||||
private static final String TABLE_INFO_STATUS = column(TABLE_INFO, "status");
|
||||
|
||||
private static final Alias TABLE_SYNC_STATE = Alias.of(StrUtil.format("{}.tb_app_hudi_sync_state", DATABASE_NAME), "tahss");
|
||||
private static final String TABLE_SYNC_STATE_ID = column(TABLE_SYNC_STATE, "id");
|
||||
@@ -32,15 +33,10 @@ public class SqlBuilderTests {
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println(SqlFormatter.format(
|
||||
SqlBuilder.select(COUNT)
|
||||
SqlBuilder.select("count(distinct concat(src_schema, src_table))")
|
||||
.from(TABLE_INFO)
|
||||
.whereGe(TABLE_INFO_PRIORITY, 10000)
|
||||
.andNotIn(
|
||||
StrUtil.format("concat({}, {})", TABLE_INFO_FLINK_JOB_ID, TABLE_INFO_ALIAS),
|
||||
SqlBuilder.select(StrUtil.format("concat({}, {})", TABLE_VERSION_FLINK_JOB_ID, TABLE_VERSION_ALIAS))
|
||||
.from(TABLE_VERSION)
|
||||
.whereEq(TABLE_VERSION_VERSION, "20230611")
|
||||
)
|
||||
.andEq(TABLE_INFO_STATUS, "y")
|
||||
.build()
|
||||
));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user