(
(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 (YtStat '('Id '"Input1") $5 $6 $7 $8 $9))
(let $11 (YtTable '"Input1" $3 $4 $10 '() (Void) (Void) '"/Root/plato"))
(let $12 '('"key" '"subkey" '"value"))
(let $13 (YtReadTable! world $1 '((YtSection '((YtPath $11 $12 (Void) (Void))) '()))))
(let $14 (DqReadWideWrap $13 '()))
(let $15 (DataType 'Uint32))
(let $16 (OptionalType $15))
(let $17 '('"_logical_id" '1990))
(let $18 '('"key" $16))
(let $19 (DataType 'String))
(let $20 (StructType $18 '('"subkey" $19) '('"value" $19)))
(let $21 '($17 '('"_id" '"24bbfb4b-5df283ac-846ff9fd-5eaae6a") '('"_wide_channels" $20)))
(let $22 (DqPhyStage '() (lambda '() (block '(
  (let $42 (lambda '($43 $44 $45) (SafeCast $43 $16) $44 $45))
  (return (FromFlow (WideMap $14 $42)))
))) $21))
(let $23 '('"key"))
(let $24 (StructType $18))
(let $25 '('"_wide_channels" $24))
(let $26 '('('"_logical_id" '1839) '('"_id" '"610392af-2272a33a-8ebd9273-82c381b9") $25))
(let $27 (DqPhyStage '() (lambda '() (block '(
  (let $46 (YtStat '('Id '"Input2") $5 $6 $7 $8 $9))
  (let $47 (YtTable '"Input2" $3 $4 $46 '() (Void) (Void) '"/Root/plato"))
  (let $48 (YtReadTable! world $1 '((YtSection '((YtPath $47 $23 (Void) (Void))) '()))))
  (return (FromFlow (WideMap (DqReadWideWrap $48 '()) (lambda '($49) (% (SafeCast $49 $16) (Uint32 '"100"))))))
))) $26))
(let $28 '($17 '('"_id" '"594d5f-d9ef392e-b0f92c4d-95db9b41") $25))
(let $29 (DqPhyStage '() (lambda '() (FromFlow (WideMap $14 (lambda '($50 $51 $52) (SafeCast $50 $16))))) $28))
(let $30 (DqCnMap (TDqOutput $22 '0)))
(let $31 (DqCnBroadcast (TDqOutput $27 '0)))
(let $32 (DqCnBroadcast (TDqOutput $29 '0)))
(let $33 '($30 $31 $32))
(let $34 (StructType '('"i1.key" $16) '('"i1.subkey" $19) '('"i1.value" $19)))
(let $35 '('('"_logical_id" '2162) '('"_id" '"aa1c64-1e58945c-4cc35dd6-ada1d0c5") '('"_wide_channels" $34)))
(let $36 (DqPhyStage $33 (lambda '($53 $54 $55) (block '(
  (let $56 (lambda '($59) (Exists $59)))
  (let $57 '('Many 'Hashed 'Compact))
  (let $58 (SqueezeToDict (NarrowFlatMap (WideFilter (ToFlow $55) $56) (lambda '($60) (IfPresent $60 (lambda '($61) (Just '($61 (AsStruct '('"key" $60))))) (Nothing (OptionalType (TupleType $15 $24)))))) (lambda '($62) (Nth $62 '0)) (lambda '($63) (Nth $63 '1)) $57))
  (return (FromFlow (WideSort (FlatMap $58 (lambda '($64) (block '(
    (let $65 '('One 'Hashed 'Compact))
    (let $66 (SqueezeToDict (NarrowFlatMap (WideFilter (ToFlow $54) $56) (lambda '($70) $70)) (lambda '($71) $71) (lambda '($72) (Void)) $65))
    (let $67 '('0))
    (let $68 '('0 '0 '1 '1 '2 '2))
    (let $69 '('"i1.key"))
    (return (MapJoinCore (FlatMap $66 (lambda '($73) (MapJoinCore (WideFilter (ToFlow $53) (lambda '($74 $75 $76) (Exists $74))) $73 'LeftSemi $67 $23 $68 '() $69 '('"i2.key")))) $64 'Left $67 $23 $68 '() $69 '('"i3.key")))
  )))) '('('0 (Bool 'true))))))
))) $35))
(let $37 (DqCnMerge (TDqOutput $36 '0) '('('0 '"Asc"))))
(let $38 (DqPhyStage '($37) (lambda '($77) (FromFlow (NarrowMap (ToFlow $77) (lambda '($78 $79 $80) (AsStruct '('"i1.key" $78) '('"i1.subkey" $79) '('"i1.value" $80)))))) '('('"_logical_id" '2174) '('"_id" '"e7a24675-3863eb11-2c9dde9-306fa5f9"))))
(let $39 '($22 $27 $29 $36 $38))
(let $40 '('"i1.key" '"i1.subkey" '"i1.value"))
(let $41 (DqCnResult (TDqOutput $38 '0) $40))
(return (KqpPhysicalQuery '((KqpPhysicalTx $39 '($41) '() '('('"type" '"generic")))) '((KqpTxResultBinding (ListType $34) '0 '0)) '('('"type" '"query"))))
)
