(
(let $1 (DataSource '"yt" '"/Root/plato"))
(let $2 '('NativeYtTypeFlags '0))
(let $3 '('StrictSchema '1))
(let $4 '('UniqueKeys '0))
(let $5 (Bool 'true))
(let $6 '('SortDirections '($5)))
(let $7 '('"k1"))
(let $8 (DataType 'String))
(let $9 '('SortedByTypes '($8)))
(let $10 (YtMeta '('CanWrite '1) '('DoesExist '1) '('YqlCompatibleScheme '1) '('InferredScheme '0) '('IsDynamic '0)))
(let $11 '('RecordsCount '3))
(let $12 '('DataSize '"75"))
(let $13 '('ChunkCount '1))
(let $14 '('ModifyTime '0))
(let $15 '('Revision '0))
(let $16 '('('"_logical_id" '1456) '('"_id" '"4e860a03-7e86756-e55392bc-d958f731") '('"_wide_channels" (StructType '('"k1" $8) '('"v1" $8)))))
(let $17 (DqPhyStage '() (lambda '() (block '(
  (let $40 '@@["StructType";[["k1";["DataType";"String"]];["v1";["DataType";"String"]]]]@@)
  (let $41 (YqlRowSpec $2 $3 $4 '('Type $40) $6 '('SortMembers $7) '('SortedBy $7) $9))
  (let $42 (YtStat '('Id '"Input1") $11 $12 $13 $14 $15))
  (let $43 (YtTable '"Input1" $41 $10 $42 '() (Void) (Void) '"/Root/plato"))
  (let $44 (YtReadTable! world $1 '((YtSection '((YtPath $43 '('"k1" '"v1") (Void) (Void))) '()))))
  (return (FromFlow (DqReadWideWrap $44 '())))
))) $16))
(let $18 (DqCnBroadcast (TDqOutput $17 '0)))
(let $19 '('Many 'Hashed 'Compact))
(let $20 '('0))
(let $21 '('"a.key"))
(let $22 '('"b.v1" $8))
(let $23 (StructType '('"a.key" $8) '('"a.value" $8) '('"b.k1" $8) $22))
(let $24 '('('"_logical_id" '1543) '('"_id" '"aa4081af-64dfa2fd-321323c9-f1e135d2") '('"_wide_channels" $23)))
(let $25 (DqPhyStage '($18) (lambda '($45) (block '(
  (let $46 (NarrowSqueezeToDict (ToFlow $45) (lambda '($47 $48) $47) (lambda '($49 $50) (AsStruct '('"k1" $49) '('"v1" $50))) $19))
  (return (FromFlow (FlatMap $46 (lambda '($51) (block '(
    (let $52 '@@["StructType";[["key";["DataType";"String"]];["value";["DataType";"String"]]]]@@)
    (let $53 '('"key"))
    (let $54 (YqlRowSpec $2 $3 $4 '('Type $52) $6 '('SortMembers $53) '('SortedBy $53) $9))
    (let $55 (YtStat '('Id '"Input") $11 '('DataSize '"87") $13 $14 $15))
    (let $56 (YtTable '"Input" $54 $10 $55 '() (Void) (Void) '"/Root/plato"))
    (let $57 (YtReadTable! world $1 '((YtSection '((YtPath $56 '('"key" '"value") (Void) (Void))) '()))))
    (let $58 '('0 '0 '1 '1))
    (let $59 '('"k1" '2 '"v1" '3))
    (return (MapJoinCore (DqReadWideWrap $57 '()) $51 'Inner $20 $7 $58 $59 $21 '('"b.k1")))
  ))))))
))) $24))
(let $26 '('"k2"))
(let $27 '('('"_logical_id" '1477) '('"_id" '"bfebd53a-1b489f28-86666d4c-ade5b24e") '('"_wide_channels" (StructType '('"k2" $8)))))
(let $28 (DqPhyStage '() (lambda '() (block '(
  (let $60 '@@["StructType";[["k2";["DataType";"String"]];["v2";["DataType";"String"]]]]@@)
  (let $61 (YqlRowSpec $2 $3 $4 '('Type $60) $6 '('SortMembers $26) '('SortedBy $26) $9))
  (let $62 (YtStat '('Id '"Input2") $11 $12 $13 $14 $15))
  (let $63 (YtTable '"Input2" $61 $10 $62 '() (Void) (Void) '"/Root/plato"))
  (let $64 (YtReadTable! world $1 '((YtSection '((YtPath $63 $26 (Void) (Void))) '()))))
  (return (FromFlow (DqReadWideWrap $64 '())))
))) $27))
(let $29 (DqCnMap (TDqOutput $25 '0)))
(let $30 (DqCnBroadcast (TDqOutput $28 '0)))
(let $31 (StructType '('"avalue" $8) $22 '('"ck2" $8)))
(let $32 '('('"_logical_id" '1729) '('"_id" '"5dc9950d-3b88ee5f-57ef31ea-f4284be3") '('"_wide_channels" $31)))
(let $33 (DqPhyStage '($29 $30) (lambda '($65 $66) (block '(
  (let $67 (NarrowSqueezeToDict (ToFlow $66) (lambda '($69) $69) (lambda '($70) (AsStruct '('"k2" $70))) $19))
  (let $68 '('('0 $5) '('1 $5) '('2 $5)))
  (return (FromFlow (WideSort (FlatMap $67 (lambda '($71) (block '(
    (let $72 (lambda '($74 $75 $76 $77) $74 $75 $77))
    (let $73 '('1 '0 '2 '1))
    (return (MapJoinCore (WideMap (ToFlow $65) $72) $71 'Inner $20 $26 $73 '('"k2" '2) $21 '('"c.k2")))
  )))) $68)))
))) $32))
(let $34 '('('0 '"Asc") '('1 '"Asc") '('2 '"Asc")))
(let $35 (DqCnMerge (TDqOutput $33 '0) $34))
(let $36 (DqPhyStage '($35) (lambda '($78) (FromFlow (NarrowMap (ToFlow $78) (lambda '($79 $80 $81) (AsStruct '('"avalue" $79) '('"b.v1" $80) '('"ck2" $81)))))) '('('"_logical_id" '1741) '('"_id" '"a112c644-c3ee2fab-f48f2c93-ce512e47"))))
(let $37 '($17 $25 $28 $33 $36))
(let $38 '('"avalue" '"b.v1" '"ck2"))
(let $39 (DqCnResult (TDqOutput $36 '0) $38))
(return (KqpPhysicalQuery '((KqpPhysicalTx $37 '($39) '() '('('"type" '"generic")))) '((KqpTxResultBinding (ListType $31) '0 '0)) '('('"type" '"query"))))
)
