Hi,

I need to calculate elapsed times between steps of a transaction.
Each step is an event. All steps belonging to a single transaction have the
same transaction id. Every event has a handling time.
All information is part of a large JSON structure.
But I can have the incoming source supply transactionId and handlingTime
separately.
That would save me retrieving the windowingKey = transactionID and
handlingTime out of the nested JSON
Basically I want to use the SQL api to do:

select transactionId
   , handlingTime - previousHandlingTime as elapsedTime
   , largeJSON from (
      select  transactionId
          , handlingTime
          , lag(handlingTime) over (partition by transactionID order by
handlingTime)  as previousHandlingTime
          , largeJSON
      from source
)

The largeJSON can be about 100K.
Would this work?

Regards Hans-Peter

Reply via email to