v.21.1New Features
Implemented ATTACH TABLE query to create new table and attach data from directory
ImplementedATTACH TABLE name FROM 'path/to/data/' (col1 Type1, ...query. It creates new table with provided structure and attaches table data from provided directory inuser_files. #17903 (tavplubix).
Why it matters
This feature allows users to easily create a new table with a specified structure and attach existing data from a directory inuser_files. It simplifies data ingestion by reusing data files without manual data loading or copying, enhancing workflow efficiency.How to use it
Use theATTACH 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, ...)