Professional Data Engineer free question 1 / 10 · Domain 1: Designing data processing systems
You want to move an existing BigQuery table that uses default encryption to CMEK protection. Which statement matches the Limitations description on the "Customer-managed Cloud KMS keys" page?
- The table cannot be switched in place; you copy the table and specify the CMEK key in the destination table's encryption configuration
- The table cannot be switched in place; you query it into itself with SELECT * and the write disposition WRITE_EMPTY, so it is rewritten with CMEK
- The table cannot be switched in place, and after the move a wildcard table query with a suffix can still read it as before
- The table cannot be switched in place, and after the move, table decorators that point to a time before the encryption switch can no longer be used
Show the answer and explanation
Answer: A
Why this is correct
The section on switching between CMEK-protected and default encryption says you cannot switch a table in place between default encryption and CMEK. To switch, either copy the table and specify the encryption configuration of the destination, or run a SELECT query that selects the table into itself with the write disposition WRITE_TRUNCATE. Both approaches rewrite the data so that it is protected with the new encryption.
Why the other options are wrong
"The table cannot be switched in place; you query it into itself with SELECT and the write disposition WRITE_EMPTY, so it is rewritten with CMEK" … The section gives WRITE_TRUNCATE as the write disposition for the SELECT query that selects the table into itself. WRITE_EMPTY writes only when the table is empty (see the write dispositions table on the "Batch loading data" page), so it cannot be used to rewrite an existing table that holds data.
"The table cannot be switched in place, and after the move, table decorators that point to a time before the encryption switch can no longer be used" … The section on using table decorators says that after you replace data in a CMEK-protected table with WRITE_TRUNCATE, range decorators do not work across the boundary where the encryption changed. It also says you can still use table decorators, including range decorators, to query data before or after the boundary, and to query a snapshot at a specific time.
"The table cannot be switched in place, and after the move a wildcard table query with a suffix can still read it as before" … The Wildcard table queries section says you cannot query CMEK-protected tables with a wildcard suffix. After the move, any wildcard query that reads that table needs to be reviewed.
Related limitations
With default encryption, BigQuery wraps the data encryption keys with a key encryption key that Google holds. With CMEK, you manage the key encryption key in Cloud KMS. The Limitations section also lists that a script cannot designate a destination table for a CMEK operation.