Trying to implement UpsertStreamTableSink in Java

2018-07-23 Thread Porritt, James
I put this class together when trying to create my own upsertable table sink in Java: public class MyTableSink implements UpsertStreamTableSink { @Override public TableSink> configure(String[] fieldNames, TypeInformation[] fieldTypes) { return null; } @Override

Joining streamed data to reference data

2018-07-20 Thread Porritt, James
I was hoping to join a StreamTableSource to a BatchTableSource, but I find it's not simple. A couple of questions: 1) Other than just pushing the DataSet to a Kafka topic (either internally or externally to the application) and reading it into a DataStream are there any means of doing

RE: Keeping only latest row by key?

2018-07-19 Thread Porritt, James
hat I’d be creating a version for each type I want to use it with (albeit using Generic s) and registering the functions separately for use with the correct type of table field? Thanks, James. From: Timo Walther mailto:twal...@apache.org>> Sent: 18 July 2018 12:21 To: Porritt, James mailto:jam

RE: Keeping only latest row by key?

2018-07-19 Thread Porritt, James
with the correct type of table field? Thanks, James. From: Timo Walther Sent: 18 July 2018 12:21 To: Porritt, James Cc: user@flink.apache.org Subject: Re: Keeping only latest row by key? Hi James, the easiest solution for this bahavior is to use a user-defined LAST_VALUE aggregate function

Keeping only latest row by key?

2018-07-17 Thread Porritt, James
In Spark if I want to be able to get a set of unique rows by id, using the criteria of keeping the row with the latest timestamp, I would do the following: .withColumn("rn", F.row_number().over(

RE: AvroInputFormat NullPointerException issues

2018-07-17 Thread Porritt, James
"name" : "b", "type" : [ "null", "string" ] }] } 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 “

RE: AvroInputFormat NullPointerException issues

2018-07-17 Thread Porritt, James
.apache.avro.io.DatumReader)MODEL$.createDatumReader(SCHEMA$); @Override public void readExternal(java.io.ObjectInput in) throws java.io.IOException { READER$.read(this, SpecificData.getDecoder(in)); } } I will check out the other suggestions you make. One concern I have is that fr

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