DROP TABLE IF EXISTS Syntax Misuse
Symptom
The DROP TABLE IF EXISTS statement is misused due to wrong understanding of its syntax.
Possible Causes
The operations performed by DROP TABLE IF EXISTS are as follows:
- Check whether a table exists on the current CN.
- If it does, deliver the DROP command to other CNs and DNs. If it does not, no operations are required.
A misunderstanding is as follows:
- Deliver DROP TABLE IF EXISTS to all CNs and DNs.
- Each CN or DN checks and drops the table (if it exists).
Solution
If some table definitions exist in only part of the CNs/DNs, do not use the DROP TABLE IF EXISTS statement.
Perform the following operations instead:
- Run CREATE TABLE IF NOT EXISTS to complete the table definitions of all CNs and DNs.
- If the table is no longer necessary, use the DROP TABLE statement on the CN to delete the table definition on all CNs and DNs.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot