== Abstract Syntax Tree ==
LogicalSink(table=[default_catalog.default_database.sink], fields=[auction, day, total_bids, rank1_bids, rank2_bids, rank3_bids, min_price, max_price, avg_price, sum_price])
+- LogicalAggregate(group=[{0, 1}], total_bids=[COUNT()], rank1_bids=[COUNT() FILTER $2], rank2_bids=[COUNT() FILTER $3], rank3_bids=[COUNT() FILTER $4], min_price=[MIN($5)], max_price=[MAX($5)], avg_price=[AVG($5)], sum_price=[SUM($5)])
   +- LogicalProject(auction=[$0], day=[DATE_FORMAT($5, _UTF-16LE'yyyy-MM-dd')], $f2=[IS TRUE(<($2, 10000))], $f3=[IS TRUE(SEARCH($2, Sarg[[10000..1000000)]))], $f4=[IS TRUE(>=($2, 1000000))], price=[$2])
      +- 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=[1822])
+- NativeColumnarGroupAggregate(reuseBarrier=[1821])
   +- NativeColumnarExchange(reuseBarrier=[1820])
      +- NativeCalc(reuseBarrier=[1819])
         +- NativeKafkaDecode(topic=[nexmark], format=[json], watermarkColumn=[dateTime], watermarkExpression=[-(TO_TIMESTAMP_LTZ($4, 3), 4000:INTERVAL SECOND)], reuseBarrier=[1818])

== 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" : 4337,
    "type" : "Source: native-kafka-source",
    "pact" : "Data Source",
    "contents" : "Source: native-kafka-source",
    "parallelism" : 4
  }, {
    "id" : 4338,
    "type" : "NativeCalcExecNode[2010]",
    "pact" : "Operator",
    "contents" : "[2010]:NativeCalc",
    "parallelism" : 4,
    "predecessors" : [ {
      "id" : 4337,
      "ship_strategy" : "FORWARD",
      "side" : "second"
    } ]
  }, {
    "id" : 4339,
    "type" : "NativeColumnarExchangeExecNode[2011]",
    "pact" : "Operator",
    "contents" : "[2011]:NativeColumnarExchange",
    "parallelism" : 4,
    "predecessors" : [ {
      "id" : 4338,
      "ship_strategy" : "FORWARD",
      "side" : "second"
    } ]
  }, {
    "id" : 4341,
    "type" : "NativeColumnarGroupAggExecNode[2012]",
    "pact" : "Operator",
    "contents" : "[2012]:NativeColumnarGroupAggregate",
    "parallelism" : 4,
    "predecessors" : [ {
      "id" : 4339,
      "ship_strategy" : "columnar-key-group",
      "side" : "second"
    } ]
  }, {
    "id" : 4342,
    "type" : "native-paimon-not-null-enforcer",
    "pact" : "Operator",
    "contents" : "native-paimon-not-null-enforcer",
    "parallelism" : 4,
    "predecessors" : [ {
      "id" : 4341,
      "ship_strategy" : "FORWARD",
      "side" : "second"
    } ]
  }, {
    "id" : 4343,
    "type" : "native-paimon-bucket-route",
    "pact" : "Operator",
    "contents" : "native-paimon-bucket-route",
    "parallelism" : 4,
    "predecessors" : [ {
      "id" : 4342,
      "ship_strategy" : "FORWARD",
      "side" : "second"
    } ]
  }, {
    "id" : 4345,
    "type" : "Writer : table",
    "pact" : "Operator",
    "contents" : "Writer : table",
    "parallelism" : 4,
    "predecessors" : [ {
      "id" : 4343,
      "ship_strategy" : "shuffle by bucket",
      "side" : "second"
    } ]
  }, {
    "id" : 4346,
    "type" : "Global Committer : table",
    "pact" : "Operator",
    "contents" : "Global Committer : table",
    "parallelism" : 1,
    "predecessors" : [ {
      "id" : 4345,
      "ship_strategy" : "REBALANCE",
      "side" : "second"
    } ]
  }, {
    "id" : 4350,
    "type" : "end: Writer",
    "pact" : "Operator",
    "contents" : "end: Writer",
    "parallelism" : 1,
    "predecessors" : [ {
      "id" : 4346,
      "ship_strategy" : "FORWARD",
      "side" : "second"
    } ]
  } ]
}