(
(declare %kqp%tx_result_binding_0_0 (OptionalType (StructType '('AggregateList0 (ListType (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 '"4") '('DataSize '"166") '('ChunkCount '1) '('ModifyTime '0) '('Revision '0)))
(let $6 (YtTable '"Input" $3 $4 $5 '() (Void) (Void) '"/Root/plato"))
(let $7 (Bool 'false))
(let $8 (DataType 'String))
(let $9 (ListType $8))
(let $10 '('('"_logical_id" '4011) '('"_id" '"33517364-b7e75467-faf19b46-651ec1ae") '('"_wide_channels" (StructType '('_yql_agg_0 $9)))))
(let $11 (DqPhyStage '() (lambda '() (block '(
  (let $29 (YtReadTable! world $1 '((YtSection '((YtPath $6 '('"key") (Void) (Void))) '()))))
  (let $30 (Condense1 (NarrowMap (DqReadWideWrap $29 '()) (lambda '($31) (AsStruct '('"key" $31)))) (lambda '($32) (AsList (Member $32 '"key"))) (lambda '($33 $34) $7) (lambda '($35 $36) (Insert $36 (Member $35 '"key")))))
  (return (FromFlow (ExpandMap $30 (lambda '($37) $37))))
))) $10))
(let $12 (DqCnUnionAll (TDqOutput $11 '0)))
(let $13 (OptionalType (StructType '('AggregateList0 $9))))
(let $14 (DqPhyStage '($12) (lambda '($38) (block '(
  (let $39 (Condense1 (NarrowMap (ToFlow $38) (lambda '($40) (AsStruct '('_yql_agg_0 $40)))) (lambda '($41) (Member $41 '_yql_agg_0)) (lambda '($42 $43) $7) (lambda '($44 $45) (Extend (Member $44 '_yql_agg_0) $45))))
  (return (FromFlow (Condense (Map (Take $39 (Uint64 '1)) (lambda '($46) (AsStruct '('AggregateList0 $46)))) (Nothing $13) (lambda '($47 $48) $7) (lambda '($49 $50) (Just $49)))))
))) '('('"_logical_id" '4451) '('"_id" '"9cdcd39d-199d39c2-a500c018-157f4f04"))))
(let $15 (DqCnValue (TDqOutput $14 '0)))
(let $16 (KqpPhysicalTx '($11 $14) '($15) '() '('('"type" '"compute"))))
(let $17 (StructType '('"key" $8) '('"subkey" $8) '('"value" $8)))
(let $18 '('('"_logical_id" '3875) '('"_id" '"3d8de40c-cec3d805-78d502c2-9703c1b") '('"_wide_channels" $17)))
(let $19 (DqPhyStage '() (lambda '() (block '(
  (let $51 '('"key" '"subkey" '"value"))
  (let $52 (YtReadTable! world $1 '((YtSection '((YtPath $6 $51 (Void) (Void))) '()))))
  (return (FromFlow (DqReadWideWrap $52 '())))
))) $18))
(let $20 (DqCnUnionAll (TDqOutput $19 '0)))
(let $21 '"%kqp%tx_result_binding_0_0")
(let $22 (DqPhyStage '($20) (lambda '($53) (block '(
  (let $54 (Bool 'true))
  (let $55 (Sort (NarrowMap (ToFlow $53) (lambda '($56 $57 $58) (AsStruct '('_yql_sys_order_by (Nth (ToOptional (Filter (Collect (Enumerate (Sort (Coalesce (Member %kqp%tx_result_binding_0_0 'AggregateList0) (List $9)) $54 (lambda '($59) $59)))) (lambda '($60) (== (Nth $60 '1) $56)))) '0)) '('"key" $56) '('"subkey" $57) '('"value" $58)))) $54 (lambda '($61) (Member $61 '_yql_sys_order_by))))
  (return (FromFlow (OrderedMap $55 (lambda '($62) (AsStruct '('"key" (Member $62 '"key")) '('"subkey" (Member $62 '"subkey")) '('"value" (Member $62 '"value")))))))
))) '('('"_logical_id" '4585) '('"_id" '"6f73b65d-7ff2a93a-1e0d4b1e-a8c97467"))))
(let $23 (DqCnUnionAll (TDqOutput $22 '0)))
(let $24 (DqPhyStage '($23) (lambda '($63) $63) '('('"_logical_id" '5684) '('"_id" '"ae5c237-7767abf5-1941346f-214b3769"))))
(let $25 '($19 $22 $24))
(let $26 (DqCnResult (TDqOutput $24 '0) '()))
(let $27 (KqpTxResultBinding $13 '0 '0))
(let $28 (KqpPhysicalTx $25 '($26) '('($21 $27)) '('('"type" '"generic"))))
(return (KqpPhysicalQuery '($16 $28) '((KqpTxResultBinding (ListType $17) '1 '0)) '('('"type" '"query"))))
)
