@Component @UserDocumentation(title="Commands for Dimension Tables Management", description="These commands provide CRUD for dimension tables, associated storages, and fact partitions") public class LensDimensionTableCommands extends LogicalTableCrudCommand<XDimensionTable> implements org.springframework.shell.core.CommandMarker
DATE_FMT, DATE_PARSER
Constructor and Description |
---|
LensDimensionTableCommands() |
Modifier and Type | Method and Description |
---|---|
String |
addNewDimStorage(String tableName,
File path)
Adds the new dim storage.
|
String |
addPartitionsToDimtable(String tableName,
String storageName,
File path)
Adds the partitions to dim table.
|
String |
addPartitionToDimtable(String tableName,
String storageName,
File path)
Adds the partition to dim table.
|
String |
createDimensionTable(File path)
Creates the dimension table.
|
String |
describeDimensionTable(String name)
Describe dimension table.
|
APIResult |
doAddStorage(String name,
String path) |
APIResult |
doDropAllStorages(String name) |
APIResult |
doDropStorage(String tableName,
String storageName) |
APIResult |
doUpdate(String name,
String path) |
String |
dropAllDimStorages(String tableName)
Drop all dim storages.
|
String |
dropAllPartitionsOfDim(String tableName,
String storageName,
String filter)
Drop all partitions of dim.
|
String |
dropDimensionTable(String name,
boolean cascade)
Drop dimension table.
|
String |
dropStorageFromDim(String tableName,
String storageName)
Drop storage from dim.
|
List<String> |
getAll() |
List<String> |
getAll(String dimesionName) |
String |
getAllPartitionsOfDimtable(String tableName,
String storageName,
String filter)
Gets the all partitions of dim.
|
List<String> |
getAllStorages(String name) |
String |
getDimStorages(String table)
Gets the dim storages.
|
String |
getStorageFromDim(String tableName,
String storage)
Gets the storage from dim.
|
String |
showDimensionTables(String dimensionName)
Show dimension tables.
|
String |
updateDimensionTable(String name,
File path)
Update dimension table.
|
String |
updatePartitionOfDimtable(String tableName,
String storageName,
File path) |
String |
updatePartitionsOfDimtable(String tableName,
String storageName,
String path) |
addPartition, addPartitions, addStorage, dropAllStorages, dropPartitions, dropStorage, getAllPartitions, getStorage, showAll, showAllStorages, updatePartition, updatePartitions
create, describe, drop, getSingleObjectName, showAll, update
afterReturningInvocation, afterThrowingInvocation, beforeInvocation, formatDate, formatJson, getClient, getClientWrapper, getOrDefaultQueryHandleString, getValidPath, removePrefixBeforeURI, setClient
@CliCommand(value="show dimtables", help="display list of dimtables in current database. If optional <dimension_name> is supplied, only facts belonging to dimension <dimension_name> will be displayed") public String showDimensionTables(@CliOption(key={"","dimension_name"},mandatory=false,help="<dimension_name>") String dimensionName)
@CliCommand(value="create dimtable", help="Create a new dimension table taking spec from <path-to-dimtable-spec-file>") public String createDimensionTable(@CliOption(key={"","path"},mandatory=true,help="<path-to-dimtable-spec-file>") @NonNull File path)
path
- Path to dim spec@CliCommand(value="describe dimtable", help="describe dimtable <dimtable_name>") public String describeDimensionTable(@CliOption(key={"","dimtable_name"},mandatory=true,help="<dimtable_name>") String name)
name
- the dim@CliCommand(value="update dimtable", help="update dimtable <dimtable_name> taking spec from <path-to-dimtable-spec>") public String updateDimensionTable(@CliOption(key={"","dimtable_name"},mandatory=true,help="<dimtable_name>") String name, @CliOption(key={"","path"},mandatory=true,help="<path-to-dimtable-spec>") @NonNull File path)
name
- the dimtable namepath
- the path to spec file@CliCommand(value="drop dimtable", help="drop dimtable <dimtable_name>. If <cascade> is true, all the storage tables associated with the dimtable <dimtable_name> are also dropped. By default <cascade> is false") public String dropDimensionTable(@CliOption(key={"","dimtable_name"},mandatory=true,help="<dimtable_name>") String name, @CliOption(key="cascade",mandatory=false,specifiedDefaultValue="true",unspecifiedDefaultValue="false",help="<cascade>") boolean cascade)
name
- the dimcascade
- the cascade@CliCommand(value="dimtable list storages", help="display list of storage associated to dimtable <dimtable_name>") public String getDimStorages(@CliOption(key={"","dimtable_name"},mandatory=true,help="<dimtable_name>") String table)
table
- the dim@CliCommand(value="dimtable add storage", help="adds a new storage to dimtable <dimtable_name>, taking storage spec from <path-to-storage-spec>") public String addNewDimStorage(@CliOption(key={"","dimtable_name"},mandatory=true,help="<dimtable_name>") String tableName, @CliOption(key={"","path"},mandatory=true,help="<path-to-storage-spec>") @NonNull File path)
tableName
- dimtable namepath
- path to storage spec@CliCommand(value="dimtable get storage", help="describe storage <storage_name> of dimtable <dimtable_name>") public String getStorageFromDim(@CliOption(key={"","dimtable_name"},mandatory=true,help="<dimtable_name>") String tableName, @CliOption(key={"","storage_name"},mandatory=true,help="<storage_name>") String storage)
tableName
- dimtable name@CliCommand(value="dimtable drop storage", help="drop storage <storage_name> from dimtable <dimtable_name>") public String dropStorageFromDim(@CliOption(key={"","dimtable_name"},mandatory=true,help="<dimtable_name>") String tableName, @CliOption(key={"","storage_name"},mandatory=true,help="<storage_name>") String storageName)
tableName
- dimtable namestorageName
- storage name@CliCommand(value="dimtable drop all storages", help="drop all storages associated to dimension table") public String dropAllDimStorages(@CliOption(key={"","dimtable_name"},mandatory=true,help="<dimtable_name>") String tableName)
tableName
- the table@CliCommand(value="dimtable list partitions", help="get all partitions associated with dimtable <dimtable_name>, storage <storage_name> filtered by <partition-filter>") public String getAllPartitionsOfDimtable(@CliOption(key={"","dimtable_name"},mandatory=true,help="<dimtable_name>") String tableName, @CliOption(key={"","storage_name"},mandatory=true,help="<storage_name>") String storageName, @CliOption(key={"","filter"},mandatory=false,help="<partition-filter>") String filter)
tableName
- dimtable namestorageName
- storage namefilter
- partition filter@CliCommand(value="dimtable drop partitions", help="drop all partitions associated with dimtable <dimtable_name>, storage <storage_name> filtered by <partition-filter>") public String dropAllPartitionsOfDim(@CliOption(key={"","dimtable_name"},mandatory=true,help="<dimtable_name>") String tableName, @CliOption(key={"","storage_name"},mandatory=true,help="<storage_name>") String storageName, @CliOption(key={"","filter"},mandatory=false,help="<partition-filter>") String filter)
tableName
- dimtable namestorageName
- storage namefilter
- partition query filter@CliCommand(value="dimtable add single-partition", help="add single partition to dimtable <dimtable_name>\'s storage <storage_name>, reading spec from <partition-spec-path>") public String addPartitionToDimtable(@CliOption(key={"","dimtable_name"},mandatory=true,help="<dimtable_name>") String tableName, @CliOption(key={"","storage_name"},mandatory=true,help="<storage_name>") String storageName, @CliOption(key={"","path"},mandatory=true,help="<partition-spec-path>") @NonNull File path)
tableName
- dimtable namestorageName
- storage namepath
- partition spec path@CliCommand(value="dimtable update single-partition", help="update single partition to dimtable <dimtable_name>\'s storage <storage_name>, reading spec from <partition-spec-path> The partition has to exist to be eligible for updation.") public String updatePartitionOfDimtable(@CliOption(key={"","dimtable_name"},mandatory=true,help="<dimtable_name>") String tableName, @CliOption(key={"","storage_name"},mandatory=true,help="<storage_name>") String storageName, @CliOption(key={"","path"},mandatory=true,help="<partition-spec-path>") @NonNull File path)
@CliCommand(value="dimtable add partitions", help="add multiple partition to dimtable <dimtable_name>\'s storage <storage_name>, reading partition list spec from <partition-list-spec-path>") public String addPartitionsToDimtable(@CliOption(key={"","dimtable_name"},mandatory=true,help="<dimtable_name>") String tableName, @CliOption(key={"","storage_name"},mandatory=true,help="<storage_name>") String storageName, @CliOption(key={"","path"},mandatory=true,help="<partition-list-spec-path>") @NonNull File path)
tableName
- dimtable namestorageName
- storage namepath
- partition spec path@CliCommand(value="dimtable update partitions", help="update multiple partition to dimtable <dimtable_name>\'s storage <storage_name>, reading partition list spec from <partition-list-spec-path> The partitions have to exist to be eligible for updation.") public String updatePartitionsOfDimtable(@CliOption(key={"","dimtable_name"},mandatory=true,help="<dimtable_name>") String tableName, @CliOption(key={"","storage_name"},mandatory=true,help="<storage_name>") String storageName, @CliOption(key={"","path"},mandatory=true,help="<partition-list-spec-path>") String path)
public APIResult doDropStorage(String tableName, String storageName)
doDropStorage
in class LogicalTableCrudCommand<XDimensionTable>
public List<String> getAllStorages(String name)
getAllStorages
in class LogicalTableCrudCommand<XDimensionTable>
public APIResult doAddStorage(String name, String path)
doAddStorage
in class LogicalTableCrudCommand<XDimensionTable>
public APIResult doDropAllStorages(String name)
doDropAllStorages
in class LogicalTableCrudCommand<XDimensionTable>
public List<String> getAll()
getAll
in class LensCRUDCommand<XDimensionTable>
public APIResult doUpdate(String name, String path)
doUpdate
in class LensCRUDCommand<XDimensionTable>
Copyright © 2014–2018 Apache Software Foundation. All rights reserved.