[
https://issues.apache.org/jira/browse/FLINK-12848?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16953674#comment-16953674
]
Timo Walther commented on FLINK-12848:
--------------------------------------
I investigated this issue further and came to the conclusion that it is not
feasible to perform changes to {{RowTypeInfo.equals()}} in the current code
base. The number of affected tests (>80) shows that this change is not trivial
and would affect the stability of the legacy planner. However, most of the
failing tests are in the legacy planner. It seems the Blink code has no
problems with this change which is great! I would suggest to implement the
minimal changes mentioned by [~jark] around {{FlinkTypeFactory.seenTypes}} and
apply the changes to {{RowTypeInfo.equals()}} once we drop the legacy planner.
I will prepare a PR for the minimal changes with notes to future implementers.
> Method equals() in RowTypeInfo should consider fieldsNames
> ----------------------------------------------------------
>
> Key: FLINK-12848
> URL: https://issues.apache.org/jira/browse/FLINK-12848
> Project: Flink
> Issue Type: Improvement
> Components: Table SQL / Planner
> Affects Versions: 1.7.2
> Reporter: aloyszhang
> Assignee: aloyszhang
> Priority: Major
> Labels: pull-request-available
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> Since the `RowTypeInfo#equals()` does not consider the fieldNames , when
> process data with RowTypeInfo type there may comes an error of the field
> name.
> {code:java}
> String [] fields = new String []{"first", "second"};
> TypeInformation<?>[] types = new TypeInformation[]{
> Types.ROW_NAMED(new String[]{"first001"}, Types.INT),
> Types.ROW_NAMED(new String[]{"second002"}, Types.INT) };
> StreamExecutionEnvironment execEnv =
> StreamExecutionEnvironment.getExecutionEnvironment();
> StreamTableEnvironment env =
> StreamTableEnvironment.getTableEnvironment(execEnv);
> SimpleProcessionTimeSource streamTableSource = new
> SimpleProcessionTimeSource(fields, types);
> env.registerTableSource("testSource", streamTableSource);
> Table sourceTable = env.scan("testSource");
> System.out.println("Source table schema : ");
> sourceTable.printSchema();
> {code}
> The table shcema will be
> {code:java}
> Source table schema :
> root
> |-- first: Row(first001: Integer)
> |-- second: Row(first001: Integer)
> |-- timestamp: TimeIndicatorTypeInfo(proctime)
> {code}
> the second field has the same name with the first field.
> So, we should consider the fieldnames in RowTypeInfo#equals()
>
>
>
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)