-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #555 from Kabimon/dev-1.2.0
[Feature][datamodel][dataassets][datawarehouse] Fusion linkis1.0.3
- Loading branch information
Showing
52 changed files
with
986 additions
and
1,038 deletions.
There are no files selected for viewing
1 change: 0 additions & 1 deletion
1
...t/src/main/scala/com/webank/wedatasphere/dss/data/governance/DataAssetsRemoteClient.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
...scala/com/webank/wedatasphere/dss/data/governance/impl/LinkisDataAssetsRemoteClient.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
...-server/src/main/java/com/webank/wedatasphere/dss/data/governance/dao/PartInfoMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.webank.wedatasphere.dss.data.governance.dao; | ||
|
||
|
||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
import com.webank.wedatasphere.dss.data.governance.entity.PartInfo; | ||
import org.apache.ibatis.annotations.Param; | ||
import org.apache.ibatis.annotations.Select; | ||
import java.util.List; | ||
|
||
public interface PartInfoMapper extends BaseMapper<PartInfo> { | ||
|
||
String sql = "select b.PART_NAME,b.CREATE_TIME,\n" + | ||
" MAX(CASE c.PARAM_KEY WHEN 'transient_lastDdlTime' THEN c.PARAM_VALUE ELSE null END) last_access_time ,\n" + | ||
" MAX(CASE c.PARAM_KEY WHEN 'numRows' THEN c.PARAM_VALUE ELSE null END) reord_cnt,\n" + | ||
" MAX(CASE c.PARAM_KEY WHEN 'totalSize' THEN c.PARAM_VALUE ELSE null END) store,\n" + | ||
" MAX(CASE c.PARAM_KEY WHEN 'numFiles' THEN c.PARAM_VALUE ELSE null END) file_count\n" + | ||
" from TBLS a,PARTITIONS b,PARTITION_PARAMS c,DBS d \n" + | ||
" where a.TBL_NAME= #{tableName} AND d.NAME= #{dbName} AND a.TBL_ID=b.TBL_ID AND a.DB_ID=d.DB_ID AND b.PART_ID=c.PART_ID \n" + | ||
" GROUP BY c.PART_ID"; | ||
@Select(sql) | ||
List<PartInfo> query(@Param("dbName") String dbName, @Param("tableName") String tableName) ; | ||
|
||
} |
36 changes: 36 additions & 0 deletions
36
...src/main/java/com/webank/wedatasphere/dss/data/governance/dao/TableStorageInfoMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package com.webank.wedatasphere.dss.data.governance.dao; | ||
|
||
import com.baomidou.mybatisplus.core.conditions.Wrapper; | ||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
import com.baomidou.mybatisplus.core.toolkit.Constants; | ||
import com.webank.wedatasphere.dss.data.governance.entity.TableInfo; | ||
import org.apache.ibatis.annotations.Param; | ||
import org.apache.ibatis.annotations.Select; | ||
import java.util.List; | ||
|
||
public interface TableStorageInfoMapper extends BaseMapper<TableInfo> { | ||
|
||
//普通表获取表名和存储量 | ||
String sql= "select CONCAT(DBS.NAME, '.', TBLS.TBL_NAME) AS table_name, CASE WHEN TABLE_PARAMS.PARAM_KEY = 'totalSize' THEN TABLE_PARAMS.PARAM_VALUE ELSE 0 END as totalSize\n" + | ||
"from DBS, TBLS,TABLE_PARAMS\n" + | ||
"where TBLS.TBL_ID=TABLE_PARAMS.TBL_ID AND TBLS.DB_ID=DBS.DB_ID AND TABLE_PARAMS.PARAM_KEY = 'totalSize'"; | ||
|
||
//分区表获取表名和存储量 | ||
String sql2="select CONCAT(DBS.NAME, '.', TBLS.TBL_NAME) AS table_name,SUM(CASE WHEN PARTITION_PARAMS.PARAM_KEY = 'totalSize' THEN PARTITION_PARAMS.PARAM_VALUE ELSE 0 END) as totalSize\n" + | ||
" from DBS,TBLS,PARTITIONS ,PARTITION_PARAMS \n" + | ||
" where DBS.DB_ID=TBLS.DB_ID AND TBLS.TBL_ID=PARTITIONS.TBL_ID AND PARTITIONS.PART_ID =PARTITION_PARAMS.PART_ID AND PARTITION_PARAMS.PARAM_KEY = 'totalSize'\n" + | ||
" group by table_name"; | ||
|
||
//合并分区表和普通表查询结果,并根据"DB.Table"过滤 | ||
String queryWrapperSql = "select table_name as tableName,totalSize as storage FROM (( " + sql + ")" + " UNION " +"(" + sql2 +")) as q ${ew.customSqlSegment}"; | ||
|
||
//合并分区表和普通表查询结果 | ||
String querySql = "select table_name as tableName,totalSize as storage FROM (( " + sql + ")" + " UNION " +"(" + sql2 +")) as q"; | ||
|
||
@Select(querySql) | ||
List<TableInfo> query(); | ||
|
||
@Select(queryWrapperSql) | ||
List<TableInfo> queryByTableName(@Param(Constants.WRAPPER) Wrapper queryWrapper); | ||
|
||
} |
35 changes: 35 additions & 0 deletions
35
...ver/src/main/java/com/webank/wedatasphere/dss/data/governance/dao/TableStorageMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package com.webank.wedatasphere.dss.data.governance.dao; | ||
|
||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
import org.apache.ibatis.annotations.Mapper; | ||
import org.apache.ibatis.annotations.Param; | ||
import org.apache.ibatis.annotations.Select; | ||
|
||
import java.util.List; | ||
|
||
|
||
@Mapper | ||
public interface TableStorageMapper extends BaseMapper<Long> { | ||
|
||
String sql="select SUM(PARAM_VALUE) as storage from TABLE_PARAMS WHERE PARAM_KEY='totalSize'"; | ||
|
||
String sql2="select SUM(PARAM_VALUE) as storage from PARTITION_PARAMS WHERE PARAM_KEY='totalSize'"; | ||
|
||
String querySql = "select sum(storage) as storage from((" + sql + ") union all (" + sql2 + ")) as q"; | ||
|
||
@Select(querySql) | ||
List<Long> getTableStorage(); | ||
|
||
String commonSql="select TABLE_PARAMS.PARAM_VALUE as totalSize from DBS, TBLS,TABLE_PARAMS where TBLS.TBL_ID=TABLE_PARAMS.TBL_ID AND TBLS.DB_ID=DBS.DB_ID AND TABLE_PARAMS.PARAM_KEY='totalSize' AND DBS.NAME= #{dbName} AND TBLS.TBL_NAME=#{tableName}"; | ||
@Select(commonSql) | ||
List<Long> getTableInfo(@Param("dbName") String dbName,@Param("tableName") String tableName); | ||
|
||
|
||
String partitionSql="select SUM(PARTITION_PARAMS.PARAM_VALUE) as totalSize\n" + | ||
"from DBS,TBLS,PARTITIONS ,PARTITION_PARAMS\n" + | ||
"where DBS.DB_ID=TBLS.DB_ID AND TBLS.TBL_ID=PARTITIONS.TBL_ID AND PARTITIONS.PART_ID =PARTITION_PARAMS.PART_ID AND PARTITION_PARAMS.PARAM_KEY='totalSize' AND DBS.NAME= #{dbName} AND TBLS.TBL_NAME= #{tableName}\n" + | ||
"group by TBLS.TBL_NAME"; | ||
|
||
@Select(partitionSql) | ||
List<Long> getPartTableInfo(@Param("dbName") String dbName,@Param("tableName") String tableName); | ||
} |
Oops, something went wrong.