[
https://issues.apache.org/jira/browse/FLINK-20187?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17233637#comment-17233637
]
Jark Wu edited comment on FLINK-20187 at 11/17/20, 2:48 PM:
------------------------------------------------------------
I will take this issue, but I think we don't need to revert the commit. It only
affects very few connectors.
I guess the "odps" connector has two factory implementation, each implements
{{DynamicTableSinkFactory}} and {{DynamicTableSourceFactory}}.
Usually, a connector should implement them both in one factory class. So I
think "odps" is a corner case.
But I will fix this.
was (Author: jark):
I will take this issue, but I think we don't need to revert the commit. I guess
the "odps" connector has two factory implementation, each implements
{{DynamicTableSinkFactory}} and {{DynamicTableSourceFactory}}.
Usually, a connector should implement them both in one factory class. So I
think "odps" is a corner case.
But I will fix this.
> FactoryUtil#createTableSource will be confused by a table source and a table
> sink factory with same identifier
> --------------------------------------------------------------------------------------------------------------
>
> Key: FLINK-20187
> URL: https://issues.apache.org/jira/browse/FLINK-20187
> Project: Flink
> Issue Type: Bug
> Components: Table SQL / API
> Affects Versions: 1.12.0
> Reporter: Caizhi Weng
> Priority: Blocker
> Fix For: 1.12.0
>
>
> When creating a table source I'm faced with the following exception:
> {code:java}
> Caused by: org.apache.flink.table.api.ValidationException: Multiple
> factories for identifier 'odps' that implement
> 'org.apache.flink.table.factories.DynamicTableFactory' found in the classpath.
> Ambiguous factory classes are:
> {code}
> However there is only one table source factory with this identifier, and
> another table sink factory with this identifier.
> {{FactoryUtil#createTableSource}} shouldn't be confused.
> This is caused by {{FactoryUtil.java}} line 370, where {{factory =
> discoverFactory(context.getClassLoader(), DynamicTableFactory.class,
> connectorOption);}} should be {{factory =
> discoverFactory(context.getClassLoader(), factoryClass, connectorOption);}}.
> I understand that this change aims to display a better exception message. We
> might need to change the logic of selecting a proper exception message a
> little bit.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)