Skip to content

Commit

Permalink
[improvement](show) make show cache hotspot like others (apache#41322)
Browse files Browse the repository at this point in the history
  • Loading branch information
dataroaring authored and cjj2010 committed Oct 12, 2024
1 parent bd1dcf0 commit 81df77f
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,9 @@ private String generateQueryString() {
+ "sum(query_per_week) as query_per_week_total "
+ "FROM " + TABLE_NAME.toString()
+ " group by cluster_id, cluster_name, table_id, table_name, insert_day) ");
StringBuilder q2 = new StringBuilder("select cluster_id as compute_group_id, "
+ "cluster_name as compute_group_name, "
+ "table_id, table_name as hot_table_name from (select row_number() "
StringBuilder q2 = new StringBuilder("select cluster_id as ComputeGroupId, "
+ "cluster_name as ComputeGroupName, "
+ "table_id as TableId, table_name as TableName from (select row_number() "
+ "over (partition by cluster_id order by insert_day desc, "
+ "query_per_day_total desc, query_per_week_total desc) as dr2, "
+ "* from t1) t2 where dr2 = 1;");
Expand All @@ -145,14 +145,14 @@ private String generateQueryString() {
+ " where " + whereExpr.get(0)
+ "group by cluster_id, cluster_name, table_id, "
+ "table_name, partition_id, partition_name, insert_day)");
StringBuilder q2 = new StringBuilder("select table_id, table_name, "
+ "partition_id, partition_name as hot_partition_name from (select row_number() "
StringBuilder q2 = new StringBuilder("select table_id as TableId, table_name as TableName, "
+ "partition_id as PartitionId, partition_name as PartitionName from (select row_number() "
+ "over (partition by cluster_id, table_id order by insert_day desc, "
+ "query_per_day_total desc, query_per_week_total desc) as dr2, "
+ "* from t1) t2 where dr2 = 1;");
query = q1.append(q2);
} else if (metaDataPos == 2) {
query = new StringBuilder("select partition_id, partition_name "
query = new StringBuilder("select partition_id as PartitionId, partition_name as PartitionName"
+ "FROM " + TABLE_NAME.toString()
+ " where " + whereExpr.get(0)
+ " and " + whereExpr.get(1)
Expand Down

0 comments on commit 81df77f

Please sign in to comment.