(
(let $1 (DataSource '"yt" '"/Root/plato"))
(let $2 '@@["StructType";[["key";["DataType";"String"]];["subkey";["DataType";"String"]];["value";["DataType";"String"]]]]@@)
(let $3 (YqlRowSpec '('NativeYtTypeFlags '0) '('StrictSchema '1) '('UniqueKeys '0) '('Type $2)))
(let $4 (YtMeta '('CanWrite '1) '('DoesExist '1) '('YqlCompatibleScheme '1) '('InferredScheme '0) '('IsDynamic '0) '('Attrs '('('"native_strict_schema" '"false")))))
(let $5 (YtStat '('Id '"Input") '('RecordsCount '"14") '('DataSize '"614") '('ChunkCount '1) '('ModifyTime '0) '('Revision '0)))
(let $6 (YtTable '"Input" $3 $4 $5 '() (Void) (Void) '"/Root/plato"))
(let $7 (OptionalType (DataType 'Uint32)))
(let $8 (lambda '($36 $37) $37 $36))
(let $9 (DataType 'String))
(let $10 (ListType $9))
(let $11 (DataType 'Int32))
(let $12 '('mod (OptionalType $11)))
(let $13 '('('"_logical_id" '5131) '('"_id" '"74e23696-162802c6-89db4f79-d264d0a5") '('"_wide_channels" (StructType '('_yql_agg_0 $10) $12))))
(let $14 (DqPhyStage '() (lambda '() (block '(
  (let $29 (YtReadTable! world $1 '((YtSection '((YtPath $6 '('"key") (Void) (Void))) '()))))
  (return (WideFromBlocks (DqPhyHashCombine (WideToBlocks (FromFlow (DqReadWideWrap $29 '()))) '-1073741824 (lambda '($30) (% (SafeCast $30 $7) (Int32 '"10"))) (lambda '($31 $32) (AsList $32)) (lambda '($33 $34 $35) (Insert $35 $34)) $8)))
))) $13))
(let $15 (DqCnHashShuffle (TDqOutput $14 '0) '('1) '0 '"HashV2"))
(let $16 (StructType '('AggregateList0 $10) $12))
(let $17 '('('"_logical_id" '5610) '('"_id" '"af6d943-a80e0ee-4ec51611-e5143fe5") '('"_partition_mode" '"aggregate") '('"_wide_channels" $16)))
(let $18 (DqPhyStage '($15) (lambda '($38) (FromFlow (WideCombiner (ToFlow $38) '"" (lambda '($39 $40) $40) (lambda '($41 $42 $43) $42) (lambda '($44 $45 $46 $47) (Extend $45 $47)) $8))) $17))
(let $19 (DqCnBroadcast (TDqOutput $18 '0)))
(let $20 (OptionalType $9))
(let $21 (StructType '('"column0" $20) '('"key" $9) '('"value" $9)))
(let $22 '('('"_logical_id" '5809) '('"_id" '"d2cec51a-ab043ba5-4b3a75e6-49ee3087") '('"_wide_channels" $21)))
(let $23 (DqPhyStage '($19) (lambda '($48) (block '(
  (let $49 '('Many 'Hashed 'Compact))
  (let $50 (SqueezeToDict (NarrowFlatMap (WideFilter (ToFlow $48) (lambda '($53 $54) (Exists $54))) (lambda '($55 $56) (IfPresent $56 (lambda '($57) (Just '($57 (AsStruct '('AggregateList0 $55) '('mod $56))))) (Nothing (OptionalType (TupleType $11 $16)))))) (lambda '($58) (Nth $58 '0)) (lambda '($59) (Nth $59 '1)) $49))
  (let $51 (Bool 'true))
  (let $52 (lambda '($73 $74 $75) (block '(
    (let $76 (IfPresent (SafeCast (Int32 '2) (OptionalType (DataType 'Uint64))) (lambda '($77) (Lookup (ToIndexDict (Sort $75 $51 (lambda '($78) $78))) $77)) (Nothing $20)))
    (return $76 $73 $74)
  ))))
  (return (FromFlow (WideMap (WideSort (FlatMap $50 (lambda '($60) (block '(
    (let $61 (YtReadTable! world $1 '((YtSection '((YtPath $6 '('"key" '"value") (Void) (Void))) '()))))
    (let $62 (lambda '($65 $66) $65 $66 (/ (SafeCast $65 $7) (Int32 '"100"))))
    (let $63 (lambda '($70 $71 $72) $72 $70 $71))
    (let $64 '('1 '0 '2 '1))
    (return (MapJoinCore (WideMap (WideFilter (WideMap (DqReadWideWrap $61 '()) $62) (lambda '($67 $68 $69) (Exists $69))) $63) $60 'Inner '('0) '('mod) $64 '('AggregateList0 '2) '('"Input._equijoin_column_0") '('"d.mod")))
  )))) '('('0 $51) '('1 $51))) $52)))
))) $22))
(let $24 (DqCnMerge (TDqOutput $23 '0) '('('1 '"Asc") '('2 '"Asc"))))
(let $25 (DqPhyStage '($24) (lambda '($79) (FromFlow (NarrowMap (ToFlow $79) (lambda '($80 $81 $82) (AsStruct '('"column0" $80) '('"key" $81) '('"value" $82)))))) '('('"_logical_id" '5821) '('"_id" '"766ec121-89f8216f-1577b2d1-b4140f"))))
(let $26 '($14 $18 $23 $25))
(let $27 '('"column0" '"key" '"value"))
(let $28 (DqCnResult (TDqOutput $25 '0) $27))
(return (KqpPhysicalQuery '((KqpPhysicalTx $26 '($28) '() '('('"type" '"generic")))) '((KqpTxResultBinding (ListType $21) '0 '0)) '('('"type" '"query"))))
)
