== Abstract Syntax Tree ==
LogicalSink(table=[default_catalog.default_database.sink], fields=[channel, day, minute, total_bids, rank1_bids, rank2_bids, rank3_bids, total_bidders, rank1_bidders, rank2_bidders, rank3_bidders, total_auctions, rank1_auctions, rank2_auctions, rank3_auctions])
+- LogicalAggregate(group=[{0, 1}], minute=[MAX($2)], total_bids=[COUNT()], rank1_bids=[COUNT() FILTER $3], rank2_bids=[COUNT() FILTER $4], rank3_bids=[COUNT() FILTER $5], total_bidders=[COUNT(DISTINCT $6)], rank1_bidders=[COUNT(DISTINCT $6) FILTER $3], rank2_bidders=[COUNT(DISTINCT $6) FILTER $4], rank3_bidders=[COUNT(DISTINCT $6) FILTER $5], total_auctions=[COUNT(DISTINCT $7)], rank1_auctions=[COUNT(DISTINCT $7) FILTER $3], rank2_auctions=[COUNT(DISTINCT $7) FILTER $4], rank3_auctions=[COUNT(DISTINCT $7) FILTER $5])
   +- LogicalProject(channel=[$3], day=[DATE_FORMAT($5, _UTF-16LE'yyyy-MM-dd')], $f2=[DATE_FORMAT($5, _UTF-16LE'HH:mm')], $f3=[IS TRUE(<($2, 10000))], $f4=[IS TRUE(SEARCH($2, Sarg[[10000..1000000)]))], $f5=[IS TRUE(>=($2, 1000000))], bidder=[$1], auction=[$0])
      +- 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=[1738])
+- NativeColumnarGroupAggregate(reuseBarrier=[1737])
   +- NativeColumnarExchange(reuseBarrier=[1736])
      +- NativeCalc(reuseBarrier=[1735])
         +- NativeKafkaDecode(topic=[nexmark], format=[json], watermarkColumn=[dateTime], watermarkExpression=[-(TO_TIMESTAMP_LTZ($4, 3), 4000:INTERVAL SECOND)], reuseBarrier=[1734])

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

== Physical Execution Plan ==
{
  "nodes" : [ {
    "id" : 3946,
    "type" : "Source: native-kafka-source",
    "pact" : "Data Source",
    "contents" : "Source: native-kafka-source",
    "parallelism" : 4
  }, {
    "id" : 3947,
    "type" : "NativeCalcExecNode[1854]",
    "pact" : "Operator",
    "contents" : "[1854]:NativeCalc",
    "parallelism" : 4,
    "predecessors" : [ {
      "id" : 3946,
      "ship_strategy" : "FORWARD",
      "side" : "second"
    } ]
  }, {
    "id" : 3948,
    "type" : "NativeColumnarExchangeExecNode[1855]",
    "pact" : "Operator",
    "contents" : "[1855]:NativeColumnarExchange",
    "parallelism" : 4,
    "predecessors" : [ {
      "id" : 3947,
      "ship_strategy" : "FORWARD",
      "side" : "second"
    } ]
  }, {
    "id" : 3950,
    "type" : "NativeColumnarGroupAggExecNode[1856]",
    "pact" : "Operator",
    "contents" : "[1856]:NativeColumnarGroupAggregate",
    "parallelism" : 4,
    "predecessors" : [ {
      "id" : 3948,
      "ship_strategy" : "columnar-key-group",
      "side" : "second"
    } ]
  }, {
    "id" : 3951,
    "type" : "native-paimon-not-null-enforcer",
    "pact" : "Operator",
    "contents" : "native-paimon-not-null-enforcer",
    "parallelism" : 4,
    "predecessors" : [ {
      "id" : 3950,
      "ship_strategy" : "FORWARD",
      "side" : "second"
    } ]
  }, {
    "id" : 3952,
    "type" : "native-paimon-bucket-route",
    "pact" : "Operator",
    "contents" : "native-paimon-bucket-route",
    "parallelism" : 4,
    "predecessors" : [ {
      "id" : 3951,
      "ship_strategy" : "FORWARD",
      "side" : "second"
    } ]
  }, {
    "id" : 3954,
    "type" : "Writer : table",
    "pact" : "Operator",
    "contents" : "Writer : table",
    "parallelism" : 4,
    "predecessors" : [ {
      "id" : 3952,
      "ship_strategy" : "shuffle by bucket",
      "side" : "second"
    } ]
  }, {
    "id" : 3955,
    "type" : "Global Committer : table",
    "pact" : "Operator",
    "contents" : "Global Committer : table",
    "parallelism" : 1,
    "predecessors" : [ {
      "id" : 3954,
      "ship_strategy" : "REBALANCE",
      "side" : "second"
    } ]
  }, {
    "id" : 3959,
    "type" : "end: Writer",
    "pact" : "Operator",
    "contents" : "end: Writer",
    "parallelism" : 1,
    "predecessors" : [ {
      "id" : 3955,
      "ship_strategy" : "FORWARD",
      "side" : "second"
    } ]
  } ]
}