[
https://issues.apache.org/jira/browse/FLINK-20187?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Caizhi Weng updated FLINK-20187:
--------------------------------
Description:
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.
was:
When creating a table source I'm faced with the following exception:
{code}
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);}}.
> 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)