Table Schema Changes
Use Cases
Schema Change no Rows
For a table the already exits with a schema and rows:
- User selects the edit schema button and is presented with the edit schema dialog
- User adds a new column.
- User deletes an existing column
- User change the type of an existing column
- The user moves the newly added column to the top of the list.
- User selects save.
All changes from 2 - 5 should be saved in an atomic operation. This includes column additions, deletes, updates, and column order changes.
Schema Change with CSV Upload
For a table that already with a schema and rows:
- User selects a CSV from to upload to the table.
- User is presented with a preview of the upload CSV schema and informed that CSV schema does not match that of the table. The preview is similar to the edit schema column list from the edit schema dialog and contains the columns found in the CSV.
- From the above list, the user removes one column
- From the above list, the user renames a column.
- User selects the upload button.
All changes from 3 - 5 should be saved in an atomic operation. This includes, column additions, deletes, updates, column order changes. Since the new schema does not exactly match the CSV, a mapping between column ID and column indices in the CSV must be provided. The update should also include row additions, deletes and updates from the CSV.
Delete column
The user wishes to clear the contents of a column. They do this by doing the following:
- Deleting the column from the schema using a command line client.
- Add the same column ID back to the table at the same index using a command line client.
All cells in the the column from above should be empty or set to the default of the column.
There are a number of use cases where we want table schema changes as part of the lifecycle of a table. Most requested is certainly the easy case of increasing the size of a string column. More complex is changing a string column to an int column or even changing a string column to a file handle. The other use case is where a partially different dataset is appended to an existing table and it magically merges and rinses the data to the new table format.