tunnel Verified current stable Not installed? Data Processing

Tunnel / Upload Local File To Table Partition

Upload Local File To Table Partition

Uploads a local file to a specified table and partition.

$
Terminal
tunnel upload <path/to/file> <table_name>/<partition_spec>;

When To Use

During scheduled batch uploads to ensure data consistency in production environments.

Pro Tip

Using -n to skip existing rows can prevent data duplication; never use -p flag unless necessary as it may overwrite partitions.

Command Builder

Tune the command before you copy it

Back to syntax
$
Generated Command
tunnel upload <path/to/file> <table_name>/<partition_spec>;

Anatomy of Output

Understanding the result

Upload started for file: /path/to/file.csv File Path

Indicates the file being uploaded.

Target table: my_table/2021/05 Table/Partition

Shows the specific table and partition for upload.

Upload status: SUCCESS Status

Confirms that the upload completed successfully.

Troubleshooting

Common pitfalls

ERROR: Permission denied for table my_table

Solution: Check if you have write permissions for the target table.

ERROR: File not found: /path/to/file.csv

Solution: Verify the file path and correct if necessary.

ERROR: Invalid partition spec: 2021/05

Solution: Ensure that the partition specification matches the table's defined partitions.

Command Breakdown

What each part is doing

tunnel
Base Command
The executable that performs this operation. Here it runs Tunnel before the shell applies any redirect operators.
<path/to/file>
Input Files
The file path or paths supplied to this command.
<table_name>
table name
The value supplied for table name.
<partition_spec>
partition spec
The value supplied for partition spec.

Alternative Approaches

Comparable commands in other tools

Alternative data processing tools for the same job.