== Abstract Syntax Tree ==
LogicalSink(table=[fluss.nexmark.output_65d06b940f8b4ebd8a520376e80dcc07], fields=[auction, bidder, price, channel, url, dateTime, extra, itemName, description, initialBid, reserve, dateTime0, expires, seller, category, extra0])
+- LogicalProject(auction=[$0], bidder=[$1], price=[$2], channel=[$3], url=[$4], dateTime=[$5], extra=[$6], itemName=[$8], description=[$9], initialBid=[$10], reserve=[$11], dateTime0=[$12], expires=[$13], seller=[$14], category=[$15], extra0=[$16])
   +- LogicalFilter(condition=[=($15, 10)])
      +- LogicalJoin(condition=[=($0, $7)], joinType=[inner])
         :- 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]])
         +- LogicalProject(id=[$2.id], itemName=[$2.itemName], description=[$2.description], initialBid=[$2.initialBid], reserve=[$2.reserve], dateTime=[$5], expires=[TO_TIMESTAMP_LTZ($2.expires, 3)], seller=[$2.seller], category=[$2.category], extra=[$2.extra])
            +- LogicalFilter(condition=[=($0, 1)])
               +- 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_65d06b940f8b4ebd8a520376e80dcc07], fields=[auction, bidder, price, channel, url, dateTime, extra, itemName, description, initialBid, reserve, dateTime0, expires, seller, category, extra0])
+- Calc(select=[auction, bidder, price, channel, url, dateTime, extra, itemName, description, initialBid, reserve, dateTime0, expires, seller, CAST(10:BIGINT AS BIGINT) AS category, extra0])
   +- Join(joinType=[InnerJoin], where=[=(auction, id)], select=[auction, bidder, price, channel, url, dateTime, extra, id, itemName, description, initialBid, reserve, dateTime0, expires, seller, extra0], leftInputSpec=[NoUniqueKey], rightInputSpec=[NoUniqueKey], miniBatch=[true])
      :- Exchange(distribution=[hash[auction]])
      :  +- Calc(select=[bid.auction AS auction, bid.bidder AS bidder, bid.price AS price, bid.channel AS channel, bid.url AS url, CAST(Reinterpret(TO_TIMESTAMP_LTZ(dateTime, 3)) AS TIMESTAMP_WITH_LOCAL_TIME_ZONE(3)) AS dateTime, bid.extra AS extra], where=[=(event_type, 2)])
      :     +- MiniBatchAssigner(interval=[2000ms], mode=[ProcTime])
      :        +- 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])
      +- Exchange(distribution=[hash[id]])
         +- Calc(select=[auction.id AS id, auction.itemName AS itemName, auction.description AS description, auction.initialBid AS initialBid, auction.reserve AS reserve, CAST(Reinterpret(TO_TIMESTAMP_LTZ(dateTime, 3)) AS TIMESTAMP_WITH_LOCAL_TIME_ZONE(3)) AS dateTime, TO_TIMESTAMP_LTZ(auction.expires, 3) AS expires, auction.seller AS seller, auction.extra AS extra], where=[AND(=(event_type, 1), =(auction.category, 10:BIGINT))])
            +- MiniBatchAssigner(interval=[2000ms], mode=[ProcTime])
               +- TableSourceScan(table=[[fluss, nexmark, events, project=[event_type, auction, dateTime], watermark=[-(TO_TIMESTAMP_LTZ(dateTime, 3), 4000:INTERVAL SECOND)], watermarkEmitStrategy=[on-periodic], filter=[]]], fields=[event_type, auction, dateTime])

== Optimized Execution Plan ==
Sink(table=[fluss.nexmark.output_65d06b940f8b4ebd8a520376e80dcc07], fields=[auction, bidder, price, channel, url, dateTime, extra, itemName, description, initialBid, reserve, dateTime0, expires, seller, category, extra0])
+- Calc(select=[auction, bidder, price, channel, url, dateTime, extra, itemName, description, initialBid, reserve, dateTime0, expires, seller, CAST(10 AS BIGINT) AS category, extra0])
   +- Join(joinType=[InnerJoin], where=[(auction = id)], select=[auction, bidder, price, channel, url, dateTime, extra, id, itemName, description, initialBid, reserve, dateTime0, expires, seller, extra0], leftInputSpec=[NoUniqueKey], rightInputSpec=[NoUniqueKey], miniBatch=[true])
      :- Exchange(distribution=[hash[auction]])
      :  +- Calc(select=[bid.auction AS auction, bid.bidder AS bidder, bid.price AS price, bid.channel AS channel, bid.url AS url, CAST(Reinterpret(TO_TIMESTAMP_LTZ(dateTime, 3)) AS TIMESTAMP_WITH_LOCAL_TIME_ZONE(3)) AS dateTime, bid.extra AS extra], where=[(event_type = 2)])
      :     +- MiniBatchAssigner(interval=[2000ms], mode=[ProcTime])
      :        +- 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])
      +- Exchange(distribution=[hash[id]])
         +- Calc(select=[auction.id AS id, auction.itemName AS itemName, auction.description AS description, auction.initialBid AS initialBid, auction.reserve AS reserve, CAST(Reinterpret(TO_TIMESTAMP_LTZ(dateTime, 3)) AS TIMESTAMP_WITH_LOCAL_TIME_ZONE(3)) AS dateTime, TO_TIMESTAMP_LTZ(auction.expires, 3) AS expires, auction.seller AS seller, auction.extra AS extra], where=[((event_type = 1) AND (auction.category = 10))])
            +- MiniBatchAssigner(interval=[2000ms], mode=[ProcTime])
               +- TableSourceScan(table=[[fluss, nexmark, events, project=[event_type, auction, dateTime], watermark=[-(TO_TIMESTAMP_LTZ(dateTime, 3), 4000:INTERVAL SECOND)], watermarkEmitStrategy=[on-periodic], filter=[]]], fields=[event_type, auction, dateTime])

