Hello Aljoscha,
I have also tried by using the field's name in the sum("field3") function (like you have suggested), but this time the exception is different: -------------------------------------------------------------------- Exception in thread "main" java.lang.ExceptionInInitializerError at org.apache.flink.quickstart.StreamWindowExperiments.MultiWindowing.main(MultiWindowing.scala) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140) Caused by: java.lang.IllegalArgumentException: Key expressions are only supported on POJO types and Tuples. A type is considered a POJO if all its fields are public, or have both getters and setters defined at org.apache.flink.streaming.util.FieldAccessor$PojoFieldAccessor.<init>(FieldAccessor.java:175) at org.apache.flink.streaming.util.FieldAccessor.create(FieldAccessor.java:92) at org.apache.flink.streaming.api.functions.aggregation.SumAggregator.<init>(SumAggregator.java:49) at org.apache.flink.streaming.api.datastream.WindowedStream.sum(WindowedStream.java:390) at org.apache.flink.quickstart.StreamWindowExperiments.MultiWindowing$.<init>(MultiWindowing.scala:63) at org.apache.flink.quickstart.StreamWindowExperiments.MultiWindowing$.<clinit>(MultiWindowing.scala) ... 6 more --------------------------------------------------------------------- I have used both of the styles of calling sum() in earlier, but I never got this exception. That's why I am a little confused. 'Reading' is a _case class_ and hence, a POJO as I understand. Yet, the message seems to say that it is not. -- Nirmalya Software Technologist
http://www.linkedin.com/in/nirmalyasengupta "If you have built castles in the air, your work need not be lost. That is where they should be. Now put the foundation under them." |
Hi,
which version of Flink are you using, by the way? This would help me narrow down on possible causes of the problem. Cheers, Aljoscha > On 26 Feb 2016, at 10:34, Nirmalya Sengupta <[hidden email]> wrote: > > Hello Aljoscha, > > I have also tried by using the field's name in the sum("field3") function (like you have suggested), but this time the exception is different: > > -------------------------------------------------------------------- > > Exception in thread "main" java.lang.ExceptionInInitializerError > at org.apache.flink.quickstart.StreamWindowExperiments.MultiWindowing.main(MultiWindowing.scala) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:497) > at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140) > Caused by: java.lang.IllegalArgumentException: Key expressions are only supported on POJO types and Tuples. A type is considered a POJO if all its fields are public, or have both getters and setters defined > at org.apache.flink.streaming.util.FieldAccessor$PojoFieldAccessor.<init>(FieldAccessor.java:175) > at org.apache.flink.streaming.util.FieldAccessor.create(FieldAccessor.java:92) > at org.apache.flink.streaming.api.functions.aggregation.SumAggregator.<init>(SumAggregator.java:49) > at org.apache.flink.streaming.api.datastream.WindowedStream.sum(WindowedStream.java:390) > at org.apache.flink.quickstart.StreamWindowExperiments.MultiWindowing$.<init>(MultiWindowing.scala:63) > at org.apache.flink.quickstart.StreamWindowExperiments.MultiWindowing$.<clinit>(MultiWindowing.scala) > ... 6 more > > --------------------------------------------------------------------- > > I have used both of the styles of calling sum() in earlier, but I never got this exception. That's why I am a little confused. 'Reading' is a _case class_ and hence, a POJO as I understand. Yet, the message seems to say that it is not. > > -- Nirmalya > > -- > Software Technologist > http://www.linkedin.com/in/nirmalyasengupta > "If you have built castles in the air, your work need not be lost. That is where they should be. > Now put the foundation under them." |
In reply to this post by nsengupta
Hello Aljoscha, I am using Flink 0.10.1 (see below) and flinkspector (0.1-SNAPSHOT). --------------------------------------------------------------------------------- <dependency> <groupId>org.apache.flink</groupId> <artifactId>flink-scala</artifactId> <version>0.10.1</version> </dependency> <dependency> <groupId>org.apache.flink</groupId> <artifactId>flink-streaming-scala</artifactId> <version>0.10.1</version> </dependency> <dependency> <groupId>org.apache.flink</groupId> <artifactId>flink-clients</artifactId> <version>0.10.1</version> </dependency> <dependency> <groupId>com.dataArtisans</groupId> <artifactId>flink-training-exercises</artifactId> <version>0.1</version> <dependency> </dependency> ----------------------------------------------------- Many thanks in advance for your effort. -- Nirmalya Software Technologist
http://www.linkedin.com/in/nirmalyasengupta "If you have built castles in the air, your work need not be lost. That is where they should be. Now put the foundation under them." |
Free forum by Nabble | Edit this page |