(
(let $1 (DataType 'String))
(let $2 (ListType $1))
(let $3 '('"value" $1))
(let $4 (StructType '('_yql_agg_0 $2) '('"key" $1) $3))
(let $5 '('('"_logical_id" '1813) '('"_id" '"aa3e65bc-be6b92b5-84258a49-80d3b0e") '('"_wide_channels" $4)))
(let $6 (DqPhyStage '() (lambda '() (block '(
  (let $19 '@@["StructType";[["key";["DataType";"String"]];["subkey";["DataType";"String"]];["value";["DataType";"String"]]]]@@)
  (let $20 (YqlRowSpec '('NativeYtTypeFlags '0) '('StrictSchema '1) '('UniqueKeys '0) '('Type $19)))
  (let $21 (YtMeta '('CanWrite '1) '('DoesExist '1) '('YqlCompatibleScheme '1) '('InferredScheme '0) '('IsDynamic '0) '('Attrs '('('"native_strict_schema" '"false")))))
  (let $22 (YtStat '('Id '"Input3") '('RecordsCount '"7") '('DataSize '"287") '('ChunkCount '1) '('ModifyTime '0) '('Revision '0)))
  (let $23 (YtTable '"Input3" $20 $21 $22 '() (Void) (Void) '"/Root/plato"))
  (let $24 (YtReadTable! world (DataSource '"yt" '"/Root/plato") '((YtSection '((YtPath $23 '('"key" '"value") (Void) (Void))) '()))))
  (let $25 (lambda '($27 $28) $28 $27))
  (let $26 (lambda '($38 $39 $40) $40 $39 $38))
  (return (WideFromBlocks (DqPhyHashCombine (WideToBlocks (FromFlow (DqReadWideWrap $24 '()))) '-1073741824 $25 (lambda '($29 $30 $31 $32) (AsList $31)) (lambda '($33 $34 $35 $36 $37) $37) $26)))
))) $5))
(let $7 (DqCnHashShuffle (TDqOutput $6 '0) '('"2" '1) '0 '"HashV2"))
(let $8 '('Auto 'Many))
(let $9 '('('"_logical_id" '1903) '('"_id" '"7e1c08a4-7cb76efe-20d3129e-fcbd85d5") '('"_partition_mode" '"aggregate") '('"_wide_channels" (StructType '('_yql_agg_0 (OptionalType $2)) $3))))
(let $10 (DqPhyStage '($7) (lambda '($41) (block '(
  (let $42 (NarrowSqueezeToDict (ToFlow $41) (lambda '($45 $46 $47) '($47 $46)) (lambda '($48 $49 $50) (AsStruct '('_yql_agg_0 $48) '('"key" $49) '('"value" $50))) $8))
  (let $43 (Condense1 (OrderedFlatMap $42 (lambda '($51) (OrderedFlatMap (DictPayloads $51) (lambda '($52) $52)))) (lambda '($53) $53) (lambda '($54 $55) (Or (AggrNotEquals (Member $54 '"value") (Member $55 '"value")) (AggrNotEquals (Member $54 '"key") (Member $55 '"key")))) (lambda '($56 $57) $56)))
  (let $44 (lambda '($58) (Just (Member $58 '_yql_agg_0)) (Member $58 '"value")))
  (return (FromFlow (ExpandMap $43 $44)))
))) $9))
(let $11 (DqCnHashShuffle (TDqOutput $10 '0) '('1) '0 '"HashV2"))
(let $12 (StructType '('"key_list" $2) '('"name" $1)))
(let $13 '('('"_logical_id" '2318) '('"_id" '"f930cb0d-1b18d94-3da883dc-22048351") '('"_wide_channels" $12)))
(let $14 (DqPhyStage '($11) (lambda '($59) (block '(
  (let $60 (NarrowSqueezeToDict (ToFlow $59) (lambda '($65 $66) $66) (lambda '($67 $68) (AsStruct '('_yql_agg_0 $67) '('"value" $68))) $8))
  (let $61 (Condense1 (OrderedFlatMap $60 (lambda '($69) (OrderedFlatMap (DictPayloads $69) (lambda '($70) $70)))) (lambda '($71) $71) (lambda '($72 $73) (AggrNotEquals (Member $72 '"value") (Member $73 '"value"))) (lambda '($74 $75) (block '(
    (let $76 (Member $74 '_yql_agg_0))
    (let $77 (Member $75 '_yql_agg_0))
    (let $78 (IfPresent $76 (lambda '($79) (IfPresent $77 (lambda '($80) (Just (Extend $79 $80))) $76)) $77))
    (return (AsStruct '('_yql_agg_0 $78) '('"value" (Member $75 '"value"))))
  )))))
  (let $62 (Bool 'true))
  (let $63 (Sort (Map $61 (lambda '($81) (block '(
    (let $82 (Sort (Unwrap (Member $81 '_yql_agg_0)) $62 (lambda '($83) $83)))
    (return (AsStruct '('"key_list" $82) '('"name" (Member $81 '"value"))))
  )))) $62 (lambda '($84) (Member $84 '"name"))))
  (let $64 (lambda '($85) (Member $85 '"key_list") (Member $85 '"name")))
  (return (FromFlow (ExpandMap $63 $64)))
))) $13))
(let $15 (DqCnMerge (TDqOutput $14 '0) '('('1 '"Asc"))))
(let $16 (DqPhyStage '($15) (lambda '($86) (FromFlow (NarrowMap (ToFlow $86) (lambda '($87 $88) (AsStruct '('"key_list" $87) '('"name" $88)))))) '('('"_logical_id" '2330) '('"_id" '"1bef2450-a63cfb12-14f21722-ab98bdd7"))))
(let $17 '($6 $10 $14 $16))
(let $18 (DqCnResult (TDqOutput $16 '0) '('"key_list" '"name")))
(return (KqpPhysicalQuery '((KqpPhysicalTx $17 '($18) '() '('('"type" '"generic")))) '((KqpTxResultBinding (ListType $12) '0 '0)) '('('"type" '"query"))))
)
