Re: Request-Response flow for real-time analytics

2023-08-24 Thread Kenan Kılıçtepe
A .connect() method may work. You can connect the changeLogStream coming from the table with fields Customer and sum with the original stream consisting of Customer and EventId. In a coProcessFunction, you can keep the latest EventID of a Customer in the state and whenever you receive data from tab

Re: Request-Response flow for real-time analytics

2023-08-24 Thread Jiten Pathy
Hi Xiagyu, Thank you for providing the SQL query, i will try it out: but i don't think MAX() will work for our use-case as the event ids may not be ordered. when they reach flink. On Wed, 23 Aug 2023 at 15:23, xiangyu feng wrote: > Hi Pathy, > > Pls check if following SQL fits ur need, > > > CRE

Re: Request-Response flow for real-time analytics

2023-08-24 Thread Jiten Pathy
Most of the aggregates can be added/removed/updated dynamically, it would be easier from an implementation point of view, if we could use SQL. On Thu, 24 Aug 2023 at 16:09, Kenan Kılıçtepe wrote: > I think Datastream fits your requirements better. Is there a specific > reason for using SQL ? > >

Re: Request-Response flow for real-time analytics

2023-08-23 Thread Alex Cruise
This is a pretty hard problem. I would be inclined to try Queryable State ( https://nightlies.apache.org/flink/flink-docs-master/docs/dev/datastream/fault-tolerance/queryable_state/) first. -0xe1a On Mon, Aug 21, 2023 at 11:04 PM Jiten Pathy wrote: > Hi, > We are currently evaluating Flink for

Re: Request-Response flow for real-time analytics

2023-08-23 Thread xiangyu feng
Hi Pathy, Pls check if following SQL fits ur need, CREATE TABLE event1 (id BIGINT, customer_id STRING, amount INT, ts TIMESTAMP ); CREATE VIEW event2 AS SELECT * FROM event1; CREATE VIEW event3 AS SELECT * FROM event1; CREATE VIEW temp1 AS SELECT id AS event2.id, "Total" AS Total, SUM(event3.

Re: Request-Response flow for real-time analytics

2023-08-23 Thread Jiten Pathy
Hi Xiangyu, Yes, that's correct. It is the requestId, we will have for each request. On Wed, 23 Aug 2023 at 13:47, xiangyu feng wrote: > Hi Pathy, > > I want to know if the 'id' in {id, customerId, amount, timestamp} stands > for 'requestId'? If not, how is this 'id' field generated and can we

Re: Request-Response flow for real-time analytics

2023-08-23 Thread xiangyu feng
Hi Pathy, I want to know if the 'id' in {id, customerId, amount, timestamp} stands for 'requestId'? If not, how is this 'id' field generated and can we add 'requestId' field in the event? Thx, Xiangyu Jiten Pathy 于2023年8月22日周二 14:04写道: > Hi, > We are currently evaluating Flink for our analyti

Request-Response flow for real-time analytics

2023-08-21 Thread Jiten Pathy
Hi, We are currently evaluating Flink for our analytics engine. We would appreciate any help with our experiment in using flink for real-time request-response use-case. To demonstrate the current use-case: our application produces events of the following form: {id, customerId, amount, timestamp}