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

Derive format schema from table schema may get error result

    XMLWordPrintableJSON

Details

    Description

      If rowtime attribute references a regular field, derive format schema from table schema may get error result:

      Schema schema = new Schema()
      	.field("f1", DataTypes.STRING())
      	.field("f2", DataTypes.BIGINT()).from("t")
      	.field("r", DataTypes.TIMESTAMP(3))
      	.rowtime(
      		new Rowtime().timestampsFromField("t").watermarksPeriodicBounded(3));
      
      final Map<String, String> properties = schema.toProperties();
      final TableSchema actualSchema = TableFormatFactoryBase.deriveSchema(properties);
      

      this code snippet will result in `ValidationException("Field names must be unique. Duplicate field: '" + fullFieldName + "'")`, but the excepted result should be:

      final TableSchema expectedSchema = TableSchema.builder()
      	.field("f1", Types.STRING)
      	.field("t", Types.LONG)
      	.build();
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              wangsan jrthe42
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: