(
(declare %kqp%tx_result_binding_0_0 (OptionalType (StructType '('"Min0" (DataType 'String)))))
(declare %kqp%tx_result_binding_2_0 (OptionalType (StructType '('"Min0" (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) '('HasRLS '0) '('Attrs '('('"native_strict_schema" 'false)))))
(let $5 (YtStat '('Id '"Input") '('RecordsCount '"4") '('DataSize '"166") '('ChunkCount '1) '('ModifyTime '0) '('Revision '0)))
(let $6 (YtTable '"Input" $3 $4 $5 '() (Void) (Void) '"/Root/plato"))
(let $7 (YtReadTable! world $1 '((YtSection '((YtPath $6 '('"key") (Void) (Void) (Void))) '()))))
(let $8 (lambda '($59) (AsStruct '('"key" $59))))
(let $9 (Bool 'false))
(let $10 (lambda '($61 $62) $9))
(let $11 (DataType 'String))
(let $12 '('"_wide_channels" (StructType '('_yql_agg_0 $11))))
(let $13 '('('"_logical_id" '8385) '('"_id" '"81c741f0-fc158a95-da087bd8-8941064a") $12))
(let $14 (DqPhyStage '() (lambda '() (block '(
  (let $57 (String '"foo"))
  (let $58 (Condense1 (NarrowMap (DqReadWideWrap $7 '()) $8) (lambda '($60) (Concat (Member $60 '"key") $57)) $10 (lambda '($63 $64) (AggrMin (Concat (Member $63 '"key") $57) $64))))
  (return (FromFlow (ExpandMap $58 (lambda '($65) $65))))
))) $13))
(let $15 (DqCnUnionAll (TDqOutput $14 '0)))
(let $16 (lambda '($68) (AsStruct '('_yql_agg_0 $68))))
(let $17 (lambda '($69) (Member $69 '_yql_agg_0)))
(let $18 (lambda '($70 $71) $9))
(let $19 (lambda '($72 $73) (AggrMin (Member $72 '_yql_agg_0) $73)))
(let $20 (Uint64 '1))
(let $21 (OptionalType (StructType '('"Min0" $11))))
(let $22 (Nothing $21))
(let $23 (lambda '($75 $76) $9))
(let $24 (lambda '($77 $78) (Just $77)))
(let $25 (DqPhyStage '($15) (lambda '($66) (block '(
  (let $67 (Condense1 (NarrowMap (ToFlow $66) $16) $17 $18 $19))
  (return (FromFlow (Condense (Map (Take $67 $20) (lambda '($74) (AsStruct '('"Min0" $74)))) $22 $23 $24)))
))) '('('"_logical_id" '8679) '('"_id" '"8f00684b-5356577f-2d2335ed-e8f7e81f"))))
(let $26 (DqCnValue (TDqOutput $25 '0)))
(let $27 '('('"type" '"compute")))
(let $28 (KqpPhysicalTx '($14 $25) '($26) '() $27))
(let $29 (YtReadTable! world $1 '((YtSection '((YtPath $6 '() (Void) (Void) (Void))) '()))))
(let $30 (String '1))
(let $31 '"%kqp%tx_result_binding_0_0")
(let $32 (DqPhyStage '() (lambda '() (FromFlow (NarrowMap (DqReadWideWrap $29 '()) (lambda '() (AsStruct '('"column0" (Concat $30 (Member %kqp%tx_result_binding_0_0 '"Min0")))))))) '('('"_logical_id" '8748) '('"_id" '"69e83da7-7ad4f37e-c1e9b609-f16063f4"))))
(let $33 (DqCnUnionAll (TDqOutput $32 '0)))
(let $34 (DqPhyStage '($33) (lambda '($79) $79) '('('"_logical_id" '10118) '('"_id" '"21c9481d-93e01341-8a99e1d4-ba80e5d6"))))
(let $35 '('"column0"))
(let $36 (DqCnResult (TDqOutput $34 '0) $35))
(let $37 (KqpTxResultBinding $21 '0 '0))
(let $38 '('('"type" '"generic")))
(let $39 (KqpPhysicalTx '($32 $34) '($36) '('($31 $37)) $38))
(let $40 '('('"_logical_id" '8912) '('"_id" '"e52717fa-483b845b-a2be5d50-7622c15f") $12))
(let $41 (DqPhyStage '() (lambda '() (block '(
  (let $80 (String '"bar"))
  (let $81 (Condense1 (NarrowMap (DqReadWideWrap $7 '()) $8) (lambda '($82) (Concat (Member $82 '"key") $80)) $10 (lambda '($83 $84) (AggrMin (Concat (Member $83 '"key") $80) $84))))
  (return (FromFlow (ExpandMap $81 (lambda '($85) $85))))
))) $40))
(let $42 (DqCnUnionAll (TDqOutput $41 '0)))
(let $43 (DqPhyStage '($42) (lambda '($86) (block '(
  (let $87 (Condense1 (NarrowMap (ToFlow $86) $16) $17 $18 $19))
  (return (FromFlow (Condense (Map (Take $87 $20) (lambda '($88) (AsStruct '('"Min0" $88)))) $22 $23 $24)))
))) '('('"_logical_id" '9202) '('"_id" '"b72a97a1-85a1d63a-1affe8bc-f796dc7e"))))
(let $44 (DqCnValue (TDqOutput $43 '0)))
(let $45 (KqpPhysicalTx '($41 $43) '($44) '() $27))
(let $46 '"%kqp%tx_result_binding_2_0")
(let $47 (DqPhyStage '() (lambda '() (FromFlow (NarrowMap (DqReadWideWrap $29 '()) (lambda '() (AsStruct '('"column0" (Concat $30 (Member %kqp%tx_result_binding_2_0 '"Min0")))))))) '('('"_logical_id" '9271) '('"_id" '"661c4f18-b16d3fae-61728699-57ee0f40"))))
(let $48 (DqCnUnionAll (TDqOutput $47 '0)))
(let $49 (DqPhyStage '($48) (lambda '($89) $89) '('('"_logical_id" '11029) '('"_id" '"58c96718-f3f716cc-a4aeb1dd-9db650b9"))))
(let $50 (DqCnResult (TDqOutput $49 '0) $35))
(let $51 (KqpTxResultBinding $21 '"2" '0))
(let $52 (KqpPhysicalTx '($47 $49) '($50) '('($46 $51)) $38))
(let $53 '($28 $39 $45 $52))
(let $54 (ListType (StructType '('"column0" (OptionalType $11)))))
(let $55 (KqpTxResultBinding $54 '1 '0))
(let $56 (KqpTxResultBinding $54 '"3" '0))
(return (KqpPhysicalQuery $53 '($55 $56) '('('"type" '"query"))))
)
