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

RowToRowCastRule will get wrong result while cast Array(Row()) type

    XMLWordPrintableJSON

Details

    Description

      // code placeholder
      CREATE TABLE kafkaTest (
        a STRING NOT NULL,
        config ARRAY<ROW<notificationTypeOptInReference STRING NOT NULL,cso STRING    NOT NULL,autocreate BOOLEAN NOT NULL> NOT NULL> NOT NULL,
        ingestionTime TIMESTAMP(3) METADATA FROM 'timestamp',
        PRIMARY KEY (businessEvent) NOT ENFORCED) 
      WITH (
           'connector' = 'kafka',
            'topic' = 'test',
            'properties.group.id' = 'testGroup',
            'scan.startup.mode' = 'earliest-offset',
            'properties.bootstrap.servers' = '', 
            'properties.security.protocol' = 'SASL_SSL',
            'properties.sasl.mechanism' = 'PLAIN',
            'properties.sasl.jaas.config' = ';',
            'value.format' = 'json',
            'sink.partitioner' = 'fixed'
      ); 

      If we with the following INSERT, it will see that the last item in the array is placed in the topic 3 times and the first two are igniored.

      // code placeholder
      INSERT INTO kafkaTest VALUES ('Transaction', ARRAY[ROW('G', 'IT', true),ROW('H', 'FR', true), ROW('I', 'IT', false)], TIMESTAMP '2023-08-30 14:01:00'); 

      The result:

      If I use the 'print' sink, I can get the right result. So I think this is a bug of 'kafka' connector.

       

      Attachments

        1. codegen.java
          9 kB
          Qingsheng Ren
        2. image-2023-08-21-08-48-25-116.png
          123 kB
          Yunhong Zheng

        Issue Links

          Activity

            People

              337361684@qq.com Yunhong Zheng
              337361684@qq.com Yunhong Zheng
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: