Hi Yunfeng, Thanks for the response. I hadn't even seen the other constructor, but it seems that the single-arg constructor works fine even if the output tag is declared as "static final", at least in my use case. I imagine Flink would complain about unknown types if it really can't figure it out automatically, so maybe I can just let it be as long as tests pass, but I was wondering if Flink really needs a non-static field to analyze type information here. Who knows, maybe there are some scenarios where it's really a must.
Regards, Alexis. Am Mo., 25. Sept. 2023 um 05:17 Uhr schrieb Yunfeng Zhou < flink.zhouyunf...@gmail.com>: > Hi Alexis, > > If you create OutputTag with the constructor `OutputTag(String id)`, > you need to make it anonymous for Flink to analyze the type > information. But if you use the constructor `OutputTag(String id, > TypeInformation<T> typeInfo)`, you need not make it anonymous as you > have provided the type information. > > The second constructor is introduced after the document and the first > constructor, and I think the document might have been outdated and not > match with OutputTag's current behavior. A ticket and PR could be > added to fix the document. What do you think? > > Best, > Yunfeng > > On Fri, Sep 22, 2023 at 4:55 PM Alexis Sarda-Espinosa > <sarda.espin...@gmail.com> wrote: > > > > Hello, > > > > very quick question, the documentation for side outputs states that an > OutputTag "needs to be an anonymous inner class, so that we can analyze the > type" (this is written in a comment in the example). Is this really true? > I've seen many examples where it's a static element and it seems to work > fine. > > > > Regards, > > Alexis. > > >