== Abstract Syntax Tree ==
LogicalSink(table=[fluss.nexmark.output_6812bb6aa04d4325bfe24a5ba694f98d], fields=[name, city, state, id])
+- LogicalProject(name=[$11], city=[$14], state=[$15], id=[$0])
   +- LogicalFilter(condition=[AND(=($8, 10), OR(=($15, _UTF-16LE'OR'), =($15, _UTF-16LE'ID'), =($15, _UTF-16LE'CA')))])
      +- LogicalJoin(condition=[=($7, $10)], joinType=[inner])
         :- 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]])
         +- LogicalProject(id=[$1.id], name=[$1.name], emailAddress=[$1.emailAddress], creditCard=[$1.creditCard], city=[$1.city], state=[$1.state], dateTime=[$5], extra=[$1.extra])
            +- LogicalFilter(condition=[=($0, 0)])
               +- 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_6812bb6aa04d4325bfe24a5ba694f98d], fields=[name, city, state, id])
+- Calc(select=[name, city, state, id])
   +- Join(joinType=[InnerJoin], where=[=(seller, id0)], select=[id, seller, id0, name, city, state], leftInputSpec=[NoUniqueKey], rightInputSpec=[NoUniqueKey], miniBatch=[true])
      :- Exchange(distribution=[hash[seller]])
      :  +- Calc(select=[auction.id AS id, auction.seller AS seller], 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])
      +- Exchange(distribution=[hash[id]])
         +- Calc(select=[person.id AS id, person.name AS name, person.city AS city, person.state AS state], where=[AND(=(event_type, 0), SEARCH(person.state, Sarg[_UTF-16LE'CA':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'ID':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'OR':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"]:VARCHAR(2147483647) CHARACTER SET "UTF-16LE"))])
            +- MiniBatchAssigner(interval=[2000ms], mode=[ProcTime])
               +- TableSourceScan(table=[[fluss, nexmark, events, project=[event_type, person, dateTime], watermark=[-(TO_TIMESTAMP_LTZ(dateTime, 3), 4000:INTERVAL SECOND)], watermarkEmitStrategy=[on-periodic], filter=[]]], fields=[event_type, person, dateTime])

== Optimized Execution Plan ==
Sink(table=[fluss.nexmark.output_6812bb6aa04d4325bfe24a5ba694f98d], fields=[name, city, state, id])
+- Calc(select=[name, city, state, id])
   +- Join(joinType=[InnerJoin], where=[(seller = id0)], select=[id, seller, id0, name, city, state], leftInputSpec=[NoUniqueKey], rightInputSpec=[NoUniqueKey], miniBatch=[true])
      :- Exchange(distribution=[hash[seller]])
      :  +- Calc(select=[auction.id AS id, auction.seller AS seller], 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])
      +- Exchange(distribution=[hash[id]])
         +- Calc(select=[person.id AS id, person.name AS name, person.city AS city, person.state AS state], where=[((event_type = 0) AND SEARCH(person.state, Sarg[_UTF-16LE'CA', _UTF-16LE'ID', _UTF-16LE'OR']))])
            +- MiniBatchAssigner(interval=[2000ms], mode=[ProcTime])
               +- TableSourceScan(table=[[fluss, nexmark, events, project=[event_type, person, dateTime], watermark=[-(TO_TIMESTAMP_LTZ(dateTime, 3), 4000:INTERVAL SECOND)], watermarkEmitStrategy=[on-periodic], filter=[]]], fields=[event_type, person, dateTime])

== Physical Execution Plan ==
{
  "nodes" : [ {
    "id" : 441,
    "type" : "Source: events[337]",
    "pact" : "Data Source",
    "contents" : "[337]: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" : 442,
    "type" : "MiniBatchAssigner[338]",
    "pact" : "Operator",
    "contents" : "[338]:MiniBatchAssigner(interval=[2000ms], mode=[ProcTime])",
    "parallelism" : 4,
    "predecessors" : [ {
      "id" : 441,
      "ship_strategy" : "FORWARD",
      "side" : "second"
    } ]
  }, {
    "id" : 443,
    "type" : "Calc[339]",
    "pact" : "Operator",
    "contents" : "[339]:Calc(select=[auction.id AS id, auction.seller AS seller], where=[((event_type = 1) AND (auction.category = 10))])",
    "parallelism" : 4,
    "predecessors" : [ {
      "id" : 442,
      "ship_strategy" : "FORWARD",
      "side" : "second"
    } ]
  }, {
    "id" : 445,
    "type" : "Source: events[341]",
    "pact" : "Data Source",
    "contents" : "[341]:TableSourceScan(table=[[fluss, nexmark, events, project=[event_type, person, dateTime], watermark=[-(TO_TIMESTAMP_LTZ(dateTime, 3), 4000:INTERVAL SECOND)], watermarkEmitStrategy=[on-periodic], filter=[]]], fields=[event_type, person, dateTime])",
    "parallelism" : 4
  }, {
    "id" : 446,
    "type" : "MiniBatchAssigner[342]",
    "pact" : "Operator",
    "contents" : "[342]:MiniBatchAssigner(interval=[2000ms], mode=[ProcTime])",
    "parallelism" : 4,
    "predecessors" : [ {
      "id" : 445,
      "ship_strategy" : "FORWARD",
      "side" : "second"
    } ]
  }, {
    "id" : 447,
    "type" : "Calc[343]",
    "pact" : "Operator",
    "contents" : "[343]:Calc(select=[person.id AS id, person.name AS name, person.city AS city, person.state AS state], where=[((event_type = 0) AND SEARCH(person.state, Sarg[_UTF-16LE'CA', _UTF-16LE'ID', _UTF-16LE'OR']))])",
    "parallelism" : 4,
    "predecessors" : [ {
      "id" : 446,
      "ship_strategy" : "FORWARD",
      "side" : "second"
    } ]
  }, {
    "id" : 449,
    "type" : "Join[345]",
    "pact" : "Operator",
    "contents" : "[345]:Join(joinType=[InnerJoin], where=[(seller = id0)], select=[id, seller, id0, name, city, state], leftInputSpec=[NoUniqueKey], rightInputSpec=[NoUniqueKey], miniBatch=[true])",
    "parallelism" : 4,
    "predecessors" : [ {
      "id" : 443,
      "ship_strategy" : "HASH",
      "side" : "second"
    }, {
      "id" : 447,
      "ship_strategy" : "HASH",
      "side" : "second"
    } ]
  }, {
    "id" : 450,
    "type" : "Calc[346]",
    "pact" : "Operator",
    "contents" : "[346]:Calc(select=[name, city, state, id])",
    "parallelism" : 4,
    "predecessors" : [ {
      "id" : 449,
      "ship_strategy" : "FORWARD",
      "side" : "second"
    } ]
  }, {
    "id" : 454,
    "type" : "Sink(nexmark.output_6812bb6aa04d4325bfe24a5ba694f98d): Writer",
    "pact" : "Operator",
    "contents" : "Sink(nexmark.output_6812bb6aa04d4325bfe24a5ba694f98d): Writer",
    "parallelism" : 4,
    "predecessors" : [ {
      "id" : 450,
      "ship_strategy" : "FORWARD",
      "side" : "second"
    } ]
  } ]
}