OceanBase Schema Change Sync
An OceanBase automatic table creation job can propagate added and dropped columns from an OceanBase MySQL-compatible tenant to warehouse tables. In Core 26.1.4, the source property schema_change_behavior determines whether the job applies those changes.
Supported schema changes
| Source operation | Warehouse behavior with evolve |
|---|---|
ADD COLUMN | Appends a nullable column and copies the column comment. The source default and NOT NULL constraint do not propagate. Existing rows receive NULL; subsequent rows use the values logged by OceanBase. |
DROP COLUMN | Drops the corresponding destination column. |
Changes that only specify source column position, indexes, or partition layout do not reproduce that layout in the warehouse. Changes such as RENAME COLUMN, MODIFY COLUMN, or a primary-key change can pause the job with SCHEMA_CHANGE_UNSUPPORTED. Inspect ErrorMsg and align the warehouse schema before resuming. Replaying an already-applied add or drop does not repeat the change.
In Core 26.1.4 the default setting, evolve, applies supported changes. Set "schema_change_behavior" = "ignore" in the FROM OCEANBASE clause if you want to maintain the destination schema yourself. Keep the schemas compatible with subsequent inserts, updates, and deletes.
Verify an added column
Run the following statements on OceanBase for a source table with columns id and name.
ALTER TABLE source_db.users ADD COLUMN city VARCHAR(50);
INSERT INTO source_db.users (id, name, city) VALUES (2, 'Alice', 'Hangzhou');
After the job commits the change, run these queries in the warehouse. Check that the column exists and that the new row contains Hangzhou.
DESC target_db.users;
SELECT id, city FROM target_db.users WHERE id = 2;
Type inference during a later schema change can differ from initial table creation. For example, in Core 26.1.4 an initial JSON column maps to STRING, while a subsequent ADD COLUMN for JSON creates a JSON column. See OceanBase data type mapping for initial mappings.