ibm-lh commands and usage

The ibm-lh command-line utility is a terminal-based interface that is designed to facilitate interaction with watsonx.data resources.

watsonx.data Developer edition

watsonx.data on Red Hat® OpenShift®

watsonx.data SaaS on AWS

The ibm-lh CLI utility supports the following commands:

ibm-lh engine

Work with engine resources.

Syntax
./ibm-lh engine
Command Description
ibm-lh engine ls List all engines.
ibm-lh engine info Get information about a specific engine.
ibm-lh engine add Create an engine.
ibm-lh engine rm Delete the specified engine.
ibm-lh engine attach Associate a catalog with an engine.
ibm-lh engine detach Dissociate a catalog from an engine.

ibm-lh config

Configure connectivity to the watsonx.data API endpoints.

Syntax
./ibm-lh config
Command Description
ibm-lh config add_dev Add a new hostname and port.

watsonx.data Developer edition

ibm-lh config add_cpd Add a new hostname and port.

watsonx.data on Red Hat OpenShift

watsonx.data on Cloud Pak for Data

ibm-lh config add_saas Add a new hostname and port.

watsonx.data on IBM Cloud®

ibm-lh config rm Remove an existing hostname and port.
ibm-lh config ls List all instances.
ibm-lh config select Select an instance.
ibm-lh config current Show the currently selected instance.

ibm-lh database

Register and work with external databases.

Syntax
./ibm-lh database
Command Description
ibm-lh database add Add a database.
ibm-lh database ls List all databases.
ibm-lh database info Get information about a specified database.
ibm-lh database rm Delete a database.

ibm-lh bucket

Register and work with object storage buckets.

Syntax
./ibm-lh bucket
Command Description
ibm-lh bucket add Add a storage bucket.
ibm-lh bucket ls List all storage buckets.
ibm-lh bucket info Get information about a specified bucket.
ibm-lh bucket rm Delete a storage bucket.

ibm-lh data-copy

Interactive Mode

You can use interactive command line interface to run ingestion commands from inside the ibm-lh-tool container.

Run the ingestion job using the following command:

Syntax
./ibm-lh data-copy --interactive
Non-interactive Mode

You can use non-interactive command line interface to run ingestion commands from outside the ibm-lh-tool container. You can execute the ingestion commands directly from the local environment where ibm-client-package is installed.

Run an ingestion job.

Syntax
./ibm-lh data-copy <ingestion_parameters>

Where <ingestion_parameters> for ibm-lh data-copy command is listed in ibm-lh data-copy command options.

ibm-lh table-maint

Maintain tables with stored procedures.

Syntax
./ibm-lh table-maint --file <file-name>
You can use stored procedures to run the following table operations on Iceberg tables in Spark.
Snapshot management
Procedure Description
rollback_to_snapshot Roll back a table to a specific snapshot ID.
rollback_to_timestamp Roll back to a specific time.
set_current_snapshot Set the current snapshot ID for a table.
cherrypick_snapshot Cherry-pick changes from a snapshot into the current table state.
Metadata management
Procedure Description
expire_snapshots Remove older snapshots and their files, which are no longer needed.
remove_orphan_files Remove files that are not referenced in any metadata files of an Iceberg table.
rewrite_data_files Combine small files into larger files to reduce metadata overhead and runtime file open cost.
rewrite_manifests Rewrite manifests for a table to optimize scan planning.
Table migration
Procedure Description
register_table Create a catalog entry for a metadata.json file that exists but does not have a corresponding catalog identifier.

To generally use the utility:

$ ibm-lh [argument] [options]

To see a list of available commands:

$ ibm-lh --help

To see the description and options for a specific command:

$ ibm-lh [argument] --help