You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "hailong wang (Jira)" <ji...@apache.org> on 2020/01/06 11:38:00 UTC

[jira] [Issue Comment Deleted] (FLINK-15479) Override explainSource method in JDBCTableSource

     [ https://issues.apache.org/jira/browse/FLINK-15479?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

hailong wang updated FLINK-15479:
---------------------------------
    Comment: was deleted

(was: 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)