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

liufangliang commented on FLINK-18938:
--------------------------------------

[~jark] I understand what you mean.

when we are quering a sink-only connector ,

if we don't  have a dependency jar in the classpath ,return the following 
excception message:
{code:java}
Caused by: org.apache.flink.table.api.ValidationException: Could not find any 
factory for identifier 'elasticsearch-7' that implements 
'org.apache.flink.table.factories.DynamicTableSourceFactory' in the classpath.
{code}
if we have a dependency jar in the classpath ,return the following excception 
message:  
{code:java}
Caused by: org.apache.flink.table.api.ValidationException: The connector named 
'elasticsearch-7' is only supported as sink,can n't be used as a source.
{code}
Bisides,Tips(support as sink or source) can follow the identifier,For example:
{code:java}
Available factory identifiers are: 

datagen (source,sink)
elasticsearch-7 (sink-only)
test-connector (source-only)
{code}
What do you think of ?

 

> Throw better exception message for quering sink-only connector
> --------------------------------------------------------------
>
>                 Key: FLINK-18938
>                 URL: https://issues.apache.org/jira/browse/FLINK-18938
>             Project: Flink
>          Issue Type: Improvement
>            Reporter: Jark Wu
>            Priority: Major
>
> Currently, if we are quering a sink-only connector, for example: {{SELECT * 
> FROM elasticsearch_sink}}, a following exception will be thrown:
> {code}
> Caused by: org.apache.flink.table.api.ValidationException: Could not find any 
> factory for identifier 'elasticsearch-7' that implements 
> 'org.apache.flink.table.factories.DynamicTableSourceFactory' in the classpath.
> Available factory identifiers are:
> datagen
> {code}
> The above exception is very misleading, it sounds like that the elasticsearch 
> jar is not loaded, however the elasticsearch jar is in the lib directory of 
> Flink cluster. 
> We can improve the exception that explicitly telling users the found 
> connector only support as sink, can't be used as a source. 



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

Reply via email to