== Physical Execution Plan ==
{
  "nodes" : [ {
    "id" : 3705,
    "type" : "Source: events[2465]",
    "pact" : "Data Source",
    "contents" : "[2465]: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" : 3706,
    "type" : "MiniBatchAssigner[2466]",
    "pact" : "Operator",
    "contents" : "[2466]:MiniBatchAssigner(interval=[2000ms], mode=[ProcTime])",
    "parallelism" : 4,
    "predecessors" : [ {
      "id" : 3705,
      "ship_strategy" : "FORWARD",
      "side" : "second"
    } ]
  }, {
    "id" : 3707,
    "type" : "Calc[2467]",
    "pact" : "Operator",
    "contents" : "[2467]:Calc(select=[bid.auction AS auction, bid.bidder AS bidder, bid.price AS price, bid.channel AS channel, bid.url AS url, CAST(Reinterpret(TO_TIMESTAMP_LTZ(dateTime, 3)) AS TIMESTAMP_WITH_LOCAL_TIME_ZONE(3)) AS dateTime, bid.extra AS extra], where=[(event_type = 2)])",
    "parallelism" : 4,
    "predecessors" : [ {
      "id" : 3706,
      "ship_strategy" : "FORWARD",
      "side" : "second"
    } ]
  }, {
    "id" : 3709,
    "type" : "Source: events[2469]",
    "pact" : "Data Source",
    "contents" : "[2469]:TableSourceScan(table=[[fluss, nexmark, events, project=[event_type, auction, dateTime], watermark=[-(TO_TIMESTAMP_LTZ(dateTime, 3), 4000:INTERVAL SECOND)], watermarkEmitStrategy=[on-periodic], filter=[]]], fields=[event_type, auction, dateTime])",
    "parallelism" : 4
  }, {
    "id" : 3710,
    "type" : "MiniBatchAssigner[2470]",
    "pact" : "Operator",
    "contents" : "[2470]:MiniBatchAssigner(interval=[2000ms], mode=[ProcTime])",
    "parallelism" : 4,
    "predecessors" : [ {
      "id" : 3709,
      "ship_strategy" : "FORWARD",
      "side" : "second"
    } ]
  }, {
    "id" : 3711,
    "type" : "Calc[2471]",
    "pact" : "Operator",
    "contents" : "[2471]:Calc(select=[auction.id AS id, auction.itemName AS itemName, auction.description AS description, auction.initialBid AS initialBid, auction.reserve AS reserve, CAST(Reinterpret(TO_TIMESTAMP_LTZ(dateTime, 3)) AS TIMESTAMP_WITH_LOCAL_TIME_ZONE(3)) AS dateTime, TO_TIMESTAMP_LTZ(auction.expires, 3) AS expires, auction.seller AS seller, auction.extra AS extra], where=[((event_type = 1) AND (auction.category = 10))])",
    "parallelism" : 4,
    "predecessors" : [ {
      "id" : 3710,
      "ship_strategy" : "FORWARD",
      "side" : "second"
    } ]
  }, {
    "id" : 3713,
    "type" : "Join[2473]",
    "pact" : "Operator",
    "contents" : "[2473]:Join(joinType=[InnerJoin], where=[(auction = id)], select=[auction, bidder, price, channel, url, dateTime, extra, id, itemName, description, initialBid, reserve, dateTime0, expires, seller, extra0], leftInputSpec=[NoUniqueKey], rightInputSpec=[NoUniqueKey], miniBatch=[true])",
    "parallelism" : 4,
    "predecessors" : [ {
      "id" : 3707,
      "ship_strategy" : "HASH",
      "side" : "second"
    }, {
      "id" : 3711,
      "ship_strategy" : "HASH",
      "side" : "second"
    } ]
  }, {
    "id" : 3714,
    "type" : "Calc[2474]",
    "pact" : "Operator",
    "contents" : "[2474]:Calc(select=[auction, bidder, price, channel, url, dateTime, extra, itemName, description, initialBid, reserve, dateTime0, expires, seller, CAST(10 AS BIGINT) AS category, extra0])",
    "parallelism" : 4,
    "predecessors" : [ {
      "id" : 3713,
      "ship_strategy" : "FORWARD",
      "side" : "second"
    } ]
  }, {
    "id" : 3718,
    "type" : "Sink(nexmark.output_65d06b940f8b4ebd8a520376e80dcc07): Writer",
    "pact" : "Operator",
    "contents" : "Sink(nexmark.output_65d06b940f8b4ebd8a520376e80dcc07): Writer",
    "parallelism" : 4,
    "predecessors" : [ {
      "id" : 3714,
      "ship_strategy" : "FORWARD",
      "side" : "second"
    } ]
  } ]
}