(
(let $1 (Bool 'true))
(let $2 (DataType 'String))
(let $3 '('key $2))
(let $4 (StructType $3 '('"subkey" $2) '('"value" $2)))
(let $5 '('"_wide_channels" $4))
(let $6 '('('"_logical_id" '1105) '('"_id" '"6f65902d-396d1fef-78f6f5f9-ae21d4a8") $5))
(let $7 (DqPhyStage '() (lambda '() (block '(
  (let $21 '@@["StructType";[["key";["DataType";"String"]];["subkey";["DataType";"String"]];["value";["DataType";"String"]]]]@@)
  (let $22 (YqlRowSpec '('NativeYtTypeFlags '0) '('StrictSchema '1) '('UniqueKeys '0) '('Type $21)))
  (let $23 (YtMeta '('CanWrite '1) '('DoesExist '1) '('YqlCompatibleScheme '1) '('InferredScheme '0) '('IsDynamic '0) '('Attrs '('('"native_strict_schema" '"false")))))
  (let $24 (YtStat '('Id '"Input") '('RecordsCount '"10") '('DataSize '"420") '('ChunkCount '1) '('ModifyTime '0) '('Revision '0)))
  (let $25 (YtTable '"Input" $22 $23 $24 '() (Void) (Void) '"/Root/plato"))
  (let $26 '('key '"subkey" '"value"))
  (let $27 (YtReadTable! world (DataSource '"yt" '"/Root/plato") '((YtSection '((YtPath $25 $26 (Void) (Void))) '()))))
  (return (FromFlow (WideSort (DqReadWideWrap $27 '()) '('('0 $1) '('1 $1)))))
))) $6))
(let $8 '('0 '"Asc"))
(let $9 (DqCnMerge (TDqOutput $7 '0) '($8 '('1 '"Asc"))))
(let $10 '('('"_logical_id" '1117) '('"_id" '"452fe300-45238477-969adc81-b45f10f7") $5))
(let $11 (DqPhyStage '($9) (lambda '($28) $28) $10))
(let $12 (DqCnHashShuffle (TDqOutput $11 '0) '('0) '0 '"HashV2"))
(let $13 (OptionalType $2))
(let $14 (StructType $3 '('summ (ListType $13))))
(let $15 '('('"_logical_id" '1510) '('"_id" '"2257e865-ed065cdc-513015b4-a9722c01") '('"_wide_channels" $14)))
(let $16 (DqPhyStage '($12) (lambda '($29) (block '(
  (let $30 (NarrowSqueezeToDict (ToFlow $29) (lambda '($34 $35 $36) $34) (lambda '($37 $38 $39) (AsStruct '('key $37) '('"subkey" $38) '('"value" $39))) '('Auto 'Many)))
  (let $31 (Chopper (OrderedFlatMap $30 (lambda '($40) (OrderedFlatMap (DictPayloads $40) (lambda '($41) $41)))) (lambda '($42) (Member $42 'key)) (lambda '($43 $44) (AggrNotEquals $43 (Member $44 'key))) (lambda '($45 $46) (ToFlow (Just (AsStruct '('key $45) '('summ (Collect (Condense $46 (Nothing $13) (lambda '($47 $48) (Bool '"false")) (lambda '($49 $50) (Coalesce $50 (Just (Member $49 '"value")))))))))))))
  (let $32 (Sort $31 $1 (lambda '($51) (Member $51 'key))))
  (let $33 (lambda '($52) (Member $52 'key) (Member $52 'summ)))
  (return (FromFlow (ExpandMap $32 $33)))
))) $15))
(let $17 (DqCnMerge (TDqOutput $16 '0) '($8)))
(let $18 (DqPhyStage '($17) (lambda '($53) (FromFlow (NarrowMap (ToFlow $53) (lambda '($54 $55) (AsStruct '('key $54) '('summ $55)))))) '('('"_logical_id" '1522) '('"_id" '"47becb22-a977d582-39818b19-d1340240"))))
(let $19 '($7 $11 $16 $18))
(let $20 (DqCnResult (TDqOutput $18 '0) '()))
(return (KqpPhysicalQuery '((KqpPhysicalTx $19 '($20) '() '('('"type" '"generic")))) '((KqpTxResultBinding (ListType $14) '0 '0)) '('('"type" '"query"))))
)
