(
(let $1 (DataType 'String))
(let $2 (OptionalType $1))
(let $3 (TupleType $2 $2))
(let $4 (TupleType $3 $3))
(let $5 '('"key" $1))
(let $6 (StructType '('_yql_agg_0 $4) '('_yql_agg_1 $4) $5))
(let $7 '('('"_logical_id" '4852) '('"_id" '"b7c381c8-8f714b0c-f7ade249-3a49ad08") '('"_wide_channels" $6)))
(let $8 (DqPhyStage '() (lambda '() (block '(
  (let $17 '@@["StructType";[["key";["DataType";"String"]];["subkey";["DataType";"String"]];["value";["DataType";"String"]]]]@@)
  (let $18 (YqlRowSpec '('NativeYtTypeFlags '0) '('StrictSchema '1) '('UniqueKeys '0) '('Type $17)))
  (let $19 (YtMeta '('CanWrite '1) '('DoesExist '1) '('YqlCompatibleScheme '1) '('InferredScheme '0) '('IsDynamic '0) '('Attrs '('('"native_strict_schema" '"false")))))
  (let $20 (YtStat '('Id '"Input") '('RecordsCount '"10") '('DataSize '"396") '('ChunkCount '1) '('ModifyTime '0) '('Revision '0)))
  (let $21 (YtTable '"Input" $18 $19 $20 '() (Void) (Void) '"/Root/plato"))
  (let $22 '('"key" '"subkey" '"value"))
  (let $23 (YtReadTable! world (DataSource '"yt" '"/Root/plato") '((YtSection '((YtPath $21 $22 (Void) (Void))) '()))))
  (let $24 (Int32 '0))
  (let $25 (Nothing $2))
  (let $26 (lambda '($32 $33 $34 $35) (block '(
    (let $36 (If (!= (Size $34) $24) (Just $34) $25))
    (let $37 (If (!= (Size $35) $24) (Just $35) $25))
    (return $36 $37 $36 $37 $36 $37 $36 $37)
  ))))
  (let $27 (lambda '($38 $39 $40 $41 $42 $43 $44 $45 $46 $47 $48 $49) (block '(
    (let $50 (If (!= (Size $40) $24) (Just $40) $25))
    (let $51 (If (!= (Size $41) $24) (Just $41) $25))
    (let $52 (If (AggrEquals $44 $50) (AggrLess $45 $51) (AggrLess $44 $50)))
    (let $53 (If $52 $50 $42))
    (let $54 (If $52 $51 $43))
    (let $55 (If $52 $50 $44))
    (let $56 (If $52 $51 $45))
    (let $57 (If (AggrEquals $50 $48) (AggrLess $51 $49) (AggrLess $50 $48)))
    (let $58 (If $57 $50 $46))
    (let $59 (If $57 $51 $47))
    (let $60 (If $57 $50 $48))
    (let $61 (If $57 $51 $49))
    (return $53 $54 $55 $56 $58 $59 $60 $61)
  ))))
  (let $28 (lambda '($62 $63 $64 $65 $66 $67 $68 $69 $70) '('($63 $64) '($65 $66)) '('($67 $68) '($69 $70)) $62))
  (return (DqPhyHashCombine (WideToBlocks (FromFlow (DqReadWideWrap $23 '()))) '-1073741824 (lambda '($29 $30 $31) $29) $26 $27 $28))
))) $7))
(let $9 (DqCnHashShuffle (TDqOutput $8 '0) '('"2") '0 '"HashV2"))
(let $10 '('('"_logical_id" '5530) '('"_id" '"f9cdb149-a4d58dd7-db775240-76ef872b") '('"_partition_mode" '"aggregate")))
(let $11 (DqPhyStage '($9) (lambda '($71) (block '(
  (let $72 (lambda '($79 $80 $81 $82) (block '(
    (let $83 (Nth $80 '0))
    (let $84 (Nth $80 '1))
    (let $85 (Nth $81 '0))
    (let $86 (Nth $81 '1))
    (return (Nth $83 '0) (Nth $83 '1) (Nth $84 '0) (Nth $84 '1) (Nth $85 '0) (Nth $85 '1) (Nth $86 '0) (Nth $86 '1))
  ))))
  (let $73 (lambda '($87 $88 $89 $90 $91 $92 $93 $94 $95 $96 $97 $98) (block '(
    (let $99 (Nth $88 '1))
    (let $100 (Nth $99 '0))
    (let $101 (If (AggrEquals $93 $100) (AggrLess $94 (Nth $99 '1)) (AggrLess $93 $100)))
    (let $102 (If $101 $88 '('($91 $92) '($93 $94))))
    (let $103 (Nth $102 '0))
    (let $104 (Nth $102 '1))
    (let $105 (Nth $89 '1))
    (let $106 (Nth $105 '0))
    (let $107 (If (AggrEquals $106 $97) (AggrLess (Nth $105 '1) $98) (AggrLess $106 $97)))
    (let $108 (If $107 $89 '('($95 $96) '($97 $98))))
    (let $109 (Nth $108 '0))
    (let $110 (Nth $108 '1))
    (return (Nth $103 '0) (Nth $103 '1) (Nth $104 '0) (Nth $104 '1) (Nth $109 '0) (Nth $109 '1) (Nth $110 '0) (Nth $110 '1))
  ))))
  (let $74 (lambda '($111 $112 $113 $114 $115 $116 $117 $118 $119) '($112 $113) '($116 $117) $111))
  (let $75 (WideCombiner (ToFlow (WideFromBlocks $71)) '"" (lambda '($76 $77 $78) $78) $72 $73 $74))
  (return (FromFlow (NarrowMap $75 (lambda '($120 $121 $122) (AsStruct '('"key" $122) '('"max" $120) '('"min" $121))))))
))) $10))
(let $12 (DqCnUnionAll (TDqOutput $11 '0)))
(let $13 (DqPhyStage '($12) (lambda '($123) $123) '('('"_logical_id" '5734) '('"_id" '"3b0e484-6688ba92-ae825d8a-4699e282"))))
(let $14 '($8 $11 $13))
(let $15 '('"key" '"min" '"max"))
(let $16 (DqCnResult (TDqOutput $13 '0) $15))
(return (KqpPhysicalQuery '((KqpPhysicalTx $14 '($16) '() '('('"type" '"generic")))) '((KqpTxResultBinding (ListType (StructType $5 '('"max" $3) '('"min" $3))) '0 '0)) '('('"type" '"query"))))
)
