== Abstract Syntax Tree ==
LogicalSink(table=[fluss.nexmark.output_77848910403b4dc9abad7c4db92e178c], 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_77848910403b4dc9abad7c4db92e178c], 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])
      :- 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)])
      :     +- 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))])
            +- 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_77848910403b4dc9abad7c4db92e178c], 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])
      :- 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)])
      :     +- 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))])
            +- 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" : 3383,
    "type" : "Source: events[2103]",
    "pact" : "Data Source",
    "contents" : "[2103]: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" : 3384,
    "type" : "Calc[2104]",
    "pact" : "Operator",
    "contents" : "[2104]: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" : 3383,
      "ship_strategy" : "FORWARD",
      "side" : "second"
    } ]
  }, {
    "id" : 3386,
    "type" : "Source: events[2106]",
    "pact" : "Data Source",
    "contents" : "[2106]: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" : 3387,
    "type" : "Calc[2107]",
    "pact" : "Operator",
    "contents" : "[2107]: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" : 3386,
      "ship_strategy" : "FORWARD",
      "side" : "second"
    } ]
  }, {
    "id" : 3389,
    "type" : "Join[2109]",
    "pact" : "Operator",
    "contents" : "[2109]: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])",
    "parallelism" : 4,
    "predecessors" : [ {
      "id" : 3384,
      "ship_strategy" : "HASH",
      "side" : "second"
    }, {
      "id" : 3387,
      "ship_strategy" : "HASH",
      "side" : "second"
    } ]
  }, {
    "id" : 3390,
    "type" : "Calc[2110]",
    "pact" : "Operator",
    "contents" : "[2110]: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" : 3389,
      "ship_strategy" : "FORWARD",
      "side" : "second"
    } ]
  }, {
    "id" : 3394,
    "type" : "Sink(nexmark.output_77848910403b4dc9abad7c4db92e178c): Writer",
    "pact" : "Operator",
    "contents" : "Sink(nexmark.output_77848910403b4dc9abad7c4db92e178c): Writer",
    "parallelism" : 4,
    "predecessors" : [ {
      "id" : 3390,
      "ship_strategy" : "FORWARD",
      "side" : "second"
    } ]
  } ]
}