
Group[@0]
  Logical Expressions:
    [1] id:52#0 | cost=null | estRows=10,800,000,000 | children=[] | LogicalFileScan ( qualified=truewatch_iceberg_rest_4809.variant_truewatch_60d_pk_20260805_probe_perf5d_b128_range_sp4096.browser_access_pk_variant_unshredded, output=[event_date#0, event_time#1, event_time_ms#2, event_id#3, source#4, dw_keyword#5, load_version#6, message#7, _row_id#8, _last_updated_sequence_number#9], operativeCols=[event_date#0, event_time#1] )
  Physical Expressions:
    [1] id:97#0 | cost=54,000,000,000 [cpu=54,000,000,000, mem=0, net=0] | estRows=-1 | children=[] | PhysicalFileScan[98]@0 ( table=browser_access_pk_variant_unshredded, stats=null, qualified=truewatch_iceberg_rest_4809.variant_truewatch_60d_pk_20260805_probe_perf5d_b128_range_sp4096.browser_access_pk_variant_unshredded, selected partitions num=0, operativeCols=[event_date#0, event_time#1] )
  Enforcers:
    (none)
  Chosen Expression ID: 97
  Chosen Properties: DistributionSpecStorageAny Order: ([])
  Statistics
    rows=1.08E10
    tupleSize=70.0
    width=1
    event_date#0 -> ndv=60.0000, min=20260601000000.000000(2026-06-01), max=20260730000000.000000(2026-07-30), count=10800000000.0000, numNulls=0.0000, avgSizeByte=4.000000, hotValues=(null)
    event_time#1 -> ndv=5250066432.0000, min=20260601080000.000000(2026-06-01 08:00:00.000000), max=20260731075959.000000(2026-07-31 07:59:59.999000), count=10800000000.0000, numNulls=0.0000, avgSizeByte=8.000000, hotValues=(null)
    event_time_ms#2 -> ndv=5247328768.0000, min=1780272000000.000000(1780272000000), max=1785455999999.000000(1785455999999), count=10800000000.0000, numNulls=0.0000, avgSizeByte=8.000000, hotValues=(null)
    event_id#3 -> ndv=10774758400.0000, min=32199684108857392.000000(req-0000000076b7ae98), max=32199684112410216.000000(req-ffffffffb0ebb403), count=10800000000.0000, numNulls=0.0000, avgSizeByte=20.000000, hotValues=(null)
    source#4 -> ndv=1.0000, min=27710370788631920.000000(browser-rum), max=27710370788631920.000000(browser-rum), count=10800000000.0000, numNulls=0.0000, avgSizeByte=11.000000, hotValues=(null)
    dw_keyword#5 -> ndv=1.0000, min=27710370788631920.000000(browser_access_log), max=27710370788631920.000000(browser_access_log), count=10800000000.0000, numNulls=0.0000, avgSizeByte=18.000000, hotValues=(null)
    load_version#6 -> ndv=1.0000, min=1.000000(1), max=1.000000(1), count=10800000000.0000, numNulls=0.0000, avgSizeByte=4.000000, hotValues=(null)
    message#7 -> unknown(1.08E10)
    _row_id#8 -> unknown(1.08E10)
    _last_updated_sequence_number#9 -> unknown(1.08E10)
  Lowest Plan
    ── Entry #1 ──────────────────────────────
    Cost: 54,000,000,000
    Properties: ANY
    Expression ID: 97#0
    ── Entry #2 ────────────────────────────── BEST
    Cost: 54,000,000,000
    Properties: DistributionSpecStorageAny Order: ([])
    Expression ID: 97#0
  struct info map
StructInfoMap{ groupExpressionMapByRelationId=[], infoMapByRelationId=[], groupExpressionMapByTableId=[{0}], infoMapByTableId=[], refreshVersion={{0}=84696351}}
═══════════════════════════════════════════════════════════

