@Component @UserDocumentation(title="Commands for Facts Management", description="These command provide CRUD for facts, associated storages, and fact partitions") public class LensFactCommands extends LogicalTableCrudCommand<XFact>
DATE_FMT, DATE_PARSER
Constructor and Description |
---|
LensFactCommands() |
Modifier and Type | Method and Description |
---|---|
String |
addNewFactStorage(String tableName,
File path)
Adds the new fact storage.
|
String |
addPartitionsToFact(String tableName,
String storageName,
File path) |
String |
addPartitionToFact(String tableName,
String storageName,
File path)
Adds the partition to fact.
|
String |
createFact(File path)
Creates the fact.
|
String |
describeFactTable(String name)
Describe fact table.
|
APIResult |
doAddStorage(String name,
String path) |
APIResult |
doDropAllStorages(String name) |
APIResult |
doDropStorage(String tableName,
String storageName) |
APIResult |
doUpdate(String name,
String path) |
String |
dropAllFactStorages(String name)
Drop all fact storages.
|
String |
dropAllPartitionsOfFact(String tableName,
String storageName,
String filter)
Drop all partitions of fact.
|
String |
dropFact(String fact,
boolean cascade)
Drop fact.
|
String |
dropStorageFromFact(String tableName,
String storageName)
Drop storage from fact.
|
List<String> |
getAll() |
List<String> |
getAll(String cubeName) |
String |
getAllPartitionsOfFact(String tableName,
String storageName,
String filter)
Gets the all partitions of fact.
|
List<String> |
getAllStorages(String name) |
String |
getFactStorages(String tableName)
Gets the fact storages.
|
String |
getStorageFromFact(String tableName,
String storage)
Gets the storage from fact.
|
List<String> |
getTimelines(String factName,
String storageName,
String updatePeriod,
String timeDimension) |
String |
showFacts(String cubeName)
Show facts.
|
String |
updateFactTable(String name,
File specPath)
Update fact table.
|
String |
updatePartitionOfFact(String tableName,
String storageName,
File path)
updates the partition in the fact.
|
String |
updatePartitionsOfFact(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 facts", help="display list of fact tables in current database. If optional <cube_name> is supplied, only facts belonging to cube <cube_name> will be displayed") public String showFacts(@CliOption(key={"","cube_name"},mandatory=false,help="<cube_name>") String cubeName)
@CliCommand(value="create fact", help="create a fact table with spec from <path-to-fact-spec-file>") public String createFact(@CliOption(key={"","path"},mandatory=true,help="<path-to-fact-spec-file>") @NonNull File path)
path
- Path to fact spec@CliCommand(value="describe fact", help="describe fact <fact_name>") public String describeFactTable(@CliOption(key={"","fact_name"},mandatory=true,help="<fact_name>") String name)
name
- the fact@CliCommand(value="update fact", help="update fact <fact_name> taking spec from <path-to-fact-spec>") public String updateFactTable(@CliOption(key={"","fact_name"},mandatory=true,help="<fact_name>") String name, @CliOption(key={"","path"},mandatory=true,help="<path-to-fact-spec>") @NonNull File specPath)
name
- fact name to be updatedspecPath
- path to the file containing new spec of the fact@CliCommand(value="drop fact", help="drops fact <fact_name>. If <cascade> is true, all the storage tables associated with the fact <fact_name> are also dropped. By default <cascade> is false") public String dropFact(@CliOption(key={"","fact_name"},mandatory=true,help="<fact_name>") String fact, @CliOption(key="cascade",mandatory=false,specifiedDefaultValue="true",unspecifiedDefaultValue="false",help="<cascade>") boolean cascade)
fact
- the factcascade
- the cascade@CliCommand(value="fact list storage", help="display list of storages associated to fact <fact_name>") public String getFactStorages(@CliOption(key={"","fact_name"},mandatory=true,help="<fact_name>") String tableName)
tableName
- the fact@CliCommand(value="fact add storage", help="adds a new storage to fact <fact_name>, taking storage spec from <path-to-storage-spec>") public String addNewFactStorage(@CliOption(key={"","fact_name"},mandatory=true,help="<fact_name>") String tableName, @CliOption(key={"","path"},mandatory=true,help="<path-to-storage-spec>") @NonNull File path)
tableName
- the fact namepath
- the path to storage spec@CliCommand(value="fact get storage", help="describe storage <storage_name> of fact <fact_name>") public String getStorageFromFact(@CliOption(key={"","fact_name"},mandatory=true,help="<fact_name>") String tableName, @CliOption(key={"","storage_name"},mandatory=true,help="<path-to-storage-spec>") String storage)
tableName
- fact table namestorage
- storage spec path@CliCommand(value="fact drop storage", help="drop storage <storage_name> from fact <fact_name>") public String dropStorageFromFact(@CliOption(key={"","fact_name"},mandatory=true,help="<fact_name>") String tableName, @CliOption(key={"","storage_name"},mandatory=true,help="<storage_name>") String storageName)
tableName
- the table namestorageName
- the storage name@CliCommand(value="fact drop all storages", help="drop all storages associated to fact <fact_name>") public String dropAllFactStorages(@CliOption(key={"","fact_name"},mandatory=true,help="<fact_name>") String name)
name
- the table@CliCommand(value="fact list partitions", help="get all partitions associated with fact <fact_name>, storage <storage_name> filtered by <partition-filter>") public String getAllPartitionsOfFact(@CliOption(key={"","fact_name"},mandatory=true,help="<fact_name>") String tableName, @CliOption(key={"","storage_name"},mandatory=true,help="<storage_name>") String storageName, @CliOption(key={"","filter"},mandatory=true,help="<partition-filter>") String filter)
tableName
- fact namestorageName
- storage namefilter
- partition filter@CliCommand(value="fact drop partitions", help="drop all partitions associated with fact <fact_name>, storage <storage_name> filtered by <partition-filter>") public String dropAllPartitionsOfFact(@CliOption(key={"","fact_name"},mandatory=true,help="<fact_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
- fact namestorageName
- storage namefilter
- partition query filter@CliCommand(value="fact add single-partition", help="add single partition to fact <fact_name>\'s storage <storage_name>, reading spec from <partition-spec-path>") public String addPartitionToFact(@CliOption(key={"","fact_name"},mandatory=true,help="<fact_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
- fact namestorageName
- storage namepath
- partition spec path@CliCommand(value="fact update single-partition", help="update single partition to fact <fact_name>\'s storage <storage_name>, reading spec from <partition-spec-path> The partition has to exist to be eligible for updation.") public String updatePartitionOfFact(@CliOption(key={"","fact_name"},mandatory=true,help="<fact_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
- fact namestorageName
- storage namepath
- partition spec path@CliCommand(value="fact add partitions", help="add multiple partition to fact <fact_name>\'s storage <storage_name>, reading partition list spec from <partition-list-spec-path>") public String addPartitionsToFact(@CliOption(key={"","fact_name"},mandatory=true,help="<fact_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)
@CliCommand(value="fact update partitions", help="update multiple partition of fact <fact_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 updatePartitionsOfFact(@CliOption(key={"","fact_name"},mandatory=true,help="<fact_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)
@CliCommand(value="fact timelines", help="get timelines for fact. Can optionally specify storage, update period and time dimension to filter by. Instead of time dimension, partition column can be directly passed as <time_dimension>") public List<String> getTimelines(@CliOption(key={"","fact_name"},mandatory=true,help="<fact_name>") String factName, @CliOption(key="storage_name",mandatory=false,help="<storage_name>") String storageName, @CliOption(key="update_period",mandatory=false,help="<update_period>") String updatePeriod, @CliOption(key="time_dimension",mandatory=false,help="<time_dimension>") String timeDimension)
public APIResult doDropStorage(String tableName, String storageName)
doDropStorage
in class LogicalTableCrudCommand<XFact>
public List<String> getAllStorages(String name)
getAllStorages
in class LogicalTableCrudCommand<XFact>
public APIResult doAddStorage(String name, String path)
doAddStorage
in class LogicalTableCrudCommand<XFact>
public APIResult doDropAllStorages(String name)
doDropAllStorages
in class LogicalTableCrudCommand<XFact>
public List<String> getAll()
getAll
in class LensCRUDCommand<XFact>
Copyright © 2014–2018 Apache Software Foundation. All rights reserved.