== Abstract Syntax Tree ==
LogicalSink(table=[fluss.nexmark.output_39ea8bb7d3034e7990d309498c5be4d3], fields=[id, itemName, description, initialBid, reserve, dateTime, expires, seller, category, extra, auction, bidder, price, bid_dateTime, bid_extra])
+- LogicalProject(id=[$0], itemName=[$1], description=[$2], initialBid=[$3], reserve=[$4], dateTime=[$5], expires=[$6], seller=[$7], category=[$8], extra=[$9], auction=[$10], bidder=[$11], price=[$12], bid_dateTime=[$13], bid_extra=[$14])
   +- LogicalFilter(condition=[<=($15, 1)])
      +- LogicalProject(id=[$0], itemName=[$1], description=[$2], initialBid=[$3], reserve=[$4], dateTime=[$5], expires=[$6], seller=[$7], category=[$8], extra=[$9], auction=[$10], bidder=[$11], price=[$12], bid_dateTime=[$15], bid_extra=[$16], rownum=[ROW_NUMBER() OVER (PARTITION BY $0 ORDER BY $12 DESC NULLS LAST, $15 NULLS FIRST)])
         +- LogicalFilter(condition=[AND(=($0, $10), >=($15, $5), <=($15, $6))])
            +- LogicalJoin(condition=[true], 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(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_39ea8bb7d3034e7990d309498c5be4d3], fields=[id, itemName, description, initialBid, reserve, dateTime, expires, seller, category, extra, auction, bidder, price, dateTime0, extra0])
+- ArrowToRowData(reuseBarrier=[1958])
   +- NativeColumnarTopN(reuseBarrier=[1957])
      +- NativeColumnarExchange(reuseBarrier=[1956])
         +- NativeCalc(reuseBarrier=[1955])
            +- NativeColumnarUpdatingJoin(reuseBarrier=[1954], leftJoinKeyUnique=[false], rightJoinKeyUnique=[false])
               :- NativeColumnarExchange(reuseBarrier=[1939])
               :  +- NativeCalc(reuseBarrier=[1938])
               :     +- NativeMiniBatchAssigner(reuseBarrier=[1937])
               :        +- NativeCalc(reuseBarrier=[1936])
               :           +- NativeShare(consumers=[2], shareToken=[1934])
               :              +- NativeFlussSource(table=[nexmark.events], shareToken=[1934])
               +- NativeColumnarExchange(reuseBarrier=[1953])
                  +- NativeCalc(reuseBarrier=[1952])
                     +- NativeMiniBatchAssigner(reuseBarrier=[1951])
                        +- NativeCalc(reuseBarrier=[1950])
                           +- NativeShare(consumers=[2], shareToken=[1934])
                              +- NativeFlussSource(table=[nexmark.events], shareToken=[1934])

== Optimized Execution Plan ==
Sink(table=[fluss.nexmark.output_39ea8bb7d3034e7990d309498c5be4d3], fields=[id, itemName, description, initialBid, reserve, dateTime, expires, seller, category, extra, auction, bidder, price, dateTime0, extra0])
+- ArrowToRowData
   +- NativeColumnarTopN
      +- NativeColumnarExchange
         +- NativeCalc
            +- NativeColumnarUpdatingJoin(leftJoinKeyUnique=[false], rightJoinKeyUnique=[false])
               :- NativeColumnarExchange
               :  +- NativeCalc
               :     +- NativeMiniBatchAssigner
               :        +- NativeCalc
               :           +- NativeShare(consumers=[2])(reuse_id=[1])
               :              +- NativeFlussSource(table=[nexmark.events])
               +- NativeColumnarExchange
                  +- NativeCalc
                     +- NativeMiniBatchAssigner
                        +- NativeCalc
                           +- Reused(reference_id=[1])

