public class Database extends Object
Constructor and Description |
---|
Database(String databaseName,
String description,
String owner,
int tableCount,
DLIClient client) |
Modifier and Type | Method and Description |
---|---|
Table |
createDLITable(String tableName,
String description,
List<Column> columns,
List<String> sortColumns)
Create DLI table.
|
Table |
createObsTable(String tableName,
String description,
List<Column> columns,
StorageType storageType,
String dataPath,
CsvFormatInfo csvFormatInfo)
Create OBS table.
|
Table |
createTable(String tableName,
String dataLocation,
String description,
List<Column> columns,
StorageType storageType,
String dataPath,
CsvFormatInfo csvFormatInfo,
List<String> sortColumns)
Create DLI/OBS table
|
void |
deleteDatabase()
Delete the current database.
|
DLIClient |
getClient() |
String |
getDatabaseName() |
String |
getDescription() |
String |
getEnterpriseProjectId() |
String |
getOwner() |
String |
getProjectId() |
String |
getResourceId() |
Table |
getTable(String tableName)
Get the table in the current database by table name.
|
int |
getTableCount() |
TableSchema |
getTableDetail(String tableName) |
List<Table> |
listAllTables()
List all tables in the current database.
|
List<Table> |
listAllTables(boolean withDetail)
List all tables in the current database.
|
List<Table> |
listAllTables(String keyword)
List all tables in the current database.
|
List<Table> |
listAllTables(String keyword,
boolean withDetail)
List all tables in the current database.
|
List<Table> |
listAllTables(String keyword,
boolean withDetail,
TableType type)
List all tables in the current database.
|
List<Table> |
listAllTables(TableType type)
List all tables in the current database.
|
PageTables |
listTableByPage(String keyword,
boolean withDetail,
Integer pageSize,
Integer currentPage,
TableType type)
List tables by page in the current database.
|
void |
setEnterpriseProjectId(String enterpriseProjectId) |
void |
setResourceId(String resourceId) |
String |
toString() |
public String getDatabaseName()
public String getDescription()
public String getOwner()
public int getTableCount()
public String getProjectId()
public String getEnterpriseProjectId()
public void setEnterpriseProjectId(String enterpriseProjectId)
public String getResourceId()
public void setResourceId(String resourceId)
public void deleteDatabase() throws DLIException
DLIException
- If fail to call the API, e.g. server error or cannot deserialize the response bodypublic List<Table> listAllTables() throws DLIException
DLIException
- If fail to call the API, e.g. server error or cannot deserialize the response bodypublic List<Table> listAllTables(String keyword) throws DLIException
keyword
- The keyword of the filter table name.DLIException
- If fail to call the API, e.g. server error or cannot deserialize the response bodypublic List<Table> listAllTables(boolean withDetail) throws DLIException
withDetail
- Whether to get the details of the table (owner, size, etc.).DLIException
- If fail to call the API, e.g. server error or cannot deserialize the response bodypublic List<Table> listAllTables(TableType type) throws DLIException
type
- Filter by table type.(EXTERNAL,MANAGED,VIEW)DLIException
- If fail to call the API, e.g. server error or cannot deserialize the response bodypublic List<Table> listAllTables(String keyword, boolean withDetail) throws DLIException
keyword
- The keyword of the filter table name.withDetail
- Whether to get the details of the table (owner, size, etc.).DLIException
- If fail to call the API, e.g. server error or cannot deserialize the response bodypublic List<Table> listAllTables(String keyword, boolean withDetail, TableType type) throws DLIException
keyword
- The keyword of the filter table name.withDetail
- Whether to get the details of the table (owner, size, etc.).type
- Filter by table type.(EXTERNAL,MANAGED,VIEW)DLIException
- If fail to call the API, e.g. server error or cannot deserialize the response bodypublic PageTables listTableByPage(String keyword, boolean withDetail, Integer pageSize, Integer currentPage, TableType type) throws DLIException
keyword
- The keyword of the filter table name.withDetail
- Whether to get the details of the table (owner, size, etc.).pageSize
- The maximum number of tables displayed on each pagecurrentPage
- The current page numbertype
- Filter by table type.(EXTERNAL,MANAGED,VIEW)DLIException
- If fail to call the API, e.g. server error or cannot deserialize the response bodypublic Table getTable(String tableName) throws DLIException
tableName
- table nameDLIException
- If fail to call the API, e.g. server error or cannot deserialize the response bodypublic Table createDLITable(String tableName, String description, List<Column> columns, List<String> sortColumns) throws DLIException
tableName
- table namedescription
- table descriptioncolumns
- table columnssortColumns
- An list of column names to use for sorting in DLI table.DLIException
- If fail to call the API, e.g. server error or cannot deserialize the response bodypublic Table createObsTable(String tableName, String description, List<Column> columns, StorageType storageType, String dataPath, CsvFormatInfo csvFormatInfo) throws DLIException
tableName
- table namedescription
- table descriptioncolumns
- table columnsstorageType
- the type of datadataPath
- table data storage pathcsvFormatInfo
- csv file format info.DLIException
- If fail to call the API, e.g. server error or cannot deserialize the response bodypublic Table createTable(String tableName, String dataLocation, String description, List<Column> columns, StorageType storageType, String dataPath, CsvFormatInfo csvFormatInfo, List<String> sortColumns) throws DLIException
tableName
- table namedataLocation
- DLI or OBSdescription
- table descriptioncolumns
- table columnsstorageType
- the type of data,only OBS table configuration,DLI table set null.dataPath
- table data storage path,only OBS table configuration,DLI table set null.csvFormatInfo
- csv file format info,only OBS table configuration,DLI table set null.sortColumns
- An list of column names to use for sorting in DLI table,OBS table set null.DLIException
- If fail to call the API, e.g. server error or cannot deserialize the response bodypublic TableSchema getTableDetail(String tableName) throws DLIException
DLIException
public DLIClient getClient()
Copyright © 2023. All rights reserved.