Add functions to convert table types and/or distribution column of distributed tables
- Dominant language
- C
- Stars
- 12.8k
- Forks
- 794
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 31
Description
While https://github.com/citusdata/citus/pull/3913 implemented, we had some discussions around the need to these kinds of UDFs. Opening the issue to track. The things that I remember are mostly:
- a UDF to change table type -- name is arbitrary: SELECT convert_table('table_1', to:'reference'); or `SELECT convert_table('table_2', to:'dist', dist_key:=`user_id`)`
- The same UDF or potentially another: `SELECT change_distribution_column('table_1', new_dist_key='event_id')`
We can currently do this via `INSERT INTO .. SELECT` with repartitioning in a scalable way. However, `undistribute_table ` is superior as it creates the views, partitioning hierarchy, indexes and sequences. The goal is to provide something similar.
Contributor guide
Assessment
This issue has not been assessed yet.