Hi,
I found today very interesting users activity.
Users are creating tables with partition on INT column, and populated partitioning column with single value - always with 1.
On question why they are doing it, explanation is - they prepare data in separate table with identical structure, and then swap all data between tables using swap_partitions.
In theory, one can just rename tables and be good.
It appears, Vertica DDL is autocommiting. It is not possible to do two table renames in single transaction. As result, there is a small time between two table renames when table does not exist.
Swap partitions between table is a cleaner solution to a problem, does not have any time when table does not exist.
I kinda agree this is a good solution to a problem, though a very creative one.
Question - why we cannot make this a legit activity. Please file new feature request - swap_tables.
It should work with or without partitioning, and require identical table structure similar to swap_partitions.
Result of swap_tables(A,B) is that content of A and B are swapped in single transaction.
Let me know what you think.
Thanks for reading!