Re: AvroInputFormat NullPointerException issues

2018-07-17 Thread vino yang
] > > } > > But actually, I was putting the generated MyAvroSchema file into > ‘my_stats’ namespace (along with my other application code) by adding a > ‘package my_stats;’ line at the top. When I added “namespace”: “my_stats” > to the schema and generated the Java that way it

RE: AvroInputFormat NullPointerException issues

2018-07-17 Thread Porritt, James
namespace”: “my_stats” to the schema and generated the Java that way it was fine. From: Porritt, James Sent: 17 July 2018 15:10 To: 'vino yang' Cc: user@flink.apache.org Subject: RE: AvroInputFormat NullPointerException issues My MyAvroSchema class

RE: AvroInputFormat NullPointerException issues

2018-07-17 Thread Porritt, James
n { WRITER$.write(this, SpecificData.getEncoder(out)); } @SuppressWarnings("unchecked") private static final org.apache.avro.io.DatumReader READER$ = (org.apache.avro.io.DatumReader)MODEL$.createDatumReader(SCHEMA$); @Override public void readExternal(java.io.ObjectInp

Re: AvroInputFormat NullPointerException issues

2018-07-16 Thread vino yang
Hi Porritt, Based on the exception stack trace you provided, it seems the exception occurs when initializing Avro schema. You did not give the definition of the MyAvroSchema Class, so I'd to suggest you : 1. make sure the file path "file:///home/myuser/test.avro" exists in your tm node which run

AvroInputFormat NullPointerException issues

2018-07-16 Thread Porritt, James
I've been trying to use the following code: ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment(); Path path = new Path("file:///home/myuser/test.avro"); AvroInputFormat my_format = new AvroInputFormat<>(path, MyAvroSchema.class); DataSet my_in