(
(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 '('RecordsCount '"4"))
(let $6 '('DataSize '"166"))
(let $7 '('ChunkCount '1))
(let $8 '('ModifyTime '0))
(let $9 '('Revision '0))
(let $10 '('"key"))
(let $11 (DataType 'String))
(let $12 '('"key" $11))
(let $13 '('('"_logical_id" '3531) '('"_id" '"2277a472-d3ac45b6-7c5724d4-374676a4") '('"_wide_channels" (StructType $12))))
(let $14 (DqPhyStage '() (lambda '() (block '(
  (let $32 (YtStat '('Id '"Input3") $5 $6 $7 $8 $9))
  (let $33 (YtTable '"Input3" $3 $4 $32 '() (Void) (Void) '"/Root/plato"))
  (let $34 (YtReadTable! world $1 '((YtSection '((YtPath $33 $10 (Void) (Void))) '()))))
  (return (FromFlow (DqReadWideWrap $34 '())))
))) $13))
(let $15 (DqCnBroadcast (TDqOutput $14 '0)))
(let $16 (OptionalType (DataType 'Int32)))
(let $17 (lambda '($57 $58 $59) $57 $58 $59))
(let $18 '('"B.subkey" $16))
(let $19 (DataType 'Uint64))
(let $20 (StructType '('"A.key" $11) $18 '('_yql_agg_0 $19)))
(let $21 '('('"_logical_id" '3680) '('"_id" '"7ba693c8-79bfb0d2-12f77784-445be8ea") '('"_wide_channels" $20)))
(let $22 (DqPhyStage '($15) (lambda '($35) (block '(
  (let $36 '('Many 'Hashed 'Compact))
  (let $37 (NarrowSqueezeToDict (ToFlow $35) (lambda '($40) $40) (lambda '($41) (AsStruct '('"key" $41))) $36))
  (let $38 (lambda '($46 $47) $46 (SafeCast $47 $16)))
  (let $39 (Uint64 '1))
  (return (DqPhyHashCombine (WideToBlocks (FromFlow (FlatMap $37 (lambda '($42) (block '(
    (let $43 (YtStat '('Id '"Input2") $5 $6 $7 $8 $9))
    (let $44 (YtTable '"Input2" $3 $4 $43 '() (Void) (Void) '"/Root/plato"))
    (let $45 (YtReadTable! world $1 '((YtSection '((YtPath $44 $10 (Void) (Void))) '()))))
    (return (MapJoinCore (DqReadWideWrap $45 '()) $42 'Left '('0) $10 '('0 '0) '('"key" '1) '('"A.key") '('"B.key")))
  )))))) '-1073741824 $38 (lambda '($48 $49 $50 $51) $39) (lambda '($52 $53 $54 $55 $56) (AggrAdd $56 $39)) $17))
))) $21))
(let $23 (DqCnHashShuffle (TDqOutput $22 '0) '('0 '1) '0 '"HashV2"))
(let $24 (StructType $18 '('"count" $19) $12))
(let $25 '('('"_logical_id" '4300) '('"_id" '"3a6553d2-dcd76544-234acacd-ceb7c49b") '('"_wide_channels" $24)))
(let $26 (DqPhyStage '($23) (lambda '($60) (block '(
  (let $61 (lambda '($64 $65 $66) $64 $65))
  (let $62 (WideCombiner (ToFlow (WideFromBlocks $60)) '"" $61 (lambda '($67 $68 $69 $70 $71) $71) (lambda '($72 $73 $74 $75 $76 $77) (AggrAdd $76 $77)) $17))
  (let $63 (lambda '($78 $79 $80) $79 $80 $78))
  (return (FromFlow (WideMap (WideSort $62 '('('0 (Bool 'true)))) $63)))
))) $25))
(let $27 (DqCnMerge (TDqOutput $26 '0) '('('"2" '"Asc"))))
(let $28 (DqPhyStage '($27) (lambda '($81) (FromFlow (NarrowMap (ToFlow $81) (lambda '($82 $83 $84) (AsStruct '('"B.subkey" $82) '('"count" $83) '('"key" $84)))))) '('('"_logical_id" '4312) '('"_id" '"79c2124-fb2e97b9-9227fbc0-92bfc427"))))
(let $29 '($14 $22 $26 $28))
(let $30 '('"key" '"B.subkey" '"count"))
(let $31 (DqCnResult (TDqOutput $28 '0) $30))
(return (KqpPhysicalQuery '((KqpPhysicalTx $29 '($31) '() '('('"type" '"generic")))) '((KqpTxResultBinding (ListType $24) '0 '0)) '('('"type" '"query"))))
)
