You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flink.apache.org by "aloyszhang (JIRA)" <ji...@apache.org> on 2019/06/14 08:07:00 UTC

[jira] [Created] (FLINK-12848) Method equals() in RowTypeInfo should consider fieldsNames

aloyszhang created FLINK-12848:
----------------------------------

             Summary: Method equals() in RowTypeInfo should consider fieldsNames
                 Key: FLINK-12848
                 URL: https://issues.apache.org/jira/browse/FLINK-12848
             Project: Flink
          Issue Type: Improvement
    Affects Versions: 1.7.2
            Reporter: aloyszhang
            Assignee: aloyszhang


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
(v7.6.3#76005)