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

hailong wang commented on FLINK-15479:
--------------------------------------

>From my side, there are two aspects need to be discussed:
1、How to fix it. I agree with [@godfreyhe|https://github.com/godfreyhe], we 
should fix the default implementation of explainSource in TableSource, just 
like follow:
{{}}
{code:java}
List<String> fieldNames = ((RowType) 
getProducedDataType().getLogicalType()).getFieldNames(); return 
TableConnectorUtils.generateRuntimeName( getClass(), 
fieldNames.stream().toArray(String[]::new));{code}
{{}}2、How to add a test to verify it.
I found there is a test to verify jdbc push down in 
JDBCTableSourceSinkFactoryTest#testJDBCWithFilter. I think the name of method 
maybe not good. We can change it to testJDBCFieldsProjection. On the basis of 
this test, we can add some code to verify source description just like follow:
{{}}
{code:java}
List<String> fieldNames = ((RowType) 
actual.getProducedDataType().getLogicalType()).getFieldNames(); String 
expectedSourceDescription = actual.getClass().getSimpleName() + "(" + 
String.join(", ", fieldNames.stream().toArray(String[]::new)) + ")"; 
assertEquals(expectedSourceDescription ,actual.explainSource()); {code}
{{}}
Thank you all [~lzljs3620320] [~jark] [~godfreyhe] , Looking forward to your 
reply.

> Override  explainSource method in JDBCTableSource
> -------------------------------------------------
>
>                 Key: FLINK-15479
>                 URL: https://issues.apache.org/jira/browse/FLINK-15479
>             Project: Flink
>          Issue Type: Improvement
>          Components: Connectors / JDBC
>    Affects Versions: 1.9.0
>            Reporter: hailong wang
>            Assignee: hailong wang
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.10.0
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> JDBCTableSource support project push down, when the final fieldNames is 
> inconsistent with that in tableSchema, the source's explanation will be 
> wrong. So we should override explainSource method for it.



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

Reply via email to