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

Jark Wu commented on FLINK-14647:
---------------------------------

My gut feeling is that we should expose {{String connectorType()}} and 
{{List<String> connectorVersions()}} to the factory interface. So that we can 
match them in more fine-grained.

> Improve the exception message when required property is not matched
> -------------------------------------------------------------------
>
>                 Key: FLINK-14647
>                 URL: https://issues.apache.org/jira/browse/FLINK-14647
>             Project: Flink
>          Issue Type: Sub-task
>          Components: Table SQL / API
>            Reporter: Jark Wu
>            Priority: Major
>
> Currently, all the required properties should exist and match, otherwise, 
> {{NoMatchingTableFactoryException}} will be thrown.
> For example, if we have {{connector.type=hbase,  connector.versions=1.1.1}}, 
> the following exception will be thrown.
> {code}
> org.apache.flink.table.api.NoMatchingTableFactoryException: Could not find a 
> suitable table factory for 'org.apache.flink.addons.hbase.HBaseTableFactory' 
> in
> the classpath.
> Reason: No context matches.
> The following properties are requested:
> connector.type=hbase
> connector.version=1.1.1
> {code}
> It's hard to know the problem is the version is wrong. A quick fixing is move 
> version out of {{requiredContext()}} if we only support one version and throw 
> a readable exception in {{ConnectorDescriptorValidator#validate}}. 
> However, for the multiple-version connectors, e.g. Kafka, maybe we should 
> improve the design of {{TableFactory}}.



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

Reply via email to