Group[@1]
  Logical Expressions:
    [1] id:55#1 | cost=null | estRows=180,000,000 | children=[@0] | LogicalFilter[56] ( predicates=(event_date#0 = 2026-06-15) )
  Physical Expressions:
    [1] id:94#1 | cost=0 [cpu=0, mem=0, net=0] | estRows=-1 | children=[@0] | PhysicalFilter[95]@1 ( stats=null, predicates=(event_date#0 = 2026-06-15) )
  Enforcers:
    (none)
  Chosen Expression ID: 94
  Chosen Properties: DistributionSpecStorageAny Order: ([])
  Statistics
    rows=1.8E8
    tupleSize=70.0
    width=1
    event_date#0 -> ndv=1.0000, min=20260615000000.000000(2026-06-15), max=20260615000000.000000(2026-06-15), count=0.0000, numNulls=0.0000, avgSizeByte=4.000000, hotValues=(2026-06-15:100.0)
    event_time#1 -> ndv=180000000.0000, min=20260601080000.000000(2026-06-01 08:00:00.000000), max=20260731075959.000000(2026-07-31 07:59:59.999000), count=10800000000.0000, numNulls=0.0000, avgSizeByte=8.000000, hotValues=(null)
    event_time_ms#2 -> ndv=180000000.0000, min=1780272000000.000000(1780272000000), max=1785455999999.000000(1785455999999), count=10800000000.0000, numNulls=0.0000, avgSizeByte=8.000000, hotValues=(null)
    event_id#3 -> ndv=180000000.0000, min=32199684108857392.000000(req-0000000076b7ae98), max=32199684112410216.000000(req-ffffffffb0ebb403), count=10800000000.0000, numNulls=0.0000, avgSizeByte=20.000000, hotValues=(null)
    source#4 -> ndv=1.0000, min=27710370788631920.000000(browser-rum), max=27710370788631920.000000(browser-rum), count=10800000000.0000, numNulls=0.0000, avgSizeByte=11.000000, hotValues=(null)
    dw_keyword#5 -> ndv=1.0000, min=27710370788631920.000000(browser_access_log), max=27710370788631920.000000(browser_access_log), count=10800000000.0000, numNulls=0.0000, avgSizeByte=18.000000, hotValues=(null)
    load_version#6 -> ndv=1.0000, min=1.000000(1), max=1.000000(1), count=10800000000.0000, numNulls=0.0000, avgSizeByte=4.000000, hotValues=(null)
    message#7 -> unknown(1.08E10)
    _row_id#8 -> unknown(1.08E10)
    _last_updated_sequence_number#9 -> unknown(1.08E10)
  Lowest Plan
    ── Entry #1 ──────────────────────────────
    Cost: 54,000,000,000
    Properties: ANY
    Expression ID: 94#1
    ChildrenRequires:
      [0] DistributionSpecStorageAny Order: ([])
    ── Entry #2 ────────────────────────────── BEST
    Cost: 54,000,000,000
    Properties: DistributionSpecStorageAny Order: ([])
    Expression ID: 94#1
    ChildrenRequires:
      [0] DistributionSpecStorageAny Order: ([])
  struct info map
StructInfoMap{ groupExpressionMapByRelationId=[], infoMapByRelationId=[], groupExpressionMapByTableId=[{0}], infoMapByTableId=[], refreshVersion={{0}=84696351}}
═══════════════════════════════════════════════════════════

Group[@2]
  Logical Expressions:
    [1] id:58#2 | cost=null | estRows=180,000,000 | children=[@1] | LogicalProject[59] ( distinct=false, projects=[event_time#1] )
  Physical Expressions:
    [1] id:89#2 | cost=1 [cpu=1, mem=0, net=0] | estRows=-1 | children=[@1] | PhysicalProject[90]@2 ( stats=null, projects=[event_time#1] )
  Enforcers:
    [1] id:112#2 | cost=36,000,000 [cpu=0, mem=0, net=24,000,000] | estRows=180,000,000 | children=[@2] | PhysicalDistribute[113]@2 ( stats=null, distributionSpec=DistributionSpecGather )
  Chosen Expression ID: 89
  Chosen Properties: DistributionSpecStorageAny Order: ([])
  Statistics
    rows=1.8E8
    tupleSize=8.0
    width=1
    event_time#1 -> ndv=180000000.0000, min=20260601080000.000000(2026-06-01 08:00:00.000000), max=20260731075959.000000(2026-07-31 07:59:59.999000), count=10800000000.0000, numNulls=0.0000, avgSizeByte=8.000000, hotValues=(null)
  Lowest Plan
    ── Entry #1 ──────────────────────────────
    Cost: 54,000,000,001
    Properties: ANY
    Expression ID: 89#2
    ChildrenRequires:
      [0] DistributionSpecStorageAny Order: ([])
    ── Entry #2 ────────────────────────────── BEST
    Cost: 54,000,000,001
    Properties: DistributionSpecStorageAny Order: ([])
    Expression ID: 89#2
    ChildrenRequires:
      [0] DistributionSpecStorageAny Order: ([])
    ── Entry #3 ──────────────────────────────
    Cost: 54,036,000,001
    Properties: GATHER
    Expression ID: 112#2
    ChildrenRequires:
      [0] DistributionSpecStorageAny Order: ([])
  struct info map
StructInfoMap{ groupExpressionMapByRelationId=[], infoMapByRelationId=[], groupExpressionMapByTableId=[{0}], infoMapByTableId=[], refreshVersion={{0}=84696351}}
═══════════════════════════════════════════════════════════

Group[@3]
  Logical Expressions:
    [1] id:61#3 | cost=null | estRows=1 | children=[@2] | LogicalAggregate[62] ( groupByExpr=[], outputExpr=[count(*) AS `row_count`#10, min(event_time#1) AS `min_time`#11, max(event_time#1) AS `max_time`#12], hasRepeat=false )
  Physical Expressions:
    [1] id:78#3 | cost=360,000,000 [cpu=180,000,000, mem=180,000,000, net=0] | estRows=-1 | children=[@2] | PhysicalHashAggregate[79]@3 ( stats=null, aggPhase=GLOBAL, aggMode=INPUT_TO_RESULT, maybeUseStreaming=false, groupByExpr=[], outputExpr=[count(*) AS `row_count`#10, min(event_time#1) AS `min_time`#11, max(event_time#1) AS `max_time`#12], partitionExpr=Optional.empty, topnFilter=false, topnPushDown=false )
    [2] id:84#3 | cost=2.06 [cpu=1.06, mem=1, net=0] | estRows=1 | children=[@5] | PhysicalHashAggregate[85]@3 ( stats=null, aggPhase=GLOBAL, aggMode=BUFFER_TO_RESULT, maybeUseStreaming=false, groupByExpr=[], outputExpr=[count(partial_count(*)#13) AS `row_count`#10, min(partial_min(event_time)#14) AS `min_time`#11, max(partial_max(event_time)#15) AS `max_time`#12], partitionExpr=Optional.empty, topnFilter=false, topnPushDown=false )
  Enforcers:
    (none)
  Chosen Expression ID: 84
  Chosen Properties: GATHER
  Statistics
    rows=1.0
    tupleSize=24.0
    width=1
    row_count#10 -> unknown(1.0)
    min_time#11 -> ndv=1.0000, min=20260601080000.000000(2026-06-01 08:00:00.000000), max=20260731075959.000000(2026-07-31 07:59:59.999000), count=10800000000.0000, numNulls=0.0000, avgSizeByte=8.000000, hotValues=(null)
    max_time#12 -> ndv=1.0000, min=20260601080000.000000(2026-06-01 08:00:00.000000), max=20260731075959.000000(2026-07-31 07:59:59.999000), count=10800000000.0000, numNulls=0.0000, avgSizeByte=8.000000, hotValues=(null)
  Lowest Plan
    ── Entry #1 ──────────────────────────────
    Cost: 54,120,000,003.08
    Properties: ANY
    Expression ID: 84#3
    ChildrenRequires:
      [0] GATHER
    ── Entry #2 ────────────────────────────── BEST
    Cost: 54,120,000,003.08
    Properties: GATHER
    Expression ID: 84#3
    ChildrenRequires:
      [0] GATHER
  struct info map
StructInfoMap{ groupExpressionMapByRelationId=[], infoMapByRelationId=[], groupExpressionMapByTableId=[{0}], infoMapByTableId=[{0}], refreshVersion={{0}=84696351}}
═══════════════════════════════════════════════════════════

ROOT Group[@4]
  Logical Expressions:
    [1] id:64#4 | cost=null | estRows=1 | children=[@3] | LogicalResultSink[65] ( outputExprs=[row_count#10, min_time#11, max_time#12] )
  Physical Expressions:
    [1] id:69#4 | cost=0 [cpu=0, mem=0, net=0] | estRows=-1 | children=[@3] | PhysicalResultSink[70] ( outputExprs=[row_count#10, min_time#11, max_time#12] )
  Enforcers:
    (none)
  Chosen Expression ID: 69
  Chosen Properties: GATHER
  Statistics
    rows=1.0
    tupleSize=24.0
    width=1
    row_count#10 -> unknown(1.0)
    min_time#11 -> ndv=1.0000, min=20260601080000.000000(2026-06-01 08:00:00.000000), max=20260731075959.000000(2026-07-31 07:59:59.999000), count=10800000000.0000, numNulls=0.0000, avgSizeByte=8.000000, hotValues=(null)
    max_time#12 -> ndv=1.0000, min=20260601080000.000000(2026-06-01 08:00:00.000000), max=20260731075959.000000(2026-07-31 07:59:59.999000), count=10800000000.0000, numNulls=0.0000, avgSizeByte=8.000000, hotValues=(null)
  Lowest Plan
    ── Entry #1 ──────────────────────────────
    Cost: 54,120,000,003.08
    Properties: ANY
    Expression ID: 69#4
    ChildrenRequires:
      [0] GATHER
    ── Entry #2 ────────────────────────────── BEST
    Cost: 54,120,000,003.08
    Properties: GATHER
    Expression ID: 69#4
    ChildrenRequires:
      [0] GATHER
  struct info map
StructInfoMap{ groupExpressionMapByRelationId=[], infoMapByRelationId=[], groupExpressionMapByTableId=[], infoMapByTableId=[], refreshVersion={}}
═══════════════════════════════════════════════════════════

Group[@5]
  Logical Expressions:
    (none)
  Physical Expressions:
    [1] id:81#5 | cost=120,000,000 [cpu=60,000,000.01, mem=60,000,000, net=0] | estRows=1 | children=[@2] | PhysicalHashAggregate[82]@5 ( stats=null, aggPhase=LOCAL, aggMode=INPUT_TO_BUFFER, maybeUseStreaming=false, groupByExpr=[], outputExpr=[partial_count(*) AS `partial_count(*)`#13, partial_max(event_time#1) AS `partial_max(event_time)`#15, partial_min(event_time#1) AS `partial_min(event_time)`#14], partitionExpr=Optional.empty, topnFilter=false, topnPushDown=false )
  Enforcers:
    [1] id:109#5 | cost=0.01 [cpu=0, mem=0, net=0.01] | estRows=1 | children=[@5] | PhysicalDistribute[110]@5 ( stats=null, distributionSpec=DistributionSpecGather )
  Chosen Enforcer(ID, RequiredProperties):
      (0)109,  GATHER
  Chosen Expression ID: 81
  Chosen Properties: DistributionSpecStorageAny Order: ([])
  Statistics
    rows=1.0
    tupleSize=24.0
    width=1
    partial_count(*)#13 -> unknown(1.0)
    partial_min(event_time)#14 -> ndv=1.0000, min=20260601080000.000000(2026-06-01 08:00:00.000000), max=20260731075959.000000(2026-07-31 07:59:59.999000), count=10800000000.0000, numNulls=0.0000, avgSizeByte=8.000000, hotValues=(null)
    partial_max(event_time)#15 -> ndv=1.0000, min=20260601080000.000000(2026-06-01 08:00:00.000000), max=20260731075959.000000(2026-07-31 07:59:59.999000), count=10800000000.0000, numNulls=0.0000, avgSizeByte=8.000000, hotValues=(null)
  Lowest Plan
    ── Entry #1 ──────────────────────────────
    Cost: 54,120,000,001.01
    Properties: ANY
    Expression ID: 81#5
    ChildrenRequires:
      [0] DistributionSpecStorageAny Order: ([])
    ── Entry #2 ────────────────────────────── BEST
    Cost: 54,120,000,001.01
    Properties: DistributionSpecStorageAny Order: ([])
    Expression ID: 81#5
    ChildrenRequires:
      [0] DistributionSpecStorageAny Order: ([])
    ── Entry #3 ────────────────────────────── BEST
    Cost: 54,120,000,001.02
    Properties: GATHER
    Expression ID: 109#5
    ChildrenRequires:
      [0] DistributionSpecStorageAny Order: ([])
  struct info map
StructInfoMap{ groupExpressionMapByRelationId=[], infoMapByRelationId=[], groupExpressionMapByTableId=[], infoMapByTableId=[], refreshVersion={}}

