(
(let $1 (DataType 'Uint64))
(let $2 (DataType 'String))
(let $3 '('"a" $2))
(let $4 (StructType '('_yql_agg_0 $1) $3 '('"b" $2)))
(let $5 '('('"_logical_id" '7100) '('"_id" '"7017ecb7-e77ff4b2-a24250b7-4fd328dd") '('"_wide_channels" $4)))
(let $6 (DqPhyStage '() (lambda '() (block '(
  (let $19 '@@["StructType";[["a";["DataType";"String"]];["b";["DataType";"String"]];["c";["DataType";"String"]];["d";["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 '"Input") '('RecordsCount '"4") '('DataSize '"140") '('ChunkCount '1) '('ModifyTime '0) '('Revision '0)))
  (let $23 (YtTable '"Input" $20 $21 $22 '() (Void) (Void) '"/Root/plato"))
  (let $24 (YtReadTable! world (DataSource '"yt" '"/Root/plato") '((YtSection '((YtPath $23 '('"a" '"b") (Void) (Void))) '()))))
  (let $25 (lambda '($27 $28) $27 $28))
  (let $26 (lambda '($38 $39 $40) $40 $38 $39))
  (return (DqPhyHashCombine (WideToBlocks (FromFlow (DqReadWideWrap $24 '()))) '-1073741824 $25 (lambda '($29 $30 $31 $32) (Uint64 '1)) (lambda '($33 $34 $35 $36 $37) $37) $26))
))) $5))
(let $7 (DqCnHashShuffle (TDqOutput $6 '0) '('1 '"2") '0 '"HashV2"))
(let $8 '('Auto 'Many))
(let $9 '('('"_logical_id" '7186) '('"_id" '"2ca52648-fac63f73-9f71d11f-34d74ff5") '('"_partition_mode" '"aggregate") '('"_wide_channels" (StructType '('_yql_agg_0 (OptionalType $1)) $3))))
(let $10 (DqPhyStage '($7) (lambda '($41) (block '(
  (let $42 (NarrowSqueezeToDict (ToFlow (WideFromBlocks $41)) (lambda '($45 $46 $47) '($46 $47)) (lambda '($48 $49 $50) (AsStruct '('_yql_agg_0 $48) '('"a" $49) '('"b" $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 '"a") (Member $55 '"a")) (AggrNotEquals (Member $54 '"b") (Member $55 '"b")))) (lambda '($56 $57) $56)))
  (let $44 (lambda '($58) (Just (Member $58 '_yql_agg_0)) (Member $58 '"a")))
  (return (FromFlow (ExpandMap $43 $44)))
))) $9))
(let $11 (DqCnHashShuffle (TDqOutput $10 '0) '('1) '0 '"HashV2"))
(let $12 (StructType $3 '('"bb" $1)))
(let $13 '('('"_logical_id" '7601) '('"_id" '"90abb64e-38b2bd79-306dfee0-a57b60ef") '('"_wide_channels" $12)))
(let $14 (DqPhyStage '($11) (lambda '($59) (block '(
  (let $60 (NarrowSqueezeToDict (ToFlow $59) (lambda '($64 $65) $65) (lambda '($66 $67) (AsStruct '('_yql_agg_0 $66) '('"a" $67))) $8))
  (let $61 (Condense1 (OrderedFlatMap $60 (lambda '($68) (OrderedFlatMap (DictPayloads $68) (lambda '($69) $69)))) (lambda '($70) $70) (lambda '($71 $72) (AggrNotEquals (Member $71 '"a") (Member $72 '"a"))) (lambda '($73 $74) (block '(
    (let $75 (Member $73 '_yql_agg_0))
    (let $76 (Member $74 '_yql_agg_0))
    (let $77 (IfPresent $75 (lambda '($78) (IfPresent $76 (lambda '($79) (Just (AggrAdd $78 $79))) $75)) $76))
    (return (AsStruct '('_yql_agg_0 $77) '('"a" (Member $74 '"a"))))
  )))))
  (let $62 (Sort (Map $61 (lambda '($80) (AsStruct '('"a" (Member $80 '"a")) '('"bb" (Unwrap (Member $80 '_yql_agg_0)))))) (Bool 'true) (lambda '($81) (Member $81 '"a"))))
  (let $63 (lambda '($82) (Member $82 '"a") (Member $82 '"bb")))
  (return (FromFlow (ExpandMap $62 $63)))
))) $13))
(let $15 (DqCnMerge (TDqOutput $14 '0) '('('0 '"Asc"))))
(let $16 (DqPhyStage '($15) (lambda '($83) (FromFlow (NarrowMap (ToFlow $83) (lambda '($84 $85) (AsStruct '('"a" $84) '('"bb" $85)))))) '('('"_logical_id" '7613) '('"_id" '"e5cbd619-77d64d98-74c314a6-3aa8cd8c"))))
(let $17 '($6 $10 $14 $16))
(let $18 (DqCnResult (TDqOutput $16 '0) '('"a" '"bb")))
(return (KqpPhysicalQuery '((KqpPhysicalTx $17 '($18) '() '('('"type" '"generic")))) '((KqpTxResultBinding (ListType $12) '0 '0)) '('('"type" '"query"))))
)
