(
(let $1 (OptionalType (DataType 'Int64)))
(let $2 (StructType '('_yql_agg_0 $1) '('_yql_agg_1 $1) '('"a" (OptionalType (DataType 'String))) '('"b" (OptionalType (DataType 'Uint64)))))
(let $3 '('('"_logical_id" '1758) '('"_id" '"72564059-c2aba795-611632d1-630ce980") '('"_wide_channels" $2)))
(let $4 (DqPhyStage '() (lambda '() (block '(
  (let $13 '@@["StructType";[["a";["OptionalType";["DataType";"String"]]];["b";["OptionalType";["DataType";"Uint64"]]];["c";["OptionalType";["DataType";"Int64"]]];["d";["OptionalType";["DataType";"Int64"]]]]]@@)
  (let $14 (YqlRowSpec '('NativeYtTypeFlags '0) '('StrictSchema '1) '('UniqueKeys '0) '('Type $13)))
  (let $15 (YtMeta '('CanWrite '1) '('DoesExist '1) '('YqlCompatibleScheme '1) '('InferredScheme '0) '('IsDynamic '0) '('Attrs '('('"native_strict_schema" '"false")))))
  (let $16 (YtStat '('Id '"Input") '('RecordsCount '"8") '('DataSize '"296") '('ChunkCount '1) '('ModifyTime '0) '('Revision '0)))
  (let $17 (YtTable '"Input" $14 $15 $16 '() (Void) (Void) '"/Root/plato"))
  (let $18 '('"a" '"b" '"c" '"d"))
  (let $19 (YtReadTable! world (DataSource '"yt" '"/Root/plato") '((YtSection '((YtPath $17 $18 (Void) (Void))) '()))))
  (let $20 (lambda '($24 $25 $26 $27) $24 $25))
  (let $21 (lambda '($28 $29 $30 $31 $32 $33) $33 $32))
  (let $22 (lambda '($34 $35 $36 $37 $38 $39 $40 $41) (AggrMax $39 $40) (AggrAdd $38 $41)))
  (let $23 (lambda '($42 $43 $44 $45) $44 $45 $42 $43))
  (return (DqPhyHashCombine (WideToBlocks (FromFlow (DqReadWideWrap $19 '()))) '-1073741824 $20 $21 $22 $23))
))) $3))
(let $5 (DqCnHashShuffle (TDqOutput $4 '0) '('"2" '"3") '0 '"HashV2"))
(let $6 (StructType '('"max_d" $1) '('"sum_c" $1)))
(let $7 '('('"_logical_id" '2142) '('"_id" '"95845802-adb5111d-37dc81a5-e49e8e8") '('"_wide_channels" $6)))
(let $8 (DqPhyStage '($5) (lambda '($46) (block '(
  (let $47 (NarrowSqueezeToDict (ToFlow (WideFromBlocks $46)) (lambda '($52 $53 $54 $55) '($54 $55)) (lambda '($56 $57 $58 $59) (AsStruct '('_yql_agg_0 $56) '('_yql_agg_1 $57) '('"a" $58) '('"b" $59))) '('Auto 'Many)))
  (let $48 (Condense1 (OrderedFlatMap $47 (lambda '($60) (OrderedFlatMap (DictPayloads $60) (lambda '($61) $61)))) (lambda '($62) $62) (lambda '($63 $64) (Or (AggrNotEquals (Member $63 '"a") (Member $64 '"a")) (AggrNotEquals (Member $63 '"b") (Member $64 '"b")))) (lambda '($65 $66) (AsStruct '('_yql_agg_0 (AggrMax (Member $65 '_yql_agg_0) (Member $66 '_yql_agg_0))) '('_yql_agg_1 (AggrAdd (Member $65 '_yql_agg_1) (Member $66 '_yql_agg_1))) '('"a" (Member $66 '"a")) '('"b" (Member $66 '"b"))))))
  (let $49 (Bool 'true))
  (let $50 (Sort (Map $48 (lambda '($67) (AsStruct '('"max_d" (Member $67 '_yql_agg_0)) '('"sum_c" (Member $67 '_yql_agg_1))))) '($49 $49) (lambda '($68) '((Member $68 '"sum_c") (Member $68 '"max_d")))))
  (let $51 (lambda '($69) (Member $69 '"max_d") (Member $69 '"sum_c")))
  (return (FromFlow (ExpandMap $50 $51)))
))) $7))
(let $9 (DqCnMerge (TDqOutput $8 '0) '('('1 '"Asc") '('0 '"Asc"))))
(let $10 (DqPhyStage '($9) (lambda '($70) (FromFlow (NarrowMap (ToFlow $70) (lambda '($71 $72) (AsStruct '('"max_d" $71) '('"sum_c" $72)))))) '('('"_logical_id" '2154) '('"_id" '"d986c955-e06f1ada-62a43f30-c9a27117"))))
(let $11 '($4 $8 $10))
(let $12 (DqCnResult (TDqOutput $10 '0) '('"sum_c" '"max_d")))
(return (KqpPhysicalQuery '((KqpPhysicalTx $11 '($12) '() '('('"type" '"generic")))) '((KqpTxResultBinding (ListType $6) '0 '0)) '('('"type" '"query"))))
)
