(
(declare %kqp%tx_result_binding_0_0 (OptionalType (StructType '('Max0 (DataType 'String)))))
(declare %kqp%tx_result_binding_1_0 (OptionalType (StructType '('Count0 (DataType 'Uint64)))))
(let $1 '@@["StructType";[["key";["DataType";"String"]];["subkey";["DataType";"String"]];["value";["DataType";"String"]]]]@@)
(let $2 (YqlRowSpec '('NativeYtTypeFlags '0) '('StrictSchema '1) '('UniqueKeys '0) '('Type $1)))
(let $3 (YtMeta '('CanWrite '1) '('DoesExist '1) '('YqlCompatibleScheme '1) '('InferredScheme '0) '('IsDynamic '0) '('Attrs '('('"native_strict_schema" 'false)))))
(let $4 (YtStat '('Id '"Input") '('RecordsCount '"4") '('DataSize '"166") '('ChunkCount '1) '('ModifyTime '0) '('Revision '0)))
(let $5 (YtTable '"Input" $2 $3 $4 '() (Void) (Void) '"/Root/plato"))
(let $6 (YtReadTable! world (DataSource '"yt" '"/Root/plato") '((YtSection '((YtPath $5 '('"key") (Void) (Void))) '()))))
(let $7 (DqReadWideWrap $6 '()))
(let $8 (Bool 'false))
(let $9 '('"_logical_id" '4132))
(let $10 (DataType 'String))
(let $11 '($9 '('"_id" '"360884a3-6e3891f9-8cee8043-5bd93d3a") '('"_wide_channels" (StructType '('_yql_agg_0 $10)))))
(let $12 (DqPhyStage '() (lambda '() (block '(
  (let $44 (Condense1 (NarrowMap $7 (lambda '($45) (AsStruct '('"key" $45)))) (lambda '($46) (Member $46 '"key")) (lambda '($47 $48) $8) (lambda '($49 $50) (AggrMax (Member $49 '"key") $50))))
  (return (FromFlow (ExpandMap $44 (lambda '($51) $51))))
))) $11))
(let $13 (DqCnUnionAll (TDqOutput $12 '0)))
(let $14 (Uint64 '1))
(let $15 (OptionalType (StructType '('Max0 $10))))
(let $16 (DqPhyStage '($13) (lambda '($52) (block '(
  (let $53 (Condense1 (NarrowMap (ToFlow $52) (lambda '($54) (AsStruct '('_yql_agg_0 $54)))) (lambda '($55) (Member $55 '_yql_agg_0)) (lambda '($56 $57) $8) (lambda '($58 $59) (AggrMax (Member $58 '_yql_agg_0) $59))))
  (return (FromFlow (Condense (Map (Take $53 $14) (lambda '($60) (AsStruct '('Max0 $60)))) (Nothing $15) (lambda '($61 $62) $8) (lambda '($63 $64) (Just $63)))))
))) '('('"_logical_id" '4548) '('"_id" '"6138e987-8f3c2bf5-bab43a87-b2b2a54d"))))
(let $17 (DqCnValue (TDqOutput $16 '0)))
(let $18 '('('"type" '"compute")))
(let $19 (KqpPhysicalTx '($12 $16) '($17) '() $18))
(let $20 '($9 '('"_id" '"44638a8-5f58cddd-8a843be8-93fcba99") '('"_wide_channels" (StructType '('"key" $10)))))
(let $21 (DqPhyStage '() (lambda '() (FromFlow $7)) $20))
(let $22 (DqCnMap (TDqOutput $21 '0)))
(let $23 '"%kqp%tx_result_binding_0_0")
(let $24 (Member %kqp%tx_result_binding_0_0 'Max0))
(let $25 (lambda '($74) $74))
(let $26 (DataType 'Uint64))
(let $27 '('('"_logical_id" '4813) '('"_id" '"786a6bc2-3002a1d5-6ca8a3aa-c3e6c2bc") '('"_wide_channels" (StructType '('_yql_agg_0 $26)))))
(let $28 (DqPhyStage '($22) (lambda '($65) (block '(
  (let $66 (Condense1 (NarrowMap (WideFilter (ToFlow $65) (lambda '($67) (Coalesce (== $67 $24) $8))) (lambda '($68) (AsStruct))) (lambda '($69) $14) (lambda '($70 $71) $8) (lambda '($72 $73) (AggrAdd $73 $14))))
  (return (FromFlow (ExpandMap $66 $25)))
))) $27))
(let $29 (DqCnUnionAll (TDqOutput $28 '0)))
(let $30 (OptionalType (StructType '('Count0 $26))))
(let $31 (DqPhyStage '($29) (lambda '($75) (block '(
  (let $76 (WideCondense1 (ToFlow $75) $25 (lambda '($77 $78) $8) (lambda '($79 $80) (AggrAdd $79 $80))))
  (return (FromFlow (Condense (NarrowMap (Take $76 $14) (lambda '($81) (AsStruct '('Count0 $81)))) (Nothing $30) (lambda '($82 $83) $8) (lambda '($84 $85) (Just $84)))))
))) '('('"_logical_id" '4961) '('"_id" '"92e92446-922e894f-ab38b4bc-a00319cf"))))
(let $32 '($21 $28 $31))
(let $33 (DqCnValue (TDqOutput $31 '0)))
(let $34 (KqpTxResultBinding $15 '0 '0))
(let $35 '($23 $34))
(let $36 (KqpPhysicalTx $32 '($33) '($35) $18))
(let $37 '"%kqp%tx_result_binding_1_0")
(let $38 '('('"_logical_id" '5085) '('"_id" '"26aa2426-680ca4fe-9c7bb336-31878e19") '('"_partition_mode" '"single")))
(let $39 (DqPhyStage '() (lambda '() (Iterator (AsList (AsStruct '('"column0" (Concat (Concat (SafeCast (Coalesce (Member %kqp%tx_result_binding_1_0 'Count0) (Uint64 '0)) $10) (String '" (")) (Concat $24 (String '"/24)")))))))) $38))
(let $40 (DqCnResult (TDqOutput $39 '0) '('"column0")))
(let $41 (KqpTxResultBinding $30 '1 '0))
(let $42 (KqpPhysicalTx '($39) '($40) '($35 '($37 $41)) '('('"type" '"generic"))))
(let $43 '($19 $36 $42))
(return (KqpPhysicalQuery $43 '((KqpTxResultBinding (ListType (StructType '('"column0" (OptionalType $10)))) '"2" '0)) '('('"type" '"query"))))
)
