Operation Concurrent Execution¶
Before performing DDL and DML operations, you need to obtain the corresponding locks. See Table 1 for details about the locks that need to be obtained for each operation. The check mark (Y) indicates that the lock is required. An operation can be performed only after all required locks are obtained.
You can check whether any two operations can be executed concurrently by using the following method: The first two lines in Table 1 indicate two operations. If no column in the two lines is marked with the check mark (Y), the two operations can be executed concurrently. That is, if the columns with check marks (Y) in the two lines do not exist, the two operations can be executed concurrently.
Operation | METADATA_LOCK | COMPACTION_LOCK | DROP_TABLE_LOCK | DELETE_SEGMENT_LOCK | CLEAN_FILES_LOCK | ALTER_PARTITION_LOCK | UPDATE_LOCK | STREAMING_LOCK | CONCURRENT_LOAD_LOCK | SEGMENT_LOCK |
---|---|---|---|---|---|---|---|---|---|---|
CREATE TABLE |
|
|
|
|
|
|
|
|
|
|
CREATE TABLE As SELECT |
|
|
|
|
|
|
|
|
|
|
DROP TABLE | Y |
| Y |
|
|
|
| Y |
|
|
ALTER TABLE COMPACTION |
| Y |
|
|
|
| Y |
|
|
|
TABLE RENAME |
|
|
|
|
|
|
|
|
|
|
ADD COLUMNS | Y | Y |
|
|
|
|
|
|
|
|
DROP COLUMNS | Y | Y |
|
|
|
|
|
|
|
|
CHANGE DATA TYPE | Y | Y |
|
|
|
|
|
|
|
|
REFRESH TABLE |
|
|
|
|
|
|
|
|
|
|
REGISTER INDEX TABLE | Y |
|
|
|
|
|
|
|
|
|
REFRESH INDEX |
| Y |
|
|
|
|
|
|
|
|
LOAD DATA/INSERT INTO |
|
|
|
|
|
|
|
| Y | Y |
UPDATE CARBON TABLE | Y | Y |
|
|
|
| Y |
|
|
|
DELETE RECORDS from CARBON TABLE | Y | Y |
|
|
|
| Y |
|
|
|
DELETE SEGMENT by ID |
|
|
| Y | Y |
|
|
|
|
|
DELETE SEGMENT by DATE |
|
|
| Y | Y |
|
|
|
|
|
SHOW SEGMENTS |
|
|
|
|
|
|
|
|
|
|
CREATE SECONDARY INDEX | Y | Y |
| Y |
|
|
|
|
|
|
SHOW SECONDARY INDEXES |
|
|
|
|
|
|
|
|
|
|
DROP SECONDARY INDEX | Y |
| Y |
|
|
|
|
|
|
|
CLEAN FILES |
|
|
|
|
|
|
|
|
|
|
SET/RESET |
|
|
|
|
|
|
|
|
|
|
Add Hive Partition |
|
|
|
|
|
|
|
|
|
|
Drop Hive Partition | Y | Y | Y | Y | Y | Y |
|
|
|
|
Drop Partition | Y | Y | Y | Y | Y | Y |
|
|
|
|
Alter table set | Y | Y |
|
|
|
|
|
|
|
|