| Modifier and Type | Method and Description |
|---|---|
void |
create(String projectName,
String tableName,
TableSchema schema)
创建表
|
void |
create(String projectName,
String tableName,
TableSchema schema,
boolean ifNotExists)
创建表
|
void |
create(String projectName,
String tableName,
TableSchema schema,
boolean ifNotExists,
Long shardNum,
Long hubLifecycle)
创建表
|
void |
create(String projectName,
String tableName,
TableSchema schema,
String comment,
boolean ifNotExists)
创建表
|
void |
create(String projectName,
String tableName,
TableSchema schema,
String comment,
boolean ifNotExists,
Long shardNum,
Long hubLifecycle)
创建表
|
void |
create(String projectName,
String tableName,
TableSchema schema,
String comment,
boolean ifNotExists,
Long lifeCycle,
Map<String,String> hints,
Map<String,String> aliases)
创建表
|
void |
create(String tableName,
TableSchema schema)
创建表
|
void |
create(String tableName,
TableSchema schema,
boolean ifNotExists)
创建表
|
void |
createExternal(String projectName,
String tableName,
TableSchema schema,
String location,
String storedBy,
List<String> usingJars,
Map<String,String> serdeProperties,
String comment,
boolean ifNotExists,
Long lifeCycle,
Map<String,String> hints,
Map<String,String> aliases)
创建外部表
|
void |
createTableWithLifeCycle(String projectName,
String tableName,
TableSchema schema,
String comment,
boolean ifNotExists,
Long lifeCycle)
创建表
|
void |
delete(String tableName)
删除表
|
void |
delete(String tableName,
boolean ifExists)
删除表
|
void |
delete(String projectName,
String tableName)
删除表
|
void |
delete(String projectName,
String tableName,
boolean ifExists)
删除表
|
boolean |
exists(String tableName)
判断指定表是否存在
|
boolean |
exists(String projectName,
String tableName)
判断指定表是否存在
|
Table |
get(String tableName)
获得指定表信息
|
Table |
get(String projectName,
String tableName)
获得指定表信息
|
Iterable<Table> |
iterable()
获取默认
Project的所有表信息迭代器 iterable |
Iterable<Table> |
iterable(String projectName)
获取表信息迭代器 iterable
|
Iterable<Table> |
iterable(String projectName,
TableFilter filter)
获得表信息迭代器 iterable
|
Iterable<Table> |
iterable(TableFilter filter)
获取默认Project的表信息迭代器 iterable
|
Iterator<Table> |
iterator()
获取默认
Project的所有表信息迭代器 |
Iterator<Table> |
iterator(String projectName)
获取表信息迭代器
|
Iterator<Table> |
iterator(String projectName,
TableFilter filter)
获得表信息迭代器
|
Iterator<Table> |
iterator(TableFilter filter)
获取默认Project的表信息迭代器
|
List<Table> |
loadTables(Collection<String> tableNames)
批量加载表信息
|
List<Table> |
loadTables(String projectName,
Collection<String> tableNames)
批量加载表信息
|
List<Table> |
reloadTables(Collection<Table> tables)
批量加载表信息
|
List<Table> |
reloadTables(Iterator<Table> tables)
批量加载表信息
rest api 对请求数量有限制, 目前一次操作最多可请求 100 张表信息; 返回的表数据,与操作权限有关. |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic boolean exists(String tableName) throws OdpsException
tableName - 表名OdpsExceptionpublic boolean exists(String projectName, String tableName) throws OdpsException
projectName - 所在Project名称tableName - 表名OdpsExceptionpublic Iterator<Table> iterator(TableFilter filter)
filter - 过滤条件Table迭代器public Iterator<Table> iterator(String projectName, TableFilter filter)
public Iterable<Table> iterable(TableFilter filter)
filter - 过滤条件Table迭代器public Iterable<Table> iterable(String projectName, TableFilter filter)
public void create(String tableName, TableSchema schema) throws OdpsException
tableName - 表名schema - 表结构 TableSchemaOdpsExceptionpublic void create(String tableName, TableSchema schema, boolean ifNotExists) throws OdpsException
tableName - 表名schema - 表结构 TableSchemaifNotExists - 在创建表时,如果为 false 而存在同名表,则返回出错;若为 true,则无论是否存在同名表,即使原表结构与要创建的目标表结构不一致,均返回成功。已存在的同名表的元信息不会被改动。OdpsExceptionpublic void create(String projectName, String tableName, TableSchema schema, boolean ifNotExists, Long shardNum, Long hubLifecycle) throws OdpsException
projectName - 目标表所在Project名称tableName - 表名schema - 表结构 TableSchemaifNotExists - 在创建表时,如果为 false 而存在同名表,则返回出错;若为 true,则无论是否存在同名表,即使原表结构与要创建的目标表结构不一致,均返回成功。已存在的同名表的元信息不会被改动。shardNum - 表中shard数量,小于0表示未设置hubLifecycle - Hub表生命周期,小于0表示未设置OdpsExceptionpublic void create(String projectName, String tableName, TableSchema schema) throws OdpsException
projectName - 目标表所在Project名称tableName - 所要创建的Table名称schema - 表结构 TableSchemaOdpsExceptionpublic void create(String projectName, String tableName, TableSchema schema, boolean ifNotExists) throws OdpsException
projectName - 目标表所在Project名称tableName - 所要创建的Table名称schema - 表结构 TableSchemaifNotExists - 在创建表时,如果为 false 而存在同名表,则返回出错;若为 true,则无论是否存在同名表,即使原表结构与要创建的目标表结构不一致,均返回成功。已存在的同名表的元信息不会被改动。OdpsExceptionpublic void create(String projectName, String tableName, TableSchema schema, String comment, boolean ifNotExists, Long shardNum, Long hubLifecycle) throws OdpsException
projectName - 目标表所在Project名称tableName - 所要创建的Table名称schema - 表结构 TableSchemacomment - 表注释, 其中不能带有单引号ifNotExists - 在创建表时,如果为 false 而存在同名表,则返回出错;若为 true,则无论是否存在同名表,即使原表结构与要创建的目标表结构不一致,均返回成功。已存在的同名表的元信息不会被改动。shardNum - 表中shard数量,小于0表示未设置hubLifecycle - Hub表生命周期,小于0表示未设置OdpsExceptionpublic void create(String projectName, String tableName, TableSchema schema, String comment, boolean ifNotExists) throws OdpsException
projectName - 目标表所在Project名称tableName - 所要创建的Table名称schema - 表结构 TableSchemacomment - 表注释, 其中不能带有单引号ifNotExists - OdpsExceptionpublic void createTableWithLifeCycle(String projectName, String tableName, TableSchema schema, String comment, boolean ifNotExists, Long lifeCycle) throws OdpsException
projectName - 目标表所在Project名称tableName - 所要创建的Table名称schema - 表结构 TableSchemacomment - 表注释, 其中不能带有单引号ifNotExists - lifeCycle - 表生命周期OdpsExceptionpublic void create(String projectName, String tableName, TableSchema schema, String comment, boolean ifNotExists, Long lifeCycle, Map<String,String> hints, Map<String,String> aliases) throws OdpsException
projectName - 目标表所在Project名称tableName - 所要创建的Table名称schema - 表结构 TableSchemacomment - 表注释, 其中不能带有单引号ifNotExists - lifeCycle - 表生命周期hints - 能够影响SQL执行的Set信息,例如:odps.mapred.map.split.size等aliases - Alias信息。详情请参考用户手册中alias命令的相关介绍OdpsExceptionpublic void createExternal(String projectName, String tableName, TableSchema schema, String location, String storedBy, List<String> usingJars, Map<String,String> serdeProperties, String comment, boolean ifNotExists, Long lifeCycle, Map<String,String> hints, Map<String,String> aliases) throws OdpsException
projectName - 目标表所在Project名称tableName - 所要创建的Table名称schema - 表结构 TableSchemalocation - 外部数据存储地址URI String,比如"oss://path/to/directory/", 具体格式参考外部表使用手册storedBy - 处理外部数据使用的StorageHandler名字, 比如"com.aliyun.odps.TsvStorageHandler"usingJars - (nullable)
如果是自定义的StorageHandler, 这里指定其所依赖的jar名字。这些jar必须事先用ADD JAR命令添加serdeProperties - (nullable)
对StorageHandler的参数指定(if any),每个参数为一个String/String的key valuecomment - (nullable)
表注释, 其中不能带有单引号ifNotExists - lifeCycle - (nullable)
表生命周期hints - (nullable)
能够影响SQL执行的Set信息,例如:odps.mapred.map.split.size等aliases - (nullable)
Alias信息。详情请参考用户手册中alias命令的相关介绍OdpsExceptionpublic void delete(String tableName) throws OdpsException
tableName - 表名OdpsExceptionpublic void delete(String tableName, boolean ifExists) throws OdpsException
tableName - 表名ifExists - 如果为 false 表不存在,则返回异常;若为 true,无论表是否存在,皆返回成功。OdpsExceptionpublic void delete(String projectName, String tableName) throws OdpsException
projectName - 表所在ProjecttableName - 表名OdpsExceptionpublic void delete(String projectName, String tableName, boolean ifExists) throws OdpsException
projectName - 表所在ProjecttableName - 表名ifExists - 如果为 false 表不存在,则返回异常;若为 true,无论表是否存在,皆返回成功。OdpsExceptionpublic List<Table> loadTables(Collection<String> tableNames) throws OdpsException
tableNames - 表名Table 列表OdpsExceptionpublic List<Table> loadTables(String projectName, Collection<String> tableNames) throws OdpsException
projectName - 指定Project名称tableNames - 表名Table 列表OdpsExceptionpublic List<Table> reloadTables(Collection<Table> tables) throws OdpsException
tables - 请求表的容器Table 列表OdpsExceptionpublic List<Table> reloadTables(Iterator<Table> tables) throws OdpsException
tables - 请求表的迭代器Table 列表OdpsExceptionCopyright © 2019 Alibaba Cloud Computing. All rights reserved.