(
(let $1 (DataSource '"yt" '"/Root/plato"))
(let $2 '@@["StructType";[["key";["DataType";"String"]];["subkey";["DataType";"String"]];["value";["DataType";"String"]]]]@@)
(let $3 (Bool 'true))
(let $4 '('"key" '"subkey"))
(let $5 (DataType 'String))
(let $6 (YqlRowSpec '('NativeYtTypeFlags '0) '('StrictSchema '1) '('UniqueKeys '1) '('Type $2) '('SortDirections '($3 $3)) '('SortMembers $4) '('SortedBy $4) '('SortedByTypes '($5 $5))))
(let $7 (YtMeta '('CanWrite '1) '('DoesExist '1) '('YqlCompatibleScheme '1) '('InferredScheme '0) '('IsDynamic '0) '('HasRLS '0) '('Attrs '('('"native_strict_schema" '"false")))))
(let $8 (YtStat '('Id '"Input") '('RecordsCount '"10") '('DataSize '"420") '('ChunkCount '1) '('ModifyTime '0) '('Revision '0)))
(let $9 (YtTable '"Input" $6 $7 $8 '() (Void) (Void) '"/Root/plato"))
(let $10 (OptionalType $5))
(let $11 (StructType '('"subkey_plus_one" $10)))
(let $12 '('('"_logical_id" '1290) '('"_id" '"cdb67b24-9768f2d8-d251e82d-a7327e1d") '('"_wide_channels" $11)))
(let $13 (DqPhyStage '() (lambda '() (block '(
  (let $23 (YtReadTable! world $1 '((YtSection '((YtPath $9 '('"subkey") (Void) (Void) (Void))) '('('"unordered"))))))
  (return (FromFlow (WideMap (DqReadWideWrap $23 '()) (lambda '($24) (IfPresent (+ (SafeCast $24 (OptionalType (DataType 'Int32))) (Int32 '1)) (lambda '($25) (Just (SafeCast $25 $5))) (Nothing $10))))))
))) $12))
(let $14 (DqCnBroadcast (TDqOutput $13 '0)))
(let $15 '"b.subkey_plus_one")
(let $16 (StructType '('"a.key" $5) '('"a.subkey" $5) '('"a.value" $5) '($15 $10)))
(let $17 '('('"_logical_id" '1382) '('"_id" '"1b8c9696-ff65ae17-c63633de-83abb04b") '('"_wide_channels" $16)))
(let $18 (DqPhyStage '($14) (lambda '($26) (block '(
  (let $27 '('Many 'Hashed 'Compact))
  (let $28 (SqueezeToDict (NarrowFlatMap (WideFilter (ToFlow $26) (lambda '($29) (Exists $29))) (lambda '($30) (IfPresent $30 (lambda '($31) (Just '($31 (AsStruct '('"subkey_plus_one" $30))))) (Nothing (OptionalType (TupleType $5 $11)))))) (lambda '($32) (Nth $32 '0)) (lambda '($33) (Nth $33 '1)) $27))
  (return (FromFlow (WideSort (FlatMap $28 (lambda '($34) (block '(
    (let $35 '('"key" '"subkey" '"value"))
    (let $36 (YtReadTable! world $1 '((YtSection '((YtPath $9 $35 (Void) (Void) (Void))) '()))))
    (let $37 '('0 '0 '1 '1 '2 '2))
    (return (MapJoinCore (DqReadWideWrap $36 '()) $34 'Inner '('1) '('"subkey_plus_one") $37 '('"subkey_plus_one" '3) '('"a.subkey") '($15)))
  )))) '('('1 $3) '('0 $3)))))
))) $17))
(let $19 (DqCnMerge (TDqOutput $18 '0) '('('1 '"Asc") '('0 '"Asc"))))
(let $20 (DqPhyStage '($19) (lambda '($38) (FromFlow (NarrowMap (ToFlow $38) (lambda '($39 $40 $41 $42) (AsStruct '('"a.key" $39) '('"a.subkey" $40) '('"a.value" $41) '($15 $42)))))) '('('"_logical_id" '1394) '('"_id" '"3ffe7b1d-b4817f32-9bacda1e-256689ae"))))
(let $21 '($13 $18 $20))
(let $22 (DqCnResult (TDqOutput $20 '0) '()))
(return (KqpPhysicalQuery '((KqpPhysicalTx $21 '($22) '() '('('"type" '"generic")))) '((KqpTxResultBinding (ListType $16) '0 '0)) '('('"type" '"query"))))
)
