(
(let $1 (DataType 'Uint64))
(let $2 (DataType 'Uint32))
(let $3 (StructType '('_yql_agg_0 $2) '('_yql_agg_1 $1) '('"key" $2)))
(let $4 '('('"_logical_id" '1675) '('"_id" '"e7f5b2da-c7479e9e-88830b23-1701b4a7") '('"_wide_channels" $3)))
(let $5 (DqPhyStage '() (lambda '() (block '(
  (let $21 '@@["StructType";[["key";["DataType";"Uint32"]];["subkey";["DataType";"Uint32"]]]]@@)
  (let $22 (YqlRowSpec '('NativeYtTypeFlags '0) '('StrictSchema '1) '('UniqueKeys '0) '('Type $21)))
  (let $23 (YtMeta '('CanWrite '1) '('DoesExist '1) '('YqlCompatibleScheme '1) '('InferredScheme '0) '('IsDynamic '0) '('Attrs '('('"native_strict_schema" 'false)))))
  (let $24 (YtStat '('Id '"Input") '('RecordsCount '"3") '('DataSize '"78") '('ChunkCount '1) '('ModifyTime '0) '('Revision '0)))
  (let $25 (YtTable '"Input" $22 $23 $24 '() (Void) (Void) '"/Root/plato"))
  (let $26 (YtReadTable! world (DataSource '"yt" '"/Root/plato") '((YtSection '((YtPath $25 '('"key") (Void) (Void))) '()))))
  (let $27 (lambda '($34 $35) $34 $35 $34))
  (return (DqPhyHashCombine (WideToBlocks (FromFlow (DqReadWideWrap $26 '()))) '-1073741824 (lambda '($28) $28) (lambda '($29 $30) (SafeCast $30 $1)) (lambda '($31 $32 $33) $33) $27))
))) $4))
(let $6 (DqCnHashShuffle (TDqOutput $5 '0) '('"2") '0 '"HashV2"))
(let $7 '('"_partition_mode" '"aggregate"))
(let $8 (OptionalType $2))
(let $9 (OptionalType $1))
(let $10 '('('"_logical_id" '1767) '('"_id" '"d7cadcf-52b9a46f-7fd123ed-3b9455b9") $7 '('"_wide_channels" (StructType '('_yql_agg_0 $8) '('_yql_agg_1 $9)))))
(let $11 (DqPhyStage '($6) (lambda '($36) (block '(
  (let $37 (NarrowSqueezeToDict (ToFlow (WideFromBlocks $36)) (lambda '($40 $41 $42) $42) (lambda '($43 $44 $45) (AsStruct '('_yql_agg_0 $43) '('_yql_agg_1 $44) '('"key" $45))) '('Auto 'Many)))
  (let $38 (Condense1 (OrderedFlatMap $37 (lambda '($46) (OrderedFlatMap (DictPayloads $46) (lambda '($47) $47)))) (lambda '($48) $48) (lambda '($49 $50) (AggrNotEquals (Member $49 '"key") (Member $50 '"key"))) (lambda '($51 $52) $51)))
  (let $39 (lambda '($53) (Just (Member $53 '_yql_agg_0)) (Just (Member $53 '_yql_agg_1))))
  (return (FromFlow (ExpandMap $38 $39)))
))) $10))
(let $12 (DqCnUnionAll (TDqOutput $11 '0)))
(let $13 (Bool 'false))
(let $14 (StructType '('Min0 $2) '('Sum0 $1)))
(let $15 '('('"_logical_id" '2019) '('"_id" '"944bb883-318b0f20-78493703-390748e4") $7 '('"_wide_channels" $14)))
(let $16 (DqPhyStage '($12) (lambda '($54) (block '(
  (let $55 (lambda '($59 $60) $59 $60))
  (let $56 (lambda '($65 $66 $67 $68) (block '(
    (let $69 (IfPresent $65 (lambda '($71) (IfPresent $67 (lambda '($72) (Just (AggrMin $71 $72))) $65)) $67))
    (let $70 (IfPresent $66 (lambda '($73) (IfPresent $68 (lambda '($74) (Just (AggrAdd $73 $74))) $66)) $68))
    (return $69 $70)
  ))))
  (let $57 (WideCondense1 (ToFlow $54) $55 (lambda '($61 $62 $63 $64) $13) $56))
  (let $58 (lambda '($75 $76) (Unwrap $75) (Unwrap $76)))
  (return (FromFlow (WideMap $57 $58)))
))) $15))
(let $17 (DqCnUnionAll (TDqOutput $16 '0)))
(let $18 (DqPhyStage '($17) (lambda '($77) (block '(
  (let $78 (Condense (NarrowMap (ToFlow $77) (lambda '($79 $80) (AsStruct '('Min0 $79) '('Sum0 $80)))) (List (ListType $14)) (lambda '($81 $82) $13) (lambda '($83 $84) (AsList $83))))
  (return (FromFlow (Map $78 (lambda '($85) (block '(
    (let $86 (ToOptional $85))
    (return (AsStruct '('"column0" (Member $86 'Sum0)) '('"column1" (Member $86 'Min0))))
  ))))))
))) '('('"_logical_id" '2201) '('"_id" '"ec17a5b8-60d5ef78-a615a0c7-3ea7d774"))))
(let $19 '($5 $11 $16 $18))
(let $20 (DqCnResult (TDqOutput $18 '0) '('"column0" '"column1")))
(return (KqpPhysicalQuery '((KqpPhysicalTx $19 '($20) '() '('('"type" '"generic")))) '((KqpTxResultBinding (ListType (StructType '('"column0" $9) '('"column1" $8))) '0 '0)) '('('"type" '"query"))))
)
