(
(let $1 (DataType 'Double))
(let $2 (OptionalType (TupleType $1 (DataType 'Uint64))))
(let $3 '('"value" (DataType 'String)))
(let $4 '('('"_logical_id" '1910) '('"_id" '"d861ff82-a30c1cee-72dcc58d-565a64f2") '('"_wide_channels" (StructType '('_yql_agg_0 $2) $3))))
(let $5 (DqPhyStage '() (lambda '() (block '(
  (let $15 '@@["StructType";[["key";["DataType";"String"]];["subkey";["DataType";"String"]];["value";["DataType";"String"]]]]@@)
  (let $16 (YqlRowSpec '('NativeYtTypeFlags '0) '('StrictSchema '1) '('UniqueKeys '0) '('Type $15)))
  (let $17 (YtMeta '('CanWrite '1) '('DoesExist '1) '('YqlCompatibleScheme '1) '('InferredScheme '0) '('IsDynamic '0) '('Attrs '('('"native_strict_schema" '"false")))))
  (let $18 (YtStat '('Id '"Input") '('RecordsCount '"4") '('DataSize '"166") '('ChunkCount '1) '('ModifyTime '0) '('Revision '0)))
  (let $19 (YtTable '"Input" $16 $17 $18 '() (Void) (Void) '"/Root/plato"))
  (let $20 (YtReadTable! world (DataSource '"yt" '"/Root/plato") '((YtSection '((YtPath $19 '('"key" '"value") (Void) (Void))) '()))))
  (let $21 (OptionalType (DataType 'Int32)))
  (let $22 (lambda '($32) (Just '((Convert $32 'Double) (Uint64 '1)))))
  (let $23 (Nothing $2))
  (let $24 (lambda '($41 $42) $42 $41))
  (return (DqPhyHashCombine (WideToBlocks (FromFlow (WideFilter (DqReadWideWrap $20 '()) (lambda '($25 $26) (> $26 (String '"foo")))))) '-1073741824 (lambda '($27 $28) $28) (lambda '($29 $30 $31) (IfPresent (SafeCast $30 $21) $22 $23)) (lambda '($33 $34 $35 $36) (block '(
    (let $37 (SafeCast $34 $21))
    (let $38 (IfPresent $37 $22 $23))
    (return (IfPresent $36 (lambda '($39) (IfPresent $37 (lambda '($40) (Just '((AggrAdd (Nth $39 '0) (Convert $40 'Double)) (Inc (Nth $39 '1))))) (Just $39))) $38))
  ))) $24))
))) $4))
(let $6 (DqCnHashShuffle (TDqOutput $5 '0) '('1) '0 '"HashV2"))
(let $7 (OptionalType $1))
(let $8 (StructType '('"key" $7) $3))
(let $9 '('('"_logical_id" '5144) '('"_id" '"e35bf431-d43c32aa-8d527e1a-faab3cdc") '('"_wide_channels" $8)))
(let $10 (DqPhyStage '($6) (lambda '($43) (block '(
  (let $44 (lambda '($59 $60) (block '(
    (let $61 (IfPresent $60 (lambda '($62) (Just (Div (Nth $62 '0) (Nth $62 '1)))) (Nothing $7)))
    (return $61 $59)
  ))))
  (let $45 (WideCombiner (ToFlow (WideFromBlocks $43)) '"" (lambda '($48 $49) $49) (lambda '($50 $51 $52) $51) (lambda '($53 $54 $55 $56) (IfPresent $54 (lambda '($57) (IfPresent $56 (lambda '($58) (Just '((AggrAdd (Nth $57 '0) (Nth $58 '0)) (AggrAdd (Nth $57 '1) (Nth $58 '1))))) $54)) $56)) $44))
  (let $46 (Sort (NarrowMap $45 (lambda '($63 $64) (AsStruct '('"key" (+ $63 (Double '"0.3"))) '('"value" $64)))) (Bool 'true) (lambda '($65) (Member $65 '"key"))))
  (let $47 (lambda '($66) (Member $66 '"key") (Member $66 '"value")))
  (return (FromFlow (ExpandMap $46 $47)))
))) $9))
(let $11 (DqCnMerge (TDqOutput $10 '0) '('('0 '"Asc"))))
(let $12 (DqPhyStage '($11) (lambda '($67) (FromFlow (NarrowMap (ToFlow $67) (lambda '($68 $69) (AsStruct '('"key" $68) '('"value" $69)))))) '('('"_logical_id" '5156) '('"_id" '"540ef055-19f35694-7b4c093c-d288ca7"))))
(let $13 '($5 $10 $12))
(let $14 (DqCnResult (TDqOutput $12 '0) '('"value" '"key")))
(return (KqpPhysicalQuery '((KqpPhysicalTx $13 '($14) '() '('('"type" '"generic")))) '((KqpTxResultBinding (ListType $8) '0 '0)) '('('"type" '"query"))))
)
