(
(let $1 (Bool 'false))
(let $2 (DataType 'Double))
(let $3 '('('"_logical_id" '1745) '('"_id" '"c9444473-7bebfacc-7d2ac1f-d059f82b") '('"_wide_channels" (StructType '('_yql_agg_0 (TupleType $2 (DataType 'Uint64)))))))
(let $4 (DqPhyStage '() (lambda '() (block '(
  (let $13 '@@["StructType";[["key";["DataType";"Uint64"]];["subkey";["DataType";"Uint64"]]]]@@)
  (let $14 (YqlRowSpec '('NativeYtTypeFlags '0) '('StrictSchema '1) '('UniqueKeys '0) '('Type $13)))
  (let $15 (YtMeta '('CanWrite '1) '('DoesExist '1) '('YqlCompatibleScheme '1) '('InferredScheme '0) '('IsDynamic '0) '('HasRLS '0) '('Attrs '('('"native_strict_schema" 'false)))))
  (let $16 (YtStat '('Id '"Input") '('RecordsCount '"3") '('DataSize '"78") '('ChunkCount '1) '('ModifyTime '0) '('Revision '0)))
  (let $17 (YtTable '"Input" $14 $15 $16 '() (Void) (Void) '"/Root/plato"))
  (let $18 (YtReadTable! world (DataSource '"yt" '"/Root/plato") '((YtSection '((YtPath $17 '('"key" '"subkey") (Void) (Void) (Void))) '()))))
  (let $19 (Condense1 (NarrowMap (WideFilter (DqReadWideWrap $18 '()) (lambda '($20 $21) (!= $21 (Int32 '"5")))) (lambda '($22 $23) (AsStruct '('"key" $22)))) (lambda '($24) '((Convert (Member $24 '"key") 'Double) (Uint64 '1))) (lambda '($25 $26) $1) (lambda '($27 $28) '((AggrAdd (Nth $28 '0) (Convert (Member $27 '"key") 'Double)) (Inc (Nth $28 '1))))))
  (return (FromFlow (ExpandMap $19 (lambda '($29) $29))))
))) $3))
(let $5 (DqCnUnionAll (TDqOutput $4 '0)))
(let $6 (StructType '('Avg0 $2)))
(let $7 '('('"_logical_id" '4461) '('"_id" '"1411f0f5-7957af6-b6838dbf-65d9b3dc") '('"_partition_mode" '"aggregate") '('"_wide_channels" $6)))
(let $8 (DqPhyStage '($5) (lambda '($30) (block '(
  (let $31 (lambda '($34) (Nth $34 '0) (Nth $34 '1)))
  (let $32 (lambda '($38 $39 $40) (AggrAdd (Nth $38 '0) $39) (AggrAdd (Nth $38 '1) $40)))
  (let $33 (WideCondense1 (ToFlow $30) $31 (lambda '($35 $36 $37) $1) $32))
  (return (FromFlow (WideMap $33 (lambda '($41 $42) (Div $41 $42)))))
))) $7))
(let $9 (DqCnUnionAll (TDqOutput $8 '0)))
(let $10 (DqPhyStage '($9) (lambda '($43) (block '(
  (let $44 (Condense (NarrowMap (ToFlow $43) (lambda '($45) (AsStruct '('Avg0 $45)))) (List (ListType $6)) (lambda '($46 $47) $1) (lambda '($48 $49) (AsList $48))))
  (return (FromFlow (Map $44 (lambda '($50) (AsStruct '('"column0" (Member (ToOptional $50) 'Avg0)))))))
))) '('('"_logical_id" '4515) '('"_id" '"d0da4e75-83620edf-e88711e6-a8f213eb"))))
(let $11 '($4 $8 $10))
(let $12 (DqCnResult (TDqOutput $10 '0) '('"column0")))
(return (KqpPhysicalQuery '((KqpPhysicalTx $11 '($12) '() '('('"type" '"generic")))) '((KqpTxResultBinding (ListType (StructType '('"column0" (OptionalType $2)))) '0 '0)) '('('"type" '"query"))))
)
