(
(declare %kqp%tx_result_binding_0_0 (OptionalType (StructType '('CountIf0 (DataType 'Uint64)) '('CountIf1 (DataType 'Uint64)) '('CountIf2 (DataType 'Uint64)))))
(let $1 (Bool 'false))
(let $2 (Uint64 '1))
(let $3 (Uint64 '0))
(let $4 (DataType 'Uint64))
(let $5 (StructType '('_yql_agg_0 $4) '('_yql_agg_1 $4) '('_yql_agg_2 $4)))
(let $6 '('('"_logical_id" '2460) '('"_id" '"658d80a7-bb6c345a-dd433f7f-428a3772") '('"_wide_channels" $5)))
(let $7 (DqPhyStage '() (lambda '() (block '(
  (let $20 '@@["StructType";[["key";["OptionalType";["StructType";[["kk";["OptionalType";["DataType";"Uint32"]]]]]]];["subkey";["DataType";"String"]];["value";["DataType";"String"]]]]@@)
  (let $21 (YqlRowSpec '('NativeYtTypeFlags '0) '('StrictSchema '1) '('UniqueKeys '0) '('Type $20)))
  (let $22 (YtMeta '('CanWrite '1) '('DoesExist '1) '('YqlCompatibleScheme '1) '('InferredScheme '0) '('IsDynamic '0) '('Attrs '('('"native_strict_schema" 'false)))))
  (let $23 (YtStat '('Id '"Input") '('RecordsCount '"12") '('DataSize '"532") '('ChunkCount '1) '('ModifyTime '0) '('Revision '0)))
  (let $24 (YtTable '"Input" $21 $22 $23 '() (Void) (Void) '"/Root/plato"))
  (let $25 (YtReadTable! world (DataSource '"yt" '"/Root/plato") '((YtSection '((YtPath $24 '('key) (Void) (Void))) '()))))
  (let $26 (Int32 '"10"))
  (let $27 (Int32 '0))
  (let $28 (Int32 '"100"))
  (let $29 (Int32 '"900"))
  (let $30 (lambda '($37) (block '(
    (let $38 (If (Coalesce (== (% $37 $26) $27) $1) $2 $3))
    (let $39 (If (< $37 $28) $2 $3))
    (let $40 (If (> $37 $29) $2 $3))
    (return $38 $39 $40)
  ))))
  (let $31 (lambda '($45 $46 $47 $48) (block '(
    (let $49 (If (Coalesce (== (% $45 $26) $27) $1) $2 $3))
    (let $50 (If (< $45 $28) $2 $3))
    (let $51 (If (> $45 $29) $2 $3))
    (return (AggrAdd $46 $49) (AggrAdd $47 $50) (AggrAdd $48 $51))
  ))))
  (return (FromFlow (WideCondense1 (ExpandMap (NarrowFlatMap (DqReadWideWrap $25 '()) (lambda '($32) (block '(
    (let $33 (Nothing (OptionalType (StructType '('kkstritem (DataType 'Uint32))))))
    (return (IfPresent $32 (lambda '($34) (IfPresent (Member $34 '"kk") (lambda '($35) (Just (AsStruct '('kkstritem $35)))) $33)) $33))
  )))) (lambda '($36) (Member $36 'kkstritem))) $30 (lambda '($41 $42 $43 $44) $1) $31)))
))) $6))
(let $8 (DqCnUnionAll (TDqOutput $7 '0)))
(let $9 (OptionalType (StructType '('CountIf0 $4) '('CountIf1 $4) '('CountIf2 $4))))
(let $10 (DqPhyStage '($8) (lambda '($52) (block '(
  (let $53 (lambda '($56 $57 $58) $56 $57 $58))
  (let $54 (lambda '($65 $66 $67 $68 $69 $70) (AggrAdd $65 $68) (AggrAdd $66 $69) (AggrAdd $67 $70)))
  (let $55 (WideCondense1 (ToFlow $52) $53 (lambda '($59 $60 $61 $62 $63 $64) $1) $54))
  (return (FromFlow (Condense (NarrowMap (Take $55 $2) (lambda '($71 $72 $73) (AsStruct '('CountIf0 $71) '('CountIf1 $72) '('CountIf2 $73)))) (Nothing $9) (lambda '($74 $75) $1) (lambda '($76 $77) (Just $76)))))
))) '('('"_logical_id" '3290) '('"_id" '"6c75c93e-92018d78-627758f7-613b3f0"))))
(let $11 (DqCnValue (TDqOutput $10 '0)))
(let $12 (KqpPhysicalTx '($7 $10) '($11) '() '('('"type" '"compute"))))
(let $13 '"%kqp%tx_result_binding_0_0")
(let $14 '('('"_logical_id" '3442) '('"_id" '"d79db2ba-3e9a5f52-442162ef-3be202de") '('"_partition_mode" '"single")))
(let $15 (DqPhyStage '() (lambda '() (block '(
  (let $78 %kqp%tx_result_binding_0_0)
  (return (Iterator (AsList (AsStruct '('"count_dec" (Coalesce (Member $78 'CountIf0) $3)) '('"count_huge" (Coalesce (Member $78 'CountIf2) $3)) '('"count_small" (Coalesce (Member $78 'CountIf1) $3))))))
))) $14))
(let $16 '('"count_dec" '"count_small" '"count_huge"))
(let $17 (DqCnResult (TDqOutput $15 '0) $16))
(let $18 (KqpTxResultBinding $9 '0 '0))
(let $19 (KqpPhysicalTx '($15) '($17) '('($13 $18)) '('('"type" '"generic"))))
(return (KqpPhysicalQuery '($12 $19) '((KqpTxResultBinding (ListType (StructType '('"count_dec" $4) '('"count_huge" $4) '('"count_small" $4))) '1 '0)) '('('"type" '"query"))))
)
