(
(let $1 (lambda '($36 $37 $38) $38 $36 $37))
(let $2 (DataType 'Uint64))
(let $3 (OptionalType (DataType 'Int32)))
(let $4 (StructType '('_yql_agg_0 $2) '('mod_k $3) '('mod_sk $3)))
(let $5 '('('"_logical_id" '1356) '('"_id" '"c73e6539-d373ace9-8512c1f8-266f8913") '('"_wide_channels" $4)))
(let $6 (DqPhyStage '() (lambda '() (block '(
  (let $15 '@@["StructType";[["key";["DataType";"String"]];["subkey";["DataType";"String"]];["value";["DataType";"String"]]]]@@)
  (let $16 (YqlRowSpec '('NativeYtTypeFlags '0) '('StrictSchema '1) '('UniqueKeys '0) '('Type $15)))
  (let $17 (YtMeta '('CanWrite '1) '('DoesExist '1) '('YqlCompatibleScheme '1) '('InferredScheme '0) '('IsDynamic '0) '('Attrs '('('"native_strict_schema" '"false")))))
  (let $18 (YtStat '('Id '"Input") '('RecordsCount '"10") '('DataSize '"424") '('ChunkCount '1) '('ModifyTime '0) '('Revision '0)))
  (let $19 (YtTable '"Input" $16 $17 $18 '() (Void) (Void) '"/Root/plato"))
  (let $20 (YtReadTable! world (DataSource '"yt" '"/Root/plato") '((YtSection '((YtPath $19 '('"key" '"subkey") (Void) (Void))) '()))))
  (let $21 (lambda '($23 $24) (block '(
    (let $25 (OptionalType (DataType 'Uint32)))
    (let $26 (Int32 '"10"))
    (return (% (SafeCast $23 $25) $26) (% (SafeCast $24 $25) $26))
  ))))
  (let $22 (Uint64 '1))
  (return (DqPhyHashCombine (WideToBlocks (FromFlow (DqReadWideWrap $20 '()))) '-1073741824 $21 (lambda '($27 $28 $29 $30) $22) (lambda '($31 $32 $33 $34 $35) (AggrAdd $35 $22)) $1))
))) $5))
(let $7 (DqCnHashShuffle (TDqOutput $6 '0) '('1 '"2") '0 '"HashV2"))
(let $8 (StructType '('"count" $2) '('"mod_sum" $3)))
(let $9 '('('"_logical_id" '1962) '('"_id" '"2ea717f7-eec2381-da78fc34-256c64ef") '('"_wide_channels" $8)))
(let $10 (DqPhyStage '($7) (lambda '($39) (block '(
  (let $40 (lambda '($45 $46 $47) $46 $47))
  (let $41 (WideCombiner (ToFlow (WideFromBlocks $39)) '"" $40 (lambda '($48 $49 $50 $51 $52) $50) (lambda '($53 $54 $55 $56 $57 $58) (AggrAdd $55 $58)) $1))
  (let $42 (Bool 'true))
  (let $43 (Sort (NarrowMap $41 (lambda '($59 $60 $61) (AsStruct '('"count" $59) '('"mod_sum" (+ $61 $60))))) '($42 $42) (lambda '($62) '((Member $62 '"count") (Member $62 '"mod_sum")))))
  (let $44 (lambda '($63) (Member $63 '"count") (Member $63 '"mod_sum")))
  (return (FromFlow (ExpandMap $43 $44)))
))) $9))
(let $11 (DqCnMerge (TDqOutput $10 '0) '('('0 '"Asc") '('1 '"Asc"))))
(let $12 (DqPhyStage '($11) (lambda '($64) (FromFlow (NarrowMap (ToFlow $64) (lambda '($65 $66) (AsStruct '('"count" $65) '('"mod_sum" $66)))))) '('('"_logical_id" '1974) '('"_id" '"ed801b0a-8ea29241-ff11f697-20f2864e"))))
(let $13 '($6 $10 $12))
(let $14 (DqCnResult (TDqOutput $12 '0) '('"count" '"mod_sum")))
(return (KqpPhysicalQuery '((KqpPhysicalTx $13 '($14) '() '('('"type" '"generic")))) '((KqpTxResultBinding (ListType $8) '0 '0)) '('('"type" '"query"))))
)
