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

Nicholas Jiang commented on FLINK-14647:
----------------------------------------

[~jark]Yeah, my original intention was that requiredContext includes some 
required properties, so add matchContext method to tell the comparsion with 
required context. As your feel,  your exposion of two interfaces is feasible, 
and I will modify the TableFactory interface design, not match context in 
interface concept.

> 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