nsivabalan commented on code in PR #6376: URL: https://github.com/apache/hudi/pull/6376#discussion_r945837128
########## website/docs/cli.md: ########## @@ -419,4 +487,66 @@ savepoints show savepoint rollback --savepoint 20220128160245447 --sparkMaster local[2] ``` +### Upgrade and Downgrade Table +In case the user needs to downgrade the version of Hudi library used, the Hudi table needs to be manually downgraded +on the newer version of Hudi CLI before library downgrade. To downgrade a Hudi table through CLI, user needs to specify +the target Hudi table version as follows: + +```shell +connect --path <table_path> +downgrade table --toVersion <target_version> +``` + +The following table shows the Hudi table versions corresponding to the Hudi release versions: + +| Hudi Table Version | Hudi Release Version(s) | +|:-------------------|:------------------------| +| `FIVE` or `5` | 0.12.0 and above | +| `FOUR` or `4` | 0.11.x | +| `THREE` or `3` | 0.10.x | +| `TWO` or `2` | 0.9.x | +| `ONE` or `1` | 0.6.x - 0.8.x | +| `ZERO` or `0` | 0.5.x and below | + +For example, to downgrade a table from version `FIVE`(`5`) (current version) to `TWO`(`2`), you should run (use proper Spark master based +on your environment) + +```shell +downgrade table --toVersion TWO --sparkMaster local[2] +``` + +or + +```shell +downgrade table --toVersion 2 --sparkMaster local[2] +``` + +You can verify the table version by looking at the `hoodie.table.version` property in `.hoodie/hoodie.properties` under +the table path: + +```properties +hoodie.table.version=2 +``` + +Hudi CLI also provides the ability to manually upgrade a Hudi table. To upgrade a Hudi table through CLI: + +```shell +upgrade table --toVersion <target_version> +``` + +:::note +Table upgrade is automatically handled by the Hudi write client in different deployment modes such as DeltaStreamer Review Comment: can we add a note that auto upgrade is the `recommended` way in general. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
