We have support for nested rows so this should be easy. The .withMetadata
would reify the struct, moving from Row to WindowedValue<Row> if I
understand it...

SqlTransform.query("SELECT field1 from PCOLLECTION"):

    Schema = {
      field1: type1,
      field2: type2


SqlTransform.withMetadata().query("SELECT event_timestamp, value.field1

    Derived schema = {
      event_timestamp: TIMESTAMP,
      pane_info: { ... }
      value: {
        field1: type1,
        field2: type2,

SqlTransform would expand into a different composite, and it would be a
straightforward ParDo to adjust the data, possibly automatic via the new
schema conversions.

Embedding the window would be a bit wonky, something like { end_of_window:
TIMESTAMP, encoded_window: bytes } which would be expensive due to
encoding. But timestamp and pane info not so bad.


*From: *Anton Kedin <[EMAIL PROTECTED]>
*Date: *Tue, May 14, 2019 at 9:17 AM

Reza, can you share more thoughts on how you think this can work