v.21.1New Features

Implemented ATTACH TABLE query to create new table and attach data from directory

Implemented ATTACH TABLE name FROM 'path/to/data/' (col1 Type1, ... query. It creates new table with provided structure and attaches table data from provided directory in user_files. #17903 (tavplubix).
Introduced ATTACH TABLE name FROM 'path/to/data/' (col1 Type1, ...) query to create and attach a new table from existing data stored in user_files.

Why it matters

This feature allows users to easily create a new table with a specified structure and attach existing data from a directory in user_files. It simplifies data ingestion by reusing data files without manual data loading or copying, enhancing workflow efficiency.

How to use it

Use the ATTACH TABLE statement with the new table name, specify the path to the data directory inside user_files, and define the column names and types. For example:

ATTACH TABLE new_table FROM 'path/to/data/' (col1 Type1, col2 Type2, ...)