== Abstract Syntax Tree ==
LogicalSink(table=[fluss.nexmark.output_a8650ae195c14e2ba63237305bb32938], fields=[bidder, bid_count, starttime, endtime])
+- LogicalProject(bidder=[$0], bid_count=[$3], starttime=[$1], endtime=[$2])
   +- LogicalAggregate(group=[{0, 1, 2}], bid_count=[COUNT()])
      +- LogicalProject(bidder=[$1], starttime=[$8], endtime=[$9])
         +- LogicalTableFunctionScan(invocation=[TUMBLE(TABLE(#0), DESCRIPTOR(_UTF-16LE'p_time'), 10000:INTERVAL SECOND)], rowType=[RecordType(BIGINT auction, BIGINT bidder, BIGINT price, VARCHAR(2147483647) channel, VARCHAR(2147483647) url, TIMESTAMP_LTZ(3) *ROWTIME* dateTime, VARCHAR(2147483647) extra, TIMESTAMP_LTZ(3) *PROCTIME* p_time, TIMESTAMP(3) window_start, TIMESTAMP(3) window_end, TIMESTAMP_LTZ(3) *PROCTIME* window_time)])
            +- LogicalProject(auction=[$0], bidder=[$1], price=[$2], channel=[$3], url=[$4], dateTime=[$5], extra=[$6], p_time=[$7])
               +- LogicalProject(auction=[$0], bidder=[$1], price=[$2], channel=[$3], url=[$4], dateTime=[$5], extra=[$6], p_time=[PROCTIME()])
                  +- LogicalProject(auction=[$3.auction], bidder=[$3.bidder], price=[$3.price], channel=[$3.channel], url=[$3.url], dateTime=[$5], extra=[$3.extra])
                     +- LogicalFilter(condition=[=($0, 2)])
                        +- LogicalProject(event_type=[$0], person=[$1], auction=[$2], bid=[$3], dateTime=[$4], rowtime=[$5])
                           +- LogicalWatermarkAssigner(rowtime=[rowtime], watermark=[-($5, 4000:INTERVAL SECOND)])
                              +- LogicalProject(event_type=[$0], person=[$1], auction=[$2], bid=[$3], dateTime=[$4], rowtime=[TO_TIMESTAMP_LTZ($4, 3)])
                                 +- LogicalTableScan(table=[[fluss, nexmark, events]])

== Optimized Physical Plan ==
Sink(table=[fluss.nexmark.output_a8650ae195c14e2ba63237305bb32938], fields=[bidder, bid_count, window_start, window_end])
+- WindowAggregate(groupBy=[bidder], window=[TUMBLE(time_col=[p_time], size=[10 s])], select=[bidder, COUNT(*) AS bid_count, start('w$) AS window_start, end('w$) AS window_end])
   +- Exchange(distribution=[hash[bidder]])
      +- Calc(select=[bid.bidder AS bidder, PROCTIME() AS p_time], where=[=(event_type, 2)])
         +- TableSourceScan(table=[[fluss, nexmark, events, project=[event_type, bid, dateTime], watermark=[-(TO_TIMESTAMP_LTZ(dateTime, 3), 4000:INTERVAL SECOND)], watermarkEmitStrategy=[on-periodic], filter=[]]], fields=[event_type, bid, dateTime])

== Optimized Execution Plan ==
Sink(table=[fluss.nexmark.output_a8650ae195c14e2ba63237305bb32938], fields=[bidder, bid_count, window_start, window_end])
+- WindowAggregate(groupBy=[bidder], window=[TUMBLE(time_col=[p_time], size=[10 s])], select=[bidder, COUNT(*) AS bid_count, start('w$) AS window_start, end('w$) AS window_end])
   +- Exchange(distribution=[hash[bidder]])
      +- Calc(select=[bid.bidder AS bidder, PROCTIME() AS p_time], where=[(event_type = 2)])
         +- TableSourceScan(table=[[fluss, nexmark, events, project=[event_type, bid, dateTime], watermark=[-(TO_TIMESTAMP_LTZ(dateTime, 3), 4000:INTERVAL SECOND)], watermarkEmitStrategy=[on-periodic], filter=[]]], fields=[event_type, bid, dateTime])

== Physical Execution Plan ==
{
  "nodes" : [ {
    "id" : 2139,
    "type" : "Source: events[1429]",
    "pact" : "Data Source",
    "contents" : "[1429]:TableSourceScan(table=[[fluss, nexmark, events, project=[event_type, bid, dateTime], watermark=[-(TO_TIMESTAMP_LTZ(dateTime, 3), 4000:INTERVAL SECOND)], watermarkEmitStrategy=[on-periodic], filter=[]]], fields=[event_type, bid, dateTime])",
    "parallelism" : 4
  }, {
    "id" : 2140,
    "type" : "Calc[1430]",
    "pact" : "Operator",
    "contents" : "[1430]:Calc(select=[bid.bidder AS bidder, PROCTIME() AS p_time], where=[(event_type = 2)])",
    "parallelism" : 4,
    "predecessors" : [ {
      "id" : 2139,
      "ship_strategy" : "FORWARD",
      "side" : "second"
    } ]
  }, {
    "id" : 2142,
    "type" : "WindowAggregate[1432]",
    "pact" : "Operator",
    "contents" : "[1432]:WindowAggregate(groupBy=[bidder], window=[TUMBLE(time_col=[p_time], size=[10 s])], select=[bidder, COUNT(*) AS bid_count, start('w$) AS window_start, end('w$) AS window_end])",
    "parallelism" : 4,
    "predecessors" : [ {
      "id" : 2140,
      "ship_strategy" : "HASH",
      "side" : "second"
    } ]
  }, {
    "id" : 2145,
    "type" : "Sink(nexmark.output_a8650ae195c14e2ba63237305bb32938): Writer",
    "pact" : "Operator",
    "contents" : "Sink(nexmark.output_a8650ae195c14e2ba63237305bb32938): Writer",
    "parallelism" : 4,
    "predecessors" : [ {
      "id" : 2142,
      "ship_strategy" : "FORWARD",
      "side" : "second"
    } ]
  } ]
}