Flink写入Phoenix报错:Schema with given name already exists schemaName=SYSTEM

时间:2024-04-11 12:34:51

Phoenix:5.0

Flink:1.9


Phoenix设置:

<property>

    <name>phoenix.schema.isNamespaceMappingEnabled</name>

    <value>true</value>

</property>

Flink 通过jdbc sink写入phoenix时报错:

Caused by: org.apache.phoenix.schema.NewerSchemaAlreadyExistsException: ERROR 721 (42M04): Schema with given name already exists schemaName=SYSTEM

Flink写入Phoenix报错:Schema with given name already exists schemaName=SYSTEM

解决:

修改Phoenix代码:https://github.com/apache/phoenix/blob/v5.0.0-alpha-HBase-2.0/phoenix-core/src/main/java/org/apache/phoenix/schema/MetaDataClient.java

注掉:

case NEWER_SCHEMA_FOUND:    

        throw new NewerSchemaAlreadyExistsException(schema.getSchemaName())

Flink写入Phoenix报错:Schema with given name already exists schemaName=SYSTEM

重新打包编译,使用新的phoenix-core-5.0.0-alpha-HBase-2.0.jar连接phoenix