(
(declare %kqp%tx_result_binding_0_0 (OptionalType (StructType '('Count0 (DataType 'Uint64)))))
(let $1 (OptionalType (DataType 'Int32)))
(let $2 (DataType 'Double))
(let $3 '($2 '"" '1))
(let $4 (CallableType '('1) '($2) $3 '($1 '"Precision")))
(let $5 (Udf '"Math.Round" (Void) (VoidType) '"" $4 (VoidType) '"" '('('"strict"))))
(let $6 (OptionalType $2))
(let $7 '('('"_logical_id" '1272) '('"_id" '"e7d62f1b-83055be9-4d413f69-8f1e851c") '('"_wide_channels" (StructType '('_yql_preagg_Count0 $6)))))
(let $8 (DqPhyStage '() (lambda '() (block '(
  (let $26 '@@["StructType";[["key";["DataType";"String"]];["subkey";["DataType";"String"]];["value";["DataType";"String"]]]]@@)
  (let $27 (YqlRowSpec '('NativeYtTypeFlags '0) '('StrictSchema '1) '('UniqueKeys '0) '('Type $26)))
  (let $28 (YtMeta '('CanWrite '1) '('DoesExist '1) '('YqlCompatibleScheme '1) '('InferredScheme '0) '('IsDynamic '0) '('Attrs '('('"native_strict_schema" 'false)))))
  (let $29 (YtStat '('Id '"Input2") '('RecordsCount '"4") '('DataSize '"164") '('ChunkCount '1) '('ModifyTime '0) '('Revision '0)))
  (let $30 (YtTable '"Input2" $27 $28 $29 '() (Void) (Void) '"/Root/plato"))
  (let $31 (YtReadTable! world (DataSource '"yt" '"/Root/plato") '((YtSection '((YtPath $30 '('"key") (Void) (Void))) '()))))
  (return (DqPhyHashCombine (WideToBlocks (FromFlow (DqReadWideWrap $31 '()))) '-1073741824 (lambda '($32) (IfPresent (SafeCast $32 $1) (lambda '($33) (Just (Apply $5 (Convert $33 $2)))) (Nothing $6))) (lambda '($34 $35) $34) (lambda '($36 $37 $38) $38) (lambda '($39 $40) $40)))
))) $7))
(let $9 (DqCnHashShuffle (TDqOutput $8 '0) '('0) '0 '"HashV2"))
(let $10 (Bool 'false))
(let $11 (DataType 'Uint64))
(let $12 '('('"_logical_id" '2040) '('"_id" '"c09a4881-f921d73-5a6ab29-d6f541d4") '('"_wide_channels" (StructType '('_yql_agg_0 (OptionalType $11))))))
(let $13 (DqPhyStage '($9) (lambda '($41) (block '(
  (let $42 (lambda '($46) $46))
  (let $43 (lambda '($47 $48)))
  (let $44 (WideCombiner (ToFlow (WideFromBlocks $41)) '"" $42 $43 $43 $42))
  (let $45 (Condense1 (NarrowMap $44 (lambda '($49) (AsStruct '('_yql_preagg_Count0 $49)))) (lambda '($50) (AggrCountInit (Member $50 '_yql_preagg_Count0))) (lambda '($51 $52) $10) (lambda '($53 $54) (AggrCountUpdate (Member $53 '_yql_preagg_Count0) $54))))
  (return (FromFlow (ExpandMap $45 (lambda '($55) (Just $55)))))
))) $12))
(let $14 (DqCnUnionAll (TDqOutput $13 '0)))
(let $15 (OptionalType (StructType '('Count0 $11))))
(let $16 (DqPhyStage '($14) (lambda '($56) (block '(
  (let $57 (WideCondense1 (ToFlow $56) (lambda '($58) $58) (lambda '($59 $60) $10) (lambda '($61 $62) (IfPresent $61 (lambda '($63) (IfPresent $62 (lambda '($64) (Just (AggrAdd $63 $64))) $61)) $62))))
  (return (FromFlow (Condense (NarrowMap (Take $57 (Uint64 '1)) (lambda '($65) (AsStruct '('Count0 (Unwrap $65))))) (Nothing $15) (lambda '($66 $67) $10) (lambda '($68 $69) (Just $68)))))
))) '('('"_logical_id" '2511) '('"_id" '"d60e6bf2-d4ad3c6a-8bfaa6b5-bc16db1f"))))
(let $17 '($8 $13 $16))
(let $18 (DqCnValue (TDqOutput $16 '0)))
(let $19 (KqpPhysicalTx $17 '($18) '() '('('"type" '"compute"))))
(let $20 '"%kqp%tx_result_binding_0_0")
(let $21 '('('"_logical_id" '2635) '('"_id" '"d08b3b5b-89165b40-e7b4eb3a-22064640") '('"_partition_mode" '"single")))
(let $22 (DqPhyStage '() (lambda '() (block '(
  (let $70 (Apply $5 (/ (Coalesce (Member %kqp%tx_result_binding_0_0 'Count0) (Uint64 '0)) (Double '"100.0")) (Just (Int32 '"-2"))))
  (return (Iterator (AsList (AsStruct '('"column0" $70)))))
))) $21))
(let $23 (DqCnResult (TDqOutput $22 '0) '('"column0")))
(let $24 (KqpTxResultBinding $15 '0 '0))
(let $25 (KqpPhysicalTx '($22) '($23) '('($20 $24)) '('('"type" '"generic"))))
(return (KqpPhysicalQuery '($19 $25) '((KqpTxResultBinding (ListType (StructType '('"column0" $2))) '1 '0)) '('('"type" '"query"))))
)
