@@ -60,7 +60,7 @@ int ObInnerTableSchema::dba_ob_kv_ttl_tasks_schema(ObTableSchema &table_schema)
table_schema.set_create_mem_version(1);
if(OB_SUCC(ret)){
if(OB_FAIL(table_schema.set_view_definition(R"__( SELECT b.table_name as TABLE_NAME, a.table_id as TABLE_ID, a.partition_id as PARTITION_ID, usec_to_time(a.task_start_time) as START_TIME, usec_to_time(a.task_update_time) as END_TIME, case a.trigger_type when 0 then "PERIODIC" when 1 then "USER" else "INVALID" END AS TRIGGER_TYPE, case a.status when 0 then "PREPARED" when 1 then "RUNNING" when 2 then "PENDING" when 3 then "CANCELED" when 4 then "FINISHED" when 5 then "MOVED" when 15 then "RS_TRIGGERING" when 16 then "RS_SUSPENDING" when 17 then "RS_CANCELING" when 18 then "RS_MOVING" when 47 then "RS_TRIGGERD" when 48 then "RS_SUSPENDED" when 49 then "RS_CANCELED" when 50 then "RS_MOVED" else "INVALID" END AS STATUS, a.ttl_del_cnt as TTL_DEL_CNT, a.max_version_del_cnt as MAX_VERSION_DEL_CNT, a.scan_cnt as SCAN_CNT, a.ret_code as RET_CODE FROM oceanbase.__all_kv_ttl_task a left outer JOIN oceanbase.__all_table_v2 b on a.table_id = ((a.tenant_id << 40) | b.table_id) )__"))){
if(OB_FAIL(table_schema.set_view_definition(R"__( SELECT b.table_name as TABLE_NAME, a.table_id as TABLE_ID, a.partition_id as PARTITION_ID, a.task_id as TASK_ID, usec_to_time(a.task_start_time) as START_TIME, usec_to_time(a.task_update_time) as END_TIME, case a.trigger_type when 0 then "PERIODIC" when 1 then "USER" else "INVALID" END AS TRIGGER_TYPE, case a.status when 0 then "PREPARED" when 1 then "RUNNING" when 2 then "PENDING" when 3 then "CANCELED" when 4 then "FINISHED" when 5 then "MOVED" when 15 then "RS_TRIGGERING" when 16 then "RS_SUSPENDING" when 17 then "RS_CANCELING" when 18 then "RS_MOVING" when 47 then "RS_TRIGGERD" when 48 then "RS_SUSPENDED" when 49 then "RS_CANCELED" when 50 then "RS_MOVED" else "INVALID" END AS STATUS, a.ttl_del_cnt as TTL_DEL_CNT, a.max_version_del_cnt as MAX_VERSION_DEL_CNT, a.scan_cnt as SCAN_CNT, a.ret_code as RET_CODE FROM oceanbase.__all_kv_ttl_task a left outer JOIN oceanbase.__all_table_v2 b on a.table_id = ((a.tenant_id << 40) | b.table_id) )__"))){
LOG_ERROR("fail to set view_definition",K(ret));
}
}
...
...
@@ -112,7 +112,111 @@ int ObInnerTableSchema::dba_ob_kv_ttl_task_history_schema(ObTableSchema &table_s
table_schema.set_create_mem_version(1);
if(OB_SUCC(ret)){
if(OB_FAIL(table_schema.set_view_definition(R"__( SELECT b.table_name as TABLE_NAME, a.table_id as TABLE_ID, a.partition_id as PARTITION_ID, usec_to_time(a.task_start_time) as START_TIME, usec_to_time(a.task_update_time) as END_TIME, case a.trigger_type when 0 then "PERIODIC" when 1 then "USER" else "INVALID" END AS TRIGGER_TYPE, case a.status when 0 then "PREPARED" when 1 then "RUNNING" when 2 then "PENDING" when 3 then "CANCELED" when 4 then "FINISHED" when 5 then "MOVED" else "INVALID" END AS STATUS, a.ttl_del_cnt as TTL_DEL_CNT, a.max_version_del_cnt as MAX_VERSION_DEL_CNT, a.scan_cnt as SCAN_CNT, a.ret_code as RET_CODE FROM oceanbase.__all_kv_ttl_task_history a left outer JOIN oceanbase.__all_table_v2 b on a.table_id = ((a.tenant_id << 40) | b.table_id) )__"))){
if(OB_FAIL(table_schema.set_view_definition(R"__( SELECT b.table_name as TABLE_NAME, a.table_id as TABLE_ID, a.partition_id as PARTITION_ID, a.task_id as TASK_ID, usec_to_time(a.task_start_time) as START_TIME, usec_to_time(a.task_update_time) as END_TIME, case a.trigger_type when 0 then "PERIODIC" when 1 then "USER" else "INVALID" END AS TRIGGER_TYPE, case a.status when 0 then "PREPARED" when 1 then "RUNNING" when 2 then "PENDING" when 3 then "CANCELED" when 4 then "FINISHED" when 5 then "MOVED" else "INVALID" END AS STATUS, a.ttl_del_cnt as TTL_DEL_CNT, a.max_version_del_cnt as MAX_VERSION_DEL_CNT, a.scan_cnt as SCAN_CNT, a.ret_code as RET_CODE FROM oceanbase.__all_kv_ttl_task_history a left outer JOIN oceanbase.__all_table_v2 b on a.table_id = ((a.tenant_id << 40) | b.table_id) )__"))){
if(OB_FAIL(table_schema.set_view_definition(R"__( SELECT a.tenant_id as TENANT_ID, b.table_name as TABLE_NAME, a.table_id as TABLE_ID, a.partition_id as PARTITION_ID, a.task_id as TASK_ID, usec_to_time(a.task_start_time) as START_TIME, usec_to_time(a.task_update_time) as END_TIME, case a.trigger_type when 0 then "PERIODIC" when 1 then "USER" else "INVALID" END AS TRIGGER_TYPE, case a.status when 0 then "PREPARED" when 1 then "RUNNING" when 2 then "PENDING" when 3 then "CANCELED" when 4 then "FINISHED" when 5 then "MOVED" when 15 then "RS_TRIGGERING" when 16 then "RS_SUSPENDING" when 17 then "RS_CANCELING" when 18 then "RS_MOVING" when 47 then "RS_TRIGGERD" when 48 then "RS_SUSPENDED" when 49 then "RS_CANCELED" when 50 then "RS_MOVED" else "INVALID" END AS STATUS, a.ttl_del_cnt as TTL_DEL_CNT, a.max_version_del_cnt as MAX_VERSION_DEL_CNT, a.scan_cnt as SCAN_CNT, a.ret_code as RET_CODE FROM oceanbase.__all_virtual_kv_ttl_task a left outer JOIN oceanbase.__all_virtual_table b on a.table_id = b.table_id and a.tenant_id = b.tenant_id )__"))){
if(OB_FAIL(table_schema.set_view_definition(R"__( SELECT a.tenant_id as TENANT_ID, b.table_name as TABLE_NAME, a.table_id as TABLE_ID, a.partition_id as PARTITION_ID, a.task_id as TASK_ID, usec_to_time(a.task_start_time) as START_TIME, usec_to_time(a.task_update_time) as END_TIME, case a.trigger_type when 0 then "PERIODIC" when 1 then "USER" else "INVALID" END AS TRIGGER_TYPE, case a.status when 0 then "PREPARED" when 1 then "RUNNING" when 2 then "PENDING" when 3 then "CANCELED" when 4 then "FINISHED" when 5 then "MOVED" else "INVALID" END AS STATUS, a.ttl_del_cnt as TTL_DEL_CNT, a.max_version_del_cnt as MAX_VERSION_DEL_CNT, a.scan_cnt as SCAN_CNT, a.ret_code as RET_CODE FROM oceanbase.__all_virtual_kv_ttl_task_history a left outer JOIN oceanbase.__all_virtual_table b on a.table_id = b.table_id and a.tenant_id = b.tenant_id )__"))){