public interface ITable
提供表相关操作接口>
| 限定符和类型 | 方法和说明 |
|---|---|
Boolean |
alterTableParams(ISourceDTO source,
String tableName,
Map<String,String> params)
修改表参数
|
Boolean |
dropTable(ISourceDTO source,
String tableName)
删除表,成功返回true,失败返回false
|
List<Map<String,Object>> |
executeQuery(ISourceDTO source,
String sql)
执行sql查询
|
Boolean |
executeSqlWithoutResultSet(ISourceDTO source,
String sql)
执行sql,不需要结果
|
Connection |
getCon(ISourceDTO source)
rdbms数据库获取连接唯一入口,对抛出异常进行统一处理
|
Long |
getTableSize(ISourceDTO source,
String schema,
String tableName)
获取表占用存储
|
Boolean |
isView(ISourceDTO source,
String schema,
String tableName)
已过时。
|
Boolean |
renameTable(ISourceDTO source,
String oldTableName,
String newTableName)
重命名表,成功返回true,失败返回false
|
List<String> |
showPartitions(ISourceDTO source,
String tableName)
获取所有分区,格式同sql返回值,不错额外处理,如:pt1=name1/pt2=name2/pt3=name3
非分区表返回null
|
Boolean |
upsertTableColumn(ISourceDTO source,
UpsertColumnMetaDTO columnMetaDTO)
新增或者修改表的列
|
Connection getCon(ISourceDTO source)
source - 数据源信息Exception - 异常List<Map<String,Object>> executeQuery(ISourceDTO source, String sql)
source - 数据源信息sql - 查询sqlException - 异常Boolean executeSqlWithoutResultSet(ISourceDTO source, String sql)
source - 数据源信息sql - 查询sqlException - 异常List<String> showPartitions(ISourceDTO source, String tableName)
Boolean dropTable(ISourceDTO source, String tableName)
source - tableName - Boolean renameTable(ISourceDTO source, String oldTableName, String newTableName)
source - 数据源信息oldTableName - 旧表名newTableName - 新表名Boolean alterTableParams(ISourceDTO source, String tableName, Map<String,String> params)
source - 数据源信息tableName - 表名params - 修改的参数,map集合Long getTableSize(ISourceDTO source, String schema, String tableName)
source - 数据源信息schema - schema信息tableName - 表名@Deprecated Boolean isView(ISourceDTO source, String schema, String tableName)
source - 数据源信息schema - schema名称tableName - 表名Boolean upsertTableColumn(ISourceDTO source, UpsertColumnMetaDTO columnMetaDTO)
source - 数据源信息columnMetaDTO - 列信息Copyright © 2022. All rights reserved.