PUT Command
The PUT command is used to upload local files from the client to a Lakehouse Volume object. It supports three target types: external Volume, TABLE VOLUME, and USER VOLUME.
Execution Methods
PUT is a client-side command; the Lakehouse client tool reads the local file and transfers the data. The following execution methods are supported:
- SQLLine command-line client
- DBeaver and other JDBC clients
- Studio SQL editor (supported)
Syntax
Parameter Description
| Parameter | Required | Description |
|---|---|---|
local_path | Yes | Local file path. Linux/macOS paths start with /; Windows uses forward slashes as separators. Enclose paths containing special characters in single quotes. Multiple paths can be specified, separated by commas. |
VOLUME volume_name | One of three | Upload to the specified external Volume. |
TABLE VOLUME table_name | One of three | Upload to the staging space of the specified table's TABLE VOLUME. |
USER VOLUME | One of three | Upload to the current user's USER VOLUME. |
SUBDIRECTORY 'dir' | No | Specifies the target subdirectory; the filename remains unchanged. Mutually exclusive with FILE. |
FILE 'filename' | No | Specifies the target filename; can be used to rename the file during upload. Mutually exclusive with SUBDIRECTORY. |
Examples
Example 1: Upload a File to USER VOLUME
Upload a local file to the root of the current user's USER VOLUME:
After uploading, verify the file is in place:
Example 2: Upload to USER VOLUME with a Target Path
Upload a file to a subdirectory of USER VOLUME and rename it:
Example 3: Upload to an External Volume and Rename
Upload a local archive to the external Volume named hz_image_volume and rename it:
Example 4: Upload to TABLE VOLUME and Then Import
Upload a file to the table's staging space, then import it using COPY INTO:
Notes
- The maximum size for a single file is 5 GB.
- If a file with the same name already exists in the target Volume, the system will automatically overwrite it. Back up the existing file before uploading if needed.
SUBDIRECTORYandFILEcannot be used at the same time.- Uploading to an external Volume incurs object storage write fees for the associated cloud account.
- Executing the PUT command requires write permission on the target Volume.
