(
(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) '('Attrs '('('"native_strict_schema" 'false)))))
(let $5 (YtStat '('Id '"Input") '('RecordsCount '"10") '('DataSize '"420") '('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 '('"value") (Void) (Void))) '()))))
(let $8 (lambda '($58) (AsStruct '('"value" $58))))
(let $9 (Bool 'false))
(let $10 (lambda '($60 $61) $9))
(let $11 (DataType 'String))
(let $12 '('"_wide_channels" (StructType '('_yql_agg_0 $11))))
(let $13 '('('"_logical_id" '5923) '('"_id" '"acc88174-32d94197-4c8318d9-d3eb6945") $12))
(let $14 (DqPhyStage '() (lambda '() (block '(
  (let $57 (Condense1 (NarrowMap (DqReadWideWrap $7 '()) $8) (lambda '($59) (AssumeNonStrict (Member $59 '"value"))) $10 (lambda '($62 $63) (AggrMin (AssumeNonStrict (Member $62 '"value")) $63))))
  (return (FromFlow (ExpandMap $57 (lambda '($64) $64))))
))) $13))
(let $15 (DqCnUnionAll (TDqOutput $14 '0)))
(let $16 (lambda '($67) (AsStruct '('_yql_agg_0 $67))))
(let $17 (lambda '($68) (Member $68 '_yql_agg_0)))
(let $18 (lambda '($69 $70) $9))
(let $19 (lambda '($71 $72) (AggrMin (Member $71 '_yql_agg_0) $72)))
(let $20 (Uint64 '1))
(let $21 (OptionalType (StructType '('Min0 $11))))
(let $22 (Nothing $21))
(let $23 (lambda '($74 $75) $9))
(let $24 (lambda '($76 $77) (Just $76)))
(let $25 (DqPhyStage '($15) (lambda '($65) (block '(
  (let $66 (Condense1 (NarrowMap (ToFlow $65) $16) $17 $18 $19))
  (return (FromFlow (Condense (Map (Take $66 $20) (lambda '($73) (AsStruct '('Min0 $73)))) $22 $23 $24)))
))) '('('"_logical_id" '6297) '('"_id" '"a1d560b5-37fcd2c7-78721aee-c2f3b5af"))))
(let $26 (DqCnValue (TDqOutput $25 '0)))
(let $27 '('('"type" '"compute")))
(let $28 (KqpPhysicalTx '($14 $25) '($26) '() $27))
(let $29 '('"key" '"subkey" '"value"))
(let $30 (YtReadTable! world $1 '((YtSection '((YtPath $6 $29 (Void) (Void))) '()))))
(let $31 '"%kqp%tx_result_binding_0_0")
(let $32 (lambda '($81 $82 $83) (AsStruct '('"key" $81) '('"subkey" $82) '('"value" $83))))
(let $33 (DqPhyStage '() (lambda '() (FromFlow (NarrowMap (WideFilter (DqReadWideWrap $30 '()) (lambda '($78 $79 $80) (And (!= $79 (String '1)) (Coalesce (> $80 (Member %kqp%tx_result_binding_0_0 'Min0)) $9)))) $32))) '('('"_logical_id" '6405) '('"_id" '"c3d69afb-abc1334-21e3dbaa-c136b47b"))))
(let $34 (DqCnUnionAll (TDqOutput $33 '0)))
(let $35 (DqPhyStage '($34) (lambda '($84) $84) '('('"_logical_id" '8004) '('"_id" '"624f4f25-324cfcf5-f408500e-b1bdc5f"))))
(let $36 (DqCnResult (TDqOutput $35 '0) '()))
(let $37 (KqpTxResultBinding $21 '0 '0))
(let $38 '('('"type" '"generic")))
(let $39 (KqpPhysicalTx '($33 $35) '($36) '('($31 $37)) $38))
(let $40 '('('"_logical_id" '6633) '('"_id" '"4c66488f-dca557fc-c4a4999f-a3667abc") $12))
(let $41 (DqPhyStage '() (lambda '() (block '(
  (let $85 (Condense1 (NarrowMap (DqReadWideWrap $7 '()) $8) (lambda '($86) (Member $86 '"value")) $10 (lambda '($87 $88) (AggrMin (Member $87 '"value") $88))))
  (return (FromFlow (ExpandMap $85 (lambda '($89) $89))))
))) $40))
(let $42 (DqCnUnionAll (TDqOutput $41 '0)))
(let $43 (DqPhyStage '($42) (lambda '($90) (block '(
  (let $91 (Condense1 (NarrowMap (ToFlow $90) $16) $17 $18 $19))
  (return (FromFlow (Condense (Map (Take $91 $20) (lambda '($92) (AsStruct '('Min0 $92)))) $22 $23 $24)))
))) '('('"_logical_id" '7006) '('"_id" '"e11dcc9f-2c977c69-ce5add03-8c007487"))))
(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 (WideFilter (DqReadWideWrap $30 '()) (lambda '($93 $94 $95) (And (!= $94 (String '"2")) (Coalesce (> $95 (AssumeNonStrict (Member %kqp%tx_result_binding_2_0 'Min0))) $9)))) $32))) '('('"_logical_id" '7116) '('"_id" '"e3e4ed02-35bad0cf-9c7554d0-5d707118"))))
(let $48 (DqCnUnionAll (TDqOutput $47 '0)))
(let $49 (DqPhyStage '($48) (lambda '($96) $96) '('('"_logical_id" '9007) '('"_id" '"b9df1cb7-2dc00854-6124ae50-ee09f28"))))
(let $50 (DqCnResult (TDqOutput $49 '0) '()))
(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 '('"key" $11) '('"subkey" $11) '('"value" $11))))
(let $55 (KqpTxResultBinding $54 '1 '0))
(let $56 (KqpTxResultBinding $54 '"3" '0))
(return (KqpPhysicalQuery $53 '($55 $56) '('('"type" '"query"))))
)
