[ 
https://issues.apache.org/jira/browse/FLINK-16266?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17044029#comment-17044029
 ] 

Benchao Li commented on FLINK-16266:
------------------------------------

[~zjffdu] Thanks for your advise.

Let me clarify the description, why I put them into {{/lib}} is that I want to 
reproduce the issue easily. Actually, we encountered this issue in our 
production environment, users need them both in the same job.

I'll look into plugin mechanism as you advised, thanks.

> es6 & 7 table sql connector conflicts each other
> ------------------------------------------------
>
>                 Key: FLINK-16266
>                 URL: https://issues.apache.org/jira/browse/FLINK-16266
>             Project: Flink
>          Issue Type: Bug
>          Components: Connectors / ElasticSearch
>    Affects Versions: 1.10.0
>            Reporter: Benchao Li
>            Priority: Major
>
> If we put {{flink-sql-connector-elasticsearch6}} and 
> {{flink-sql-connector-elasticsearch7}} into {{/lib}} at the same time, and 
> use it in {{sql-client}}, will get exceptions like:
>  
> {code:java}
> [ERROR] Could not execute SQL statement. Reason:
> java.lang.AbstractMethodError: 
> org.apache.flink.streaming.connectors.elasticsearch.ElasticsearchUpsertTableSinkFactoryBase.createElasticsearchUpsertTableSink(ZLorg/apache/flink/table/api/TableSchema;Ljava/util/List;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lorg/apache/flink/api/common/serialization/SerializationSchema;Lorg/apache/flink/elasticsearch6/shaded/org/elasticsearch/common/xcontent/XContentType;Lorg/apache/flink/streaming/connectors/elasticsearch/ActionRequestFailureHandler;Ljava/util/Map;)Lorg/apache/flink/streaming/connectors/elasticsearch/ElasticsearchUpsertTableSinkBase;
> {code}
>  
> After analyzing the exceptions, IMO, it's because 
> {{flink-connector-elasticsearch-base}} is included into both 
> {{flink-sql-connector-elasticsearch6}} and 
> {{flink-sql-connector-elasticsearch7. And 
> }}{{flink-connector-elasticsearch-base}}{{ has different implementation in 6 
> & 7, because the version of elastic-search is different.}}
>  
> {{A simple way for fixing this is we can relocate 
> }}{{flink-connector-elasticsearch-base in 
> }}{{flink-sql-connector-elasticsearch6}}{{ and 
> }}{{flink-sql-connector-elasticsearch7. For example for 
> }}{{flink-sql-connector-elasticsearch7:}}
> {code:java}
> <relocation>
>    <pattern>org.apache.flink.streaming.connectors.elasticsearch.</pattern>
>    
> <shadedPattern>org.apache.flink.streaming.connectors.elasticsearch7.base.</shadedPattern>
> </relocation>
> {code}
> {{cc [~jark] [~twalthr] }}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to