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

List field in a POJO data stream results in table program compilation failure

    XMLWordPrintableJSON

Details

    Description

      Suppose I have a POJO class like this:

      public class Example {
          private String key;
          private List<Map<String, String>> values;
      
          // getters, setters, equals+hashCode omitted
      }
      

      When a DataStream with this class is converted to a table, and some operations are performed on it, it results in an exception which explicitly says that I should file a ticket:

      Caused by: org.apache.flink.api.common.InvalidProgramException: Table program cannot be compiled. This is a bug. Please file an issue.
      

      Please find the example Java code and the full stack trace attached.

      From the exception and generated code it seems that Flink is upset with the list field being treated as an array - but I cannot have an array type there in the real code.

      Also note that if I don't specify the schema explicitly, it then maps the values field to a `RAW('java.util.List', '...')` type, which also does not work correctly and fails the job in case of even simplest operations like printing.

      Attachments

        1. stacktrace.txt
          8 kB
          Vladimir Matveev
        2. MainPojo.java
          2 kB
          Vladimir Matveev
        3. generated-code.txt
          2 kB
          Vladimir Matveev

        Issue Links

          Activity

            People

              Unassigned Unassigned
              netvl Vladimir Matveev
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: