(
(declare %kqp%tx_result_binding_0_0 (OptionalType (StructType '('Count0 (DataType 'Uint64)) '('Min0 (DataType 'Uint32)) '('Sum0 (DataType 'Uint64)))))
(let $1 '@@["StructType";[["key";["DataType";"Uint32"]];["subkey";["DataType";"Uint32"]]]]@@)
(let $2 (YqlRowSpec '('NativeYtTypeFlags '0) '('StrictSchema '1) '('UniqueKeys '0) '('Type $1)))
(let $3 (YtMeta '('CanWrite '1) '('DoesExist '1) '('YqlCompatibleScheme '1) '('InferredScheme '0) '('IsDynamic '0) '('Attrs '('('"native_strict_schema" 'false)))))
(let $4 (YtStat '('Id '"Input") '('RecordsCount '"3") '('DataSize '"78") '('ChunkCount '1) '('ModifyTime '0) '('Revision '0)))
(let $5 (YtTable '"Input" $2 $3 $4 '() (Void) (Void) '"/Root/plato"))
(let $6 (YtReadTable! world (DataSource '"yt" '"/Root/plato") '((YtSection '((YtPath $5 '('"key") (Void) (Void))) '()))))
(let $7 (DqReadWideWrap $6 '()))
(let $8 (Uint64 '1))
(let $9 (Bool 'false))
(let $10 (DataType 'Uint32))
(let $11 (OptionalType $10))
(let $12 (DataType 'Uint64))
(let $13 (OptionalType $12))
(let $14 (Nothing $13))
(let $15 '('"_logical_id" '2153))
(let $16 (StructType '('_yql_agg_0 $13) '('_yql_agg_1 $11) '('_yql_agg_2 $13)))
(let $17 '('"_wide_channels" $16))
(let $18 '($15 '('"_id" '"eb50e3ca-be000388-eb9d5ef1-5908c6b8") $17))
(let $19 (DqPhyStage '() (lambda '() (block '(
  (let $43 (Condense1 (NarrowMap $7 (lambda '($45) (AsStruct '('"key" $45)))) (lambda '($46) $8) (lambda '($47 $48) $9) (lambda '($49 $50) (AggrAdd $50 $8))))
  (let $44 (lambda '($51) (Just $51) (Nothing $11) $14))
  (return (FromFlow (ExpandMap $43 $44)))
))) $18))
(let $20 (StructType '('_yql_agg_1 $10) '('_yql_agg_2 $12) '('"key" $10)))
(let $21 '($15 '('"_id" '"ef113a63-ec92a307-2ed11b05-3e77debb") '('"_wide_channels" $20)))
(let $22 (DqPhyStage '() (lambda '() (block '(
  (let $52 (lambda '($59 $60) $59 $60 $59))
  (return (DqPhyHashCombine (WideToBlocks (FromFlow $7)) '-1073741824 (lambda '($53) $53) (lambda '($54 $55) (SafeCast $55 $12)) (lambda '($56 $57 $58) $58) $52))
))) $21))
(let $23 (DqCnHashShuffle (TDqOutput $22 '0) '('"2") '0 '"HashV2"))
(let $24 '('('"_logical_id" '2264) '('"_id" '"ed6640ee-54503ff0-75185ed9-54ce8f66") '('"_partition_mode" '"aggregate") $17))
(let $25 (DqPhyStage '($23) (lambda '($61) (block '(
  (let $62 (NarrowSqueezeToDict (ToFlow (WideFromBlocks $61)) (lambda '($65 $66 $67) $67) (lambda '($68 $69 $70) (AsStruct '('_yql_agg_1 $68) '('_yql_agg_2 $69) '('"key" $70))) '('Auto 'Many)))
  (let $63 (Condense1 (OrderedFlatMap $62 (lambda '($71) (OrderedFlatMap (DictPayloads $71) (lambda '($72) $72)))) (lambda '($73) $73) (lambda '($74 $75) (AggrNotEquals (Member $74 '"key") (Member $75 '"key"))) (lambda '($76 $77) $76)))
  (let $64 (lambda '($78) $14 (Just (Member $78 '_yql_agg_1)) (Just (Member $78 '_yql_agg_2))))
  (return (FromFlow (ExpandMap $63 $64)))
))) $24))
(let $26 (DqCnParallelUnionAll (TDqOutput $19 '0)))
(let $27 (DqCnParallelUnionAll (TDqOutput $25 '0)))
(let $28 '('('"_logical_id" '2529) '('"_id" '"28f40ecb-3bd021ba-85b31a8e-b51866a") $17))
(let $29 (DqPhyStage '($26 $27) (lambda '($79 $80) (FromFlow (Extend (ToFlow $79) (ToFlow $80)))) $28))
(let $30 (DqCnUnionAll (TDqOutput $29 '0)))
(let $31 (OptionalType (StructType '('Count0 $12) '('Min0 $10) '('Sum0 $12))))
(let $32 (DqPhyStage '($30) (lambda '($81) (block '(
  (let $82 (lambda '($85 $86 $87) $85 $86 $87))
  (let $83 (lambda '($94 $95 $96 $97 $98 $99) (block '(
    (let $100 (IfPresent $94 (lambda '($103) (IfPresent $97 (lambda '($104) (Just (AggrAdd $103 $104))) $94)) $97))
    (let $101 (IfPresent $95 (lambda '($105) (IfPresent $98 (lambda '($106) (Just (AggrMin $105 $106))) $95)) $98))
    (let $102 (IfPresent $96 (lambda '($107) (IfPresent $99 (lambda '($108) (Just (AggrAdd $107 $108))) $96)) $99))
    (return $100 $101 $102)
  ))))
  (let $84 (WideCondense1 (ToFlow $81) $82 (lambda '($88 $89 $90 $91 $92 $93) $9) $83))
  (return (FromFlow (Condense (NarrowMap (Take $84 $8) (lambda '($109 $110 $111) (AsStruct '('Count0 (Unwrap $109)) '('Min0 (Unwrap $110)) '('Sum0 (Unwrap $111))))) (Nothing $31) (lambda '($112 $113) $9) (lambda '($114 $115) (Just $114)))))
))) '('('"_logical_id" '2794) '('"_id" '"4dfc5a4b-b999b855-8922335-37e2a98d"))))
(let $33 '($19 $22 $25 $29 $32))
(let $34 (DqCnValue (TDqOutput $32 '0)))
(let $35 (KqpPhysicalTx $33 '($34) '() '('('"type" '"compute"))))
(let $36 '"%kqp%tx_result_binding_0_0")
(let $37 '('('"_logical_id" '2852) '('"_id" '"752e8a4-cb9e8162-de914e4-5f96b620") '('"_partition_mode" '"single")))
(let $38 (DqPhyStage '() (lambda '() (block '(
  (let $116 %kqp%tx_result_binding_0_0)
  (return (Iterator (AsList (AsStruct '('"column0" (Coalesce (Member $116 'Count0) (Uint64 '0))) '('"column1" (Member $116 'Sum0)) '('"column2" (Member $116 'Min0))))))
))) $37))
(let $39 '('"column0" '"column1" '"column2"))
(let $40 (DqCnResult (TDqOutput $38 '0) $39))
(let $41 (KqpTxResultBinding $31 '0 '0))
(let $42 (KqpPhysicalTx '($38) '($40) '('($36 $41)) '('('"type" '"generic"))))
(return (KqpPhysicalQuery '($35 $42) '((KqpTxResultBinding (ListType (StructType '('"column0" $12) '('"column1" $13) '('"column2" $11))) '1 '0)) '('('"type" '"query"))))
)
