(
(declare %kqp%tx_result_binding_0_0 (OptionalType (StructType '('"s" (DataType 'String)))))
(declare %kqp%tx_result_binding_0_1 (OptionalType (StructType '('"s" (DataType 'String)))))
(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 '"200") '('DataSize '"9557") '('ChunkCount '1) '('ModifyTime '0) '('Revision '0)))
(let $6 (YtTable '"Input" $3 $4 $5 '() (Void) (Void) '"/Root/plato"))
(let $7 (Uint64 '1))
(let $8 (DqPhyStage '() (lambda '() (block '(
  (let $30 (YtReadTable! world $1 '((YtSection '((YtPath $6 '('"key" '"subkey") (Void) (Void))) '()))))
  (let $31 '('0))
  (let $32 (lambda '($38) (AsStruct '('"s" (Member $38 '"subkey")))))
  (return (FromFlow (Switch (NarrowMap (DqReadWideWrap $30 '()) (lambda '($33 $34) (AsStruct '('"key" $33) '('"subkey" $34)))) '"134217728" $31 (lambda '($35) (block '(
    (let $36 (Filter $35 (lambda '($37) (== (Member $37 '"key") (String '"113"))) $7))
    (return (Map $36 $32))
  ))) $31 (lambda '($39) (block '(
    (let $40 (Filter $39 (lambda '($41) (== (Member $41 '"key") (String '"112"))) $7))
    (return (Map $40 $32))
  ))))))
))) '('('"_logical_id" '3297) '('"_id" '"a920ea0e-408c695-e62d8028-cf7f63b3"))))
(let $9 (DqCnUnionAll (TDqOutput $8 '1)))
(let $10 (DataType 'String))
(let $11 (OptionalType (StructType '('"s" $10))))
(let $12 (Bool 'false))
(let $13 (lambda '($42) (FromFlow (Condense (Take (ToFlow $42) $7) (Nothing $11) (lambda '($43 $44) $12) (lambda '($45 $46) (Just $45))))))
(let $14 (DqPhyStage '($9) $13 '('('"_logical_id" '2903) '('"_id" '"122c2feb-f2ac25d0-ba1d5dc6-7663a7e5"))))
(let $15 (DqCnUnionAll (TDqOutput $8 '0)))
(let $16 (DqPhyStage '($15) $13 '('('"_logical_id" '3426) '('"_id" '"8b5deb9-70e2eedd-2a60c363-27064c7"))))
(let $17 '($8 $14 $16))
(let $18 (DqCnValue (TDqOutput $14 '0)))
(let $19 (DqCnValue (TDqOutput $16 '0)))
(let $20 (KqpPhysicalTx $17 '($18 $19) '() '('('"type" '"compute"))))
(let $21 '"%kqp%tx_result_binding_0_0")
(let $22 '"%kqp%tx_result_binding_0_1")
(let $23 (DqPhyStage '() (lambda '() (block '(
  (let $47 '('"key" '"subkey" '"value"))
  (let $48 (YtReadTable! world $1 '((YtSection '((YtPath $6 $47 (Void) (Void))) '('('"syscolumns" '('"record")))))))
  (return (FromFlow (NarrowMap (WideFilter (DqReadWideWrap $48 '()) (lambda '($49 $50 $51 $52) (block '(
    (let $53 (SafeCast $49 $10))
    (return (Or (Coalesce (== $53 (Member %kqp%tx_result_binding_0_0 '"s")) $12) (Coalesce (== $53 (Member %kqp%tx_result_binding_0_1 '"s")) $12)))
  )))) (lambda '($54 $55 $56 $57) (AsStruct '('"key" $55) '('"subkey" $56) '('"value" $57))))))
))) '('('"_logical_id" '3711) '('"_id" '"94643053-75cfafbf-2afa674d-c47be882"))))
(let $24 (DqCnUnionAll (TDqOutput $23 '0)))
(let $25 (DqPhyStage '($24) (lambda '($58) $58) '('('"_logical_id" '4421) '('"_id" '"fcda5478-78f55385-17d6b449-40290332"))))
(let $26 (DqCnResult (TDqOutput $25 '0) '()))
(let $27 (KqpTxResultBinding $11 '0 '0))
(let $28 (KqpTxResultBinding $11 '0 '1))
(let $29 (KqpPhysicalTx '($23 $25) '($26) '('($21 $27) '($22 $28)) '('('"type" '"generic"))))
(return (KqpPhysicalQuery '($20 $29) '((KqpTxResultBinding (ListType (StructType '('"key" $10) '('"subkey" $10) '('"value" $10))) '1 '0)) '('('"type" '"query"))))
)
