(
(let $1 (DataType 'Uint64))
(let $2 (DataType 'String))
(let $3 '('"key" $2))
(let $4 '('('"_logical_id" '1270) '('"_id" '"48e121ea-23cbd8f5-d2266372-666a2e23") '('"_wide_channels" (StructType '('_yql_agg_0 $1) $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") (Void) (Void))) '()))))
  (let $21 (Uint64 '1))
  (let $22 (lambda '($29 $30) $30 $29))
  (return (DqPhyHashCombine (WideToBlocks (FromFlow (DqReadWideWrap $20 '()))) '-1073741824 (lambda '($23) $23) (lambda '($24 $25) $21) (lambda '($26 $27 $28) (AggrAdd $28 $21)) $22))
))) $4))
(let $6 (DqCnHashShuffle (TDqOutput $5 '0) '('1) '0 '"HashV2"))
(let $7 (Uint64 '2))
(let $8 (StructType '('"count" $1) $3))
(let $9 '('('"_logical_id" '1513) '('"_id" '"b6a72670-22931b86-9280d53d-725afddd") '('"_wide_channels" $8)))
(let $10 (DqPhyStage '($6) (lambda '($31) (block '(
  (let $32 (NarrowSqueezeToDict (ToFlow (WideFromBlocks $31)) (lambda '($36 $37) $37) (lambda '($38 $39) (AsStruct '('_yql_agg_0 $38) '('"key" $39))) '('Auto 'Many)))
  (let $33 (Condense1 (OrderedFlatMap $32 (lambda '($40) (OrderedFlatMap (DictPayloads $40) (lambda '($41) $41)))) (lambda '($42) $42) (lambda '($43 $44) (AggrNotEquals (Member $43 '"key") (Member $44 '"key"))) (lambda '($45 $46) (AsStruct '('_yql_agg_0 (AggrAdd (Member $45 '_yql_agg_0) (Member $46 '_yql_agg_0))) '('"key" (Member $46 '"key"))))))
  (let $34 (TopSort (Map $33 (lambda '($47) (block '(
    (let $48 (CallableType '() '($2) '((OptionalType $2))))
    (let $49 (Udf '"SimpleUdf.Echo" (Void) (VoidType) '"" $48 (VoidType) '"" '()))
    (return (AsStruct '('"count" (Member $47 '_yql_agg_0)) '('"key" (Apply $49 (Just (Member $47 '"key"))))))
  )))) $7 (Bool 'true) (lambda '($50) (Member $50 '"key"))))
  (let $35 (lambda '($51) (Member $51 '"count") (Member $51 '"key")))
  (return (FromFlow (ExpandMap $34 $35)))
))) $9))
(let $11 (DqCnMerge (TDqOutput $10 '0) '('('1 '"Asc"))))
(let $12 (DqPhyStage '($11) (lambda '($52) (FromFlow (NarrowMap (Take (ToFlow $52) $7) (lambda '($53 $54) (AsStruct '('"count" $53) '('"key" $54)))))) '('('"_logical_id" '1526) '('"_id" '"9fda6aa4-6c2995f8-3fa73bb9-c8ea89c1"))))
(let $13 '($5 $10 $12))
(let $14 (DqCnResult (TDqOutput $12 '0) '('"key" '"count")))
(return (KqpPhysicalQuery '((KqpPhysicalTx $13 '($14) '() '('('"type" '"generic")))) '((KqpTxResultBinding (ListType $8) '0 '0)) '('('"type" '"query"))))
)