========== OPTIMIZED PLAN ==========
PhysicalResultSink[170] ( outputExprs=[row_count#10, min_time#11, max_time#12] )
+--PhysicalHashAggregate[166]@3 ( stats=1, aggPhase=GLOBAL, aggMode=BUFFER_TO_RESULT, maybeUseStreaming=false, groupByExpr=[], outputExpr=[count(partial_count(*)#13) AS `row_count`#10, min(partial_min(event_time)#14) AS `min_time`#11, max(partial_max(event_time)#15) AS `max_time`#12], partitionExpr=Optional.empty, topnFilter=false, topnPushDown=false )
   +--PhysicalDistribute[162]@5 ( stats=1, distributionSpec=DistributionSpecGather )
      +--PhysicalHashAggregate[158]@5 ( stats=1, aggPhase=LOCAL, aggMode=INPUT_TO_BUFFER, maybeUseStreaming=false, groupByExpr=[], outputExpr=[partial_count(*) AS `partial_count(*)`#13, partial_max(event_time#1) AS `partial_max(event_time)`#15, partial_min(event_time#1) AS `partial_min(event_time)`#14], partitionExpr=Optional.empty, topnFilter=false, topnPushDown=false )
         +--PhysicalProject[154]@2 ( stats=180,000,000, projects=[event_time#1] )
            +--PhysicalFilter[150]@1 ( stats=180,000,000, predicates=(event_date#0 = 2026-06-15) )
               +--PhysicalFileScan[146]@0 ( table=browser_access_pk_variant_unshredded, stats=10,800,000,000, qualified=truewatch_iceberg_rest_4809.variant_truewatch_60d_pk_20260805_probe_perf5d_b128_range_sp4096.browser_access_pk_variant_unshredded, selected partitions num=0, operativeCols=[event_date#0, event_time#1] )

========== MATERIALIZATIONS ==========

MaterializedView
MaterializedViewRewriteSuccessAndChose:

MaterializedViewRewriteSuccessButNotChose:

MaterializedViewRewriteFail:
 CBO.internal.variant_perf_doris.mv_truewatch_spark_unshredded fail
  FailInfo: View struct info is invalid:view plan is LogicalResultSink[111] ( outputExprs=[event_date#0, event_hour#10, main_domain#11, anomaly_type#12, visit_count#13, anomaly_count#14] )
+--LogicalProject[110] ( distinct=false, projects=[event_date#0, event_hour#10, main_domain#11, anomaly_type#12, visit_count#13, sum(CASE WHEN ( not (cast(element_at(message, 'anomalyType') as TEXT) = 'normal')) THEN 1 ELSE 0 END)#16 AS `anomaly_count`#14] )
   +--LogicalAggregate[109] ( groupByExpr=[event_date#0, event_hour#10, main_domain#11, anomaly_type#12], outputExpr=[event_date#0, event_hour#10, main_domain#11, anomaly_type#12, count(*) AS `visit_count`#13, sum(CASE WHEN ( not (cast(element_at(message, 'anomalyType') as TEXT) = 'normal')) THEN 1 ELSE 0 END#15) AS `sum(CASE WHEN ( not (cast(element_at(message, 'anomalyType') as TEXT) = 'normal')) THEN 1 ELSE 0 END)`#16], hasRepeat=false )
      +--LogicalProject[108] ( distinct=false, projects=[event_date#0, date_trunc(event_time#1, 'hour') AS `event_hour`#10, cast(element_at(message#7, 'mainDomain') as TEXT) AS `main_domain`#11, cast(element_at(message#7, 'anomalyType') as TEXT) AS `anomaly_type`#12, if(( not (cast(element_at(message#7, 'anomalyType') as TEXT) = 'normal')), 1, 0) AS `CASE WHEN ( not (cast(element_at(message, 'anomalyType') as TEXT) = 'normal')) THEN 1 ELSE 0 END`#15] )
         +--LogicalFilter[107] ( predicates=(event_date#0 = 2026-06-15) )
            +--LogicalFileScan ( qualified=truewatch_iceberg_rest_4809.variant_truewatch_60d_pk_20260805_probe_perf5d_b128_range_sp4096.browser_access_pk_variant_unshredded, output=[event_date#0, event_time#1, event_time_ms#2, event_id#3, source#4, dw_keyword#5, load_version#6, message#7, _row_id#8, _last_updated_sequence_number#9], operativeCols=[event_date#0, event_time#1, message#7] ), Query function roll up fail:queryExpression = min_time#11,
 mvExprToMvScanExprQueryBased = {event_date#0=event_date#16, cast(element_at(message#7, 'mainDomain') as TEXT)=main_domain#18, cast(element_at(message#7, 'anomalyType') as TEXT)=anomaly_type#19, count(*)=visit_count#20, sum(if(( not (cast(element_at(message#7, 'anomalyType') as TEXT) = 'normal')), 1, 0))=anomaly_count#21, date_trunc(event_time#1, 'hour')=event_hour#17}
