更新时间:2024-03-20 GMT+08:00
分享

Schema演进并发

建表时需要指定hoodie.cleaner.policy.failed.writes = 'LAZY',否则并发提交时会触发rollback。

DDL并发

表1 支持的DDL并发操作

DDL操作

add

rename

change type

change comment

drop

add

Y

Y

Y

Y

Y

rename

Y

Y

Y

Y

Y

change type

Y

Y

Y

Y

Y

change comment

Y

Y

Y

Y

Y

drop

Y

Y

Y

Y

N

对同一列并发执行DDL操作需要注意以下两点:

  • 不能对同一列并发执行drop,否则只能成功执行第一个drop随后发生异常“java.lang.UnsupportedOperationException: cannot evolution schema implicitly, the column for which the update operation is performed does not exist.”。
  • drop与rename、change type和change comment并发执行时,drop必须是最后执行,否则只能执行drop以及drop之前的命令,执行drop之后的命令会发生异常“java.lang.UnsupportedOperationException: cannot evolution schema implicitly, the column for which the update operation is performed does not exist.”。

DDL与DML并发

表2 支持的DDL与DML并发操作

DDL操作

insert into

update

delete

set/reset

add

Y

Y

Y

Y

rename

N

N

Y

N

change type

N

N

Y

N

change comment

Y

Y

Y

Y

drop

N

N

Y

N

执行不支持的DDL与DML并发操作时会发生异常“cannot evolution schema implicitly, actions such as rename, delete, and type change were found”。

分享:

    相关文档

    相关产品