@ShellComponent public class TableCommand extends Object
| Constructor and Description |
|---|
TableCommand() |
| Modifier and Type | Method and Description |
|---|---|
String |
changeTableType(String changeType,
boolean enableCompaction,
String parallelism,
String master,
String sparkMemory,
String retry,
String propsFilePath,
String[] configs) |
String |
connect(String path,
boolean eventuallyConsistent,
Integer initialConsistencyIntervalMs,
Integer maxConsistencyIntervalMs,
Integer maxConsistencyChecks,
String timeGeneratorType,
Long maxExpectedClockSkewMs,
boolean useDefaultLockProvider) |
String |
createTable(String path,
String name,
String tableTypeStr,
String archiveFolder,
Integer tableVersion,
String payloadClass)
Create a Hoodie Table if it does not exist.
|
String |
createTable(String path,
String name,
String tableTypeStr,
String archiveFolder,
String payloadClass) |
String |
deleteTableConfig(String csConfigs) |
String |
descTable()
Describes table properties.
|
String |
fetchTableSchema(String outputFilePath)
Fetches table schema in avro format.
|
String |
recoverTableConfig() |
String |
refreshMetadata()
Refresh table metadata.
|
String |
updateTableConfig(String updatePropsFilePath) |
@ShellMethod(key="connect",
value="Connect to a hoodie table")
public String connect(@ShellOption(value="--path",help="Base Path of the table")
String path,
@ShellOption(value="--eventuallyConsistent",defaultValue="false",help="Enable eventual consistency")
boolean eventuallyConsistent,
@ShellOption(value="--initialCheckIntervalMs",defaultValue="2000",help="Initial wait time for eventual consistency")
Integer initialConsistencyIntervalMs,
@ShellOption(value="--maxWaitIntervalMs",defaultValue="300000",help="Max wait time for eventual consistency")
Integer maxConsistencyIntervalMs,
@ShellOption(value="--maxCheckIntervalMs",defaultValue="7",help="Max checks for eventual consistency")
Integer maxConsistencyChecks,
@ShellOption(value="--timeGeneratorType",defaultValue="WAIT_TO_ADJUST_SKEW",help="Time generator type, which is used to generate globally monotonically increasing timestamp")
String timeGeneratorType,
@ShellOption(value="--maxExpectedClockSkewMs",defaultValue="200",help="The max expected clock skew time for WaitBasedTimeGenerator in ms")
Long maxExpectedClockSkewMs,
@ShellOption(value="--useDefaultLockProvider",defaultValue="false",help="Use org.apache.hudi.client.transaction.lock.InProcessLockProvider")
boolean useDefaultLockProvider)
throws IOException
IOExceptionpublic String createTable(String path, String name, String tableTypeStr, String archiveFolder, String payloadClass) throws IOException
IOException@ShellMethod(key="create",
value="Create a hoodie table if not present")
public String createTable(@ShellOption(value="--path",help="Base Path of the table")
String path,
@ShellOption(value="--tableName",help="Hoodie Table Name")
String name,
@ShellOption(value="--tableType",defaultValue="COPY_ON_WRITE",help="Hoodie Table Type. Must be one of : COPY_ON_WRITE or MERGE_ON_READ")
String tableTypeStr,
@ShellOption(value="--archiveLogFolder",help="Folder Name for storing archived timeline",defaultValue="__NULL__")
String archiveFolder,
@ShellOption(value="--tableVersion",help="Specific table Version to create table as",defaultValue="__NULL__")
Integer tableVersion,
@ShellOption(value="--payloadClass",defaultValue="org.apache.hudi.common.model.HoodieAvroPayload",help="Payload Class")
String payloadClass)
throws IOException
path - Base Pathname - Hoodie Table NametableTypeStr - Hoodie Table TypepayloadClass - Payload ClassIOException@ShellMethod(key="desc",
value="Describe Hoodie Table properties")
public String descTable()
@ShellMethod(key={"refresh","metadata refresh","commits refresh","cleans refresh","savepoints refresh"},
value="Refresh table metadata")
public String refreshMetadata()
@ShellMethod(key="fetch table schema",
value="Fetches latest table schema")
public String fetchTableSchema(@ShellOption(value="--outputFilePath",defaultValue="__NULL__",help="File path to write schema")
String outputFilePath)
throws Exception
Exception@ShellMethod(key="table recover-configs",
value="Recover table configs, from update/delete that failed midway.")
public String recoverTableConfig()
throws IOException
IOException@ShellMethod(key="table update-configs",
value="Update the table configs with configs with provided file.")
public String updateTableConfig(@ShellOption(value="--props-file",help="Path to a properties file on local filesystem")
String updatePropsFilePath)
throws IOException
IOException@ShellMethod(key="table delete-configs",
value="Delete the supplied table configs from the table.")
public String deleteTableConfig(@ShellOption(value="--comma-separated-configs",help="Comma separated list of configs to delete.")
String csConfigs)
@ShellMethod(key="table change-table-type",
value="Change hudi table type to target type: COW or MOR. Note: before changing to COW, by default this command will execute all the pending compactions and execute a full compaction if needed.")
public String changeTableType(@ShellOption(value="--target-type",help="the target hoodie table type: COW or MOR")
String changeType,
@ShellOption(value="--enable-compaction",defaultValue="true",help="Valid in MOR to COW case. Before changing to COW, need to perform a full compaction to compact all log files. Default true")
boolean enableCompaction,
@ShellOption(value="--parallelism",defaultValue="3",help="Valid in MOR to COW case. Parallelism for hoodie compaction")
String parallelism,
@ShellOption(value="--sparkMaster",defaultValue="local",help="Valid in MOR to COW case. Spark Master")
String master,
@ShellOption(value="--sparkMemory",defaultValue="4G",help="Valid in MOR to COW case. Spark executor memory")
String sparkMemory,
@ShellOption(value="--retry",defaultValue="1",help="Valid in MOR to COW case. Number of retries")
String retry,
@ShellOption(value="--propsFilePath",defaultValue="",help="Valid in MOR to COW case. path to properties file on localfs or dfs with configurations for hoodie client for compacting")
String propsFilePath,
@ShellOption(value="--hoodieConfigs",defaultValue="",help="Valid in MOR to COW case. Any configuration that can be set in the properties file can be passed here in the form of an array")
String[] configs)
throws Exception
ExceptionCopyright © 2025 The Apache Software Foundation. All rights reserved.