== Abstract Syntax Tree ==
LogicalSink(table=[default_catalog.default_database.sink], fields=[auction, bidder, price, channel, url, dateTime, extra, rank_number])
+- LogicalProject(auction=[$0], bidder=[$1], price=[$2], channel=[$3], url=[$4], dateTime=[$5], extra=[$6], rank_number=[$7])
   +- LogicalFilter(condition=[<=($7, 10)])
      +- LogicalProject(auction=[$0], bidder=[$1], price=[$2], channel=[$3], url=[$4], dateTime=[$5], extra=[$6], rank_number=[ROW_NUMBER() OVER (PARTITION BY $0 ORDER BY $2 DESC NULLS LAST)])
         +- 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)])
               +- 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=[[default_catalog, default_database, src]])

== Optimized Physical Plan ==
NativePaimonSink(reuseBarrier=[2003])
+- NativeCalc(reuseBarrier=[2002])
   +- NativeColumnarTopN(reuseBarrier=[2001])
      +- NativeColumnarExchange(reuseBarrier=[2000])
         +- NativeCalc(reuseBarrier=[1999])
            +- NativeKafkaDecode(topic=[nexmark], format=[json], watermarkColumn=[dateTime], watermarkExpression=[-(TO_TIMESTAMP_LTZ($4, 3), 4000:INTERVAL SECOND)], reuseBarrier=[1998])

== Optimized Execution Plan ==
NativePaimonSink
+- NativeCalc
   +- NativeColumnarTopN
      +- NativeColumnarExchange
         +- NativeCalc
            +- NativeKafkaDecode(topic=[nexmark], format=[json], watermarkColumn=[dateTime], watermarkExpression=[-(TO_TIMESTAMP_LTZ($4, 3), 4000:INTERVAL SECOND)])

== Physical Execution Plan ==
{
  "nodes" : [ {
    "id" : 5213,
    "type" : "Source: native-kafka-source",
    "pact" : "Data Source",
    "contents" : "Source: native-kafka-source",
    "parallelism" : 4
  }, {
    "id" : 5214,
    "type" : "NativeCalcExecNode[2370]",
    "pact" : "Operator",
    "contents" : "[2370]:NativeCalc",
    "parallelism" : 4,
    "predecessors" : [ {
      "id" : 5213,
      "ship_strategy" : "FORWARD",
      "side" : "second"
    } ]
  }, {
    "id" : 5215,
    "type" : "NativeColumnarExchangeExecNode[2371]",
    "pact" : "Operator",
    "contents" : "[2371]:NativeColumnarExchange",
    "parallelism" : 4,
    "predecessors" : [ {
      "id" : 5214,
      "ship_strategy" : "FORWARD",
      "side" : "second"
    } ]
  }, {
    "id" : 5217,
    "type" : "NativeColumnarTopNExecNode[2372]",
    "pact" : "Operator",
    "contents" : "[2372]:NativeColumnarTopN",
    "parallelism" : 4,
    "predecessors" : [ {
      "id" : 5215,
      "ship_strategy" : "columnar-key-group",
      "side" : "second"
    } ]
  }, {
    "id" : 5218,
    "type" : "NativeCalcExecNode[2373]",
    "pact" : "Operator",
    "contents" : "[2373]:NativeCalc",
    "parallelism" : 4,
    "predecessors" : [ {
      "id" : 5217,
      "ship_strategy" : "FORWARD",
      "side" : "second"
    } ]
  }, {
    "id" : 5219,
    "type" : "native-paimon-not-null-enforcer",
    "pact" : "Operator",
    "contents" : "native-paimon-not-null-enforcer",
    "parallelism" : 4,
    "predecessors" : [ {
      "id" : 5218,
      "ship_strategy" : "FORWARD",
      "side" : "second"
    } ]
  }, {
    "id" : 5220,
    "type" : "native-paimon-bucket-route",
    "pact" : "Operator",
    "contents" : "native-paimon-bucket-route",
    "parallelism" : 4,
    "predecessors" : [ {
      "id" : 5219,
      "ship_strategy" : "FORWARD",
      "side" : "second"
    } ]
  }, {
    "id" : 5222,
    "type" : "Writer : table",
    "pact" : "Operator",
    "contents" : "Writer : table",
    "parallelism" : 4,
    "predecessors" : [ {
      "id" : 5220,
      "ship_strategy" : "shuffle by bucket",
      "side" : "second"
    } ]
  }, {
    "id" : 5223,
    "type" : "Global Committer : table",
    "pact" : "Operator",
    "contents" : "Global Committer : table",
    "parallelism" : 1,
    "predecessors" : [ {
      "id" : 5222,
      "ship_strategy" : "REBALANCE",
      "side" : "second"
    } ]
  }, {
    "id" : 5227,
    "type" : "end: Writer",
    "pact" : "Operator",
    "contents" : "end: Writer",
    "parallelism" : 1,
    "predecessors" : [ {
      "id" : 5223,
      "ship_strategy" : "FORWARD",
      "side" : "second"
    } ]
  } ]
}