(
(let $1 (lambda '($39) (Member $39 '_yql_agg_0) (Member $39 'mod)))
(let $2 (lambda '($40 $41) (AsStruct '('_yql_agg_0 $40) '('mod $41))))
(let $3 (DataType 'String))
(let $4 '('('"_logical_id" '3432) '('"_id" '"263c7057-dfa485c7-c31bf717-ce827f08") '('"_wide_channels" (StructType '('_yql_agg_0 (ListType $3)) '('mod (OptionalType (DataType 'Int32)))))))
(let $5 (DqPhyStage '() (lambda '() (block '(
  (let $21 '@@["StructType";[["key";["DataType";"String"]];["subkey";["DataType";"String"]];["value";["DataType";"String"]]]]@@)
  (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 '"14") '('DataSize '"614") '('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" '"subkey") (Void) (Void))) '()))))
  (let $27 (CombineCore (NarrowMap (DqReadWideWrap $26 '()) (lambda '($28 $29) (block '(
    (let $30 (AsStruct '('"key" $28) '('"subkey" $29)))
    (return (AsStruct '('"key" (Member $30 '"key")) '('mod (% (SafeCast (Member $30 '"subkey") (OptionalType (DataType 'Uint32))) (Int32 '"10")))))
  )))) (lambda '($31) (Member $31 'mod)) (lambda '($32 $33) (AsStruct '('_yql_agg_0 (AsList (Member $33 '"key"))))) (lambda '($34 $35 $36) (AsStruct '('_yql_agg_0 (Insert (Member $36 '_yql_agg_0) (Member $35 '"key"))))) (lambda '($37 $38) (Just (AsStruct '('_yql_agg_0 (Member $38 '_yql_agg_0)) '('mod $37)))) '0))
  (return (FromFlow (ExpandMap (NarrowMap (ExpandMap $27 $1) $2) $1)))
))) $4))
(let $6 (DqCnHashShuffle (TDqOutput $5 '0) '('1) '0 '"HashV2"))
(let $7 (Bool 'true))
(let $8 (lambda '($60) (Member $60 'gk)))
(let $9 (StructType '('gk (OptionalType $3))))
(let $10 '('"_wide_channels" $9))
(let $11 '('('"_logical_id" '4115) '('"_id" '"f5cb1f50-ba950358-738cd7b1-db1a7719") $10))
(let $12 (DqPhyStage '($6) (lambda '($42) (block '(
  (let $43 (lambda '($49 $50 $51) $50 $51))
  (let $44 (lambda '($52 $53 $54 $55 $56) (Extend $53 $55) $56))
  (let $45 (WideCombiner (ExpandMap (NarrowMap (ToFlow $42) $2) $1) '"" (lambda '($47 $48) $48) $43 $44 $43))
  (let $46 (CombineCore (NarrowMap $45 (lambda '($57 $58) (AsStruct '('gk (Head (Sort (Member (AsStruct '('AggregateList0 $57)) 'AggregateList0) $7 (lambda '($59) $59))))))) $8 (lambda '($61 $62) (AsStruct '('gk $61))) (lambda '($63 $64 $65) $65) (lambda '($66 $67) (Just $67)) '0))
  (return (FromFlow (ExpandMap $46 $8)))
))) $11))
(let $13 (DqCnHashShuffle (TDqOutput $12 '0) '('0) '0 '"HashV2"))
(let $14 (lambda '($72) (AsStruct '('gk $72))))
(let $15 '('('"_logical_id" '4419) '('"_id" '"6978d18f-bd6eadc3-5297278b-7d9987e6") $10))
(let $16 (DqPhyStage '($13) (lambda '($68) (block '(
  (let $69 (lambda '($74 $75) $75))
  (let $70 (WideCombiner (ExpandMap (NarrowMap (ToFlow $68) $14) $8) '"" (lambda '($73) $73) $69 (lambda '($76 $77 $78) $78) $69))
  (let $71 (Sort (NarrowMap $70 $14) $7 $8))
  (return (FromFlow (ExpandMap $71 (lambda '($79) (Member $79 'gk)))))
))) $15))
(let $17 (DqCnMerge (TDqOutput $16 '0) '('('0 '"Asc"))))
(let $18 (DqPhyStage '($17) (lambda '($80) (FromFlow (NarrowMap (ToFlow $80) $14))) '('('"_logical_id" '4431) '('"_id" '"930931a9-a8ae2038-d23c300b-2447d359"))))
(let $19 '($5 $12 $16 $18))
(let $20 (DqCnResult (TDqOutput $18 '0) '()))
(return (KqpPhysicalQuery '((KqpPhysicalTx $19 '($20) '() '('('"type" '"generic")))) '((KqpTxResultBinding (ListType $9) '0 '0)) '('('"type" '"query"))))
)
