Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow altering field mappings on an existing collections #1

Open
veeve opened this issue Jul 16, 2019 · 1 comment
Open

allow altering field mappings on an existing collections #1

veeve opened this issue Jul 16, 2019 · 1 comment
Assignees

Comments

@veeve
Copy link
Collaborator

veeve commented Jul 16, 2019

Currently, field mappings need to be specified at collection creation time. Allow these to be altered on an existing collection.

@veeve veeve changed the title allow altering field mappings on an existing Rockset collection allow altering field mappings on an existing collections Jul 16, 2019
@veeve
Copy link
Collaborator Author

veeve commented Jul 16, 2019

For now, one will have to recreate the collection in order to modify field mappings.

That said, one can modify records that have already been loaded into a collection using the INSERT INTO SELECT statement.

For example - say you have a collection called users and want to anonymize a field called email_address into a new field email_hash and wipe out the original field email_address from the users collection, you can do:

INSERT INTO users(_id, email_hash, email_address)
SELECT _id, TO_HEX(SHA256(u.email_address)) as email_hash, null as email_address
FROM users u
WHERE u.email_address IS NOT null

If you use INSERT INTO SELECT, please note that without field mappings, data from new inserts/updates will not be anonymized, and you will have to re-run the statement above periodically to anonymize them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants