Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-12848

Method equals() in RowTypeInfo should consider fieldsNames

    XMLWordPrintableJSON

Details

    Description

      Since the `RowTypeInfo#equals()` does not consider the fieldNames , when process data with RowTypeInfo type there may comes an error of the field name.  

      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();
      

      The table shcema will be 

      Source table schema : 
      root 
      |-- first: Row(first001: Integer) 
      |-- second: Row(first001: Integer) 
      |-- timestamp: TimeIndicatorTypeInfo(proctime)
      

      the second field has the same name with the first field.

      So, we should consider the fieldnames in RowTypeInfo#equals()

       

       

       

       

      Attachments

        Activity

          People

            aloyszhang Aloys Zhang
            aloyszhang Aloys Zhang
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 1h
                1h