== Physical Execution Plan ==
{
  "nodes" : [ {
    "id" : 2147,
    "type" : "Source: native-fluss-source",
    "pact" : "Data Source",
    "contents" : "Source: native-fluss-source",
    "parallelism" : 4
  }, {
    "id" : 2148,
    "type" : "NativeShareExecNode[1512]",
    "pact" : "Operator",
    "contents" : "[1512]:NativeShare(consumers=[2])",
    "parallelism" : 4,
    "predecessors" : [ {
      "id" : 2147,
      "ship_strategy" : "FORWARD",
      "side" : "second"
    } ]
  }, {
    "id" : 2149,
    "type" : "NativeCalcExecNode[1513]",
    "pact" : "Operator",
    "contents" : "[1513]:NativeCalc",
    "parallelism" : 4,
    "predecessors" : [ {
      "id" : 2148,
      "ship_strategy" : "FORWARD",
      "side" : "second"
    } ]
  }, {
    "id" : 2150,
    "type" : "NativeMiniBatchAssignerExecNode[1514]",
    "pact" : "Operator",
    "contents" : "[1514]:NativeMiniBatchAssigner",
    "parallelism" : 4,
    "predecessors" : [ {
      "id" : 2149,
      "ship_strategy" : "FORWARD",
      "side" : "second"
    } ]
  }, {
    "id" : 2151,
    "type" : "NativeCalcExecNode[1515]",
    "pact" : "Operator",
    "contents" : "[1515]:NativeCalc",
    "parallelism" : 4,
    "predecessors" : [ {
      "id" : 2150,
      "ship_strategy" : "FORWARD",
      "side" : "second"
    } ]
  }, {
    "id" : 2152,
    "type" : "NativeColumnarExchangeExecNode[1516]",
    "pact" : "Operator",
    "contents" : "[1516]:NativeColumnarExchange",
    "parallelism" : 4,
    "predecessors" : [ {
      "id" : 2151,
      "ship_strategy" : "FORWARD",
      "side" : "second"
    } ]
  }, {
    "id" : 2154,
    "type" : "NativeCalcExecNode[1517]",
    "pact" : "Operator",
    "contents" : "[1517]:NativeCalc",
    "parallelism" : 4,
    "predecessors" : [ {
      "id" : 2148,
      "ship_strategy" : "FORWARD",
      "side" : "second"
    } ]
  }, {
    "id" : 2155,
    "type" : "NativeMiniBatchAssignerExecNode[1518]",
    "pact" : "Operator",
    "contents" : "[1518]:NativeMiniBatchAssigner",
    "parallelism" : 4,
    "predecessors" : [ {
      "id" : 2154,
      "ship_strategy" : "FORWARD",
      "side" : "second"
    } ]
  }, {
    "id" : 2156,
    "type" : "NativeCalcExecNode[1519]",
    "pact" : "Operator",
    "contents" : "[1519]:NativeCalc",
    "parallelism" : 4,
    "predecessors" : [ {
      "id" : 2155,
      "ship_strategy" : "FORWARD",
      "side" : "second"
    } ]
  }, {
    "id" : 2157,
    "type" : "NativeColumnarExchangeExecNode[1520]",
    "pact" : "Operator",
    "contents" : "[1520]:NativeColumnarExchange",
    "parallelism" : 4,
    "predecessors" : [ {
      "id" : 2156,
      "ship_strategy" : "FORWARD",
      "side" : "second"
    } ]
  }, {
    "id" : 2159,
    "type" : "NativeColumnarUpdatingJoinExecNode[1521]",
    "pact" : "Operator",
    "contents" : "[1521]:NativeColumnarUpdatingJoin(leftJoinKeyUnique=[false], rightJoinKeyUnique=[false])",
    "parallelism" : 4,
    "predecessors" : [ {
      "id" : 2152,
      "ship_strategy" : "columnar-key-group",
      "side" : "second"
    }, {
      "id" : 2157,
      "ship_strategy" : "columnar-key-group",
      "side" : "second"
    } ]
  }, {
    "id" : 2160,
    "type" : "NativeCalcExecNode[1522]",
    "pact" : "Operator",
    "contents" : "[1522]:NativeCalc",
    "parallelism" : 4,
    "predecessors" : [ {
      "id" : 2159,
      "ship_strategy" : "FORWARD",
      "side" : "second"
    } ]
  }, {
    "id" : 2161,
    "type" : "NativeColumnarExchangeExecNode[1523]",
    "pact" : "Operator",
    "contents" : "[1523]:NativeColumnarExchange",
    "parallelism" : 4,
    "predecessors" : [ {
      "id" : 2160,
      "ship_strategy" : "FORWARD",
      "side" : "second"
    } ]
  }, {
    "id" : 2163,
    "type" : "NativeColumnarTopNExecNode[1524]",
    "pact" : "Operator",
    "contents" : "[1524]:NativeColumnarTopN",
    "parallelism" : 4,
    "predecessors" : [ {
      "id" : 2161,
      "ship_strategy" : "columnar-key-group",
      "side" : "second"
    } ]
  }, {
    "id" : 2164,
    "type" : "ArrowToRowDataExecNode[1525]",
    "pact" : "Operator",
    "contents" : "[1525]:ArrowToRowData",
    "parallelism" : 4,
    "predecessors" : [ {
      "id" : 2163,
      "ship_strategy" : "FORWARD",
      "side" : "second"
    } ]
  }, {
    "id" : 2165,
    "type" : "ConstraintEnforcer[1526]",
    "pact" : "Operator",
    "contents" : "[1526]:ConstraintEnforcer[NotNullEnforcer(fields=[id])]",
    "parallelism" : 4,
    "predecessors" : [ {
      "id" : 2164,
      "ship_strategy" : "FORWARD",
      "side" : "second"
    } ]
  }, {
    "id" : 2172,
    "type" : "Sink(nexmark.output_39ea8bb7d3034e7990d309498c5be4d3): Writer",
    "pact" : "Operator",
    "contents" : "Sink(nexmark.output_39ea8bb7d3034e7990d309498c5be4d3): Writer",
    "parallelism" : 4,
    "predecessors" : [ {
      "id" : 2165,
      "ship_strategy" : "BUCKET",
      "side" : "second"
    } ]
  } ]
}