(
(let $1 (DataType 'String))
(let $2 (lambda '($39) (Member $39 '_yql_agg_0) (Member $39 '"id")))
(let $3 (lambda '($40 $41) (AsStruct '('_yql_agg_0 $40) '('"id" $41))))
(let $4 (ListType (ListType $1)))
(let $5 '('"id" $1))
(let $6 '('('"_logical_id" '1480) '('"_id" '"64b74a28-6d50b0ce-12283611-6cdb3c11") '('"_wide_channels" (StructType '('_yql_agg_0 $4) $5))))
(let $7 (DqPhyStage '() (lambda '() (block '(
  (let $15 '@@["StructType";[["counters";["ListType";["DataType";"Int64"]]];["names";["ListType";["DataType";"String"]]];["id";["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 '"2") '('DataSize '"102") '('ChunkCount '1) '('ModifyTime '0) '('Revision '0)))
  (let $19 (YtTable '"Input" $16 $17 $18 '() (Void) (Void) '"/Root/plato"))
  (let $20 '('"counters" '"id" '"names"))
  (let $21 (YtReadTable! world (DataSource '"yt" '"/Root/plato") '((YtSection '((YtPath $19 $20 (Void) (Void))) '()))))
  (let $22 (CombineCore (NarrowMap (DqReadWideWrap $21 '()) (lambda '($23 $24 $25) (block '(
    (let $26 (AsStruct '('"counters" $23) '('"id" $24) '('"names" $25)))
    (let $27 (FoldMap (Member $26 '"counters") (Member $26 '"names") (lambda '($28 $29) '((Unwrap (IfPresent (SafeCast $28 (OptionalType (DataType 'Uint64))) (lambda '($30) (Lookup (ToIndexDict $29) $30)) (Nothing (OptionalType $1)))) $29))))
    (return (AsStruct '('"id" (Member $26 '"id")) '('"profile" $27)))
  )))) (lambda '($31) (Member $31 '"id")) (lambda '($32 $33) (AsStruct '('_yql_agg_0 (AsList (Member $33 '"profile"))))) (lambda '($34 $35 $36) (AsStruct '('_yql_agg_0 (Insert (Member $36 '_yql_agg_0) (Member $35 '"profile"))))) (lambda '($37 $38) (Just (AsStruct '('_yql_agg_0 (Member $38 '_yql_agg_0)) '('"id" $37)))) '0))
  (return (FromFlow (ExpandMap (NarrowMap (ExpandMap $22 $2) $3) $2)))
))) $6))
(let $8 (DqCnHashShuffle (TDqOutput $7 '0) '('1) '0 '"HashV2"))
(let $9 '('('"_logical_id" '1964) '('"_id" '"56d0f4c5-6ae545ef-12a54790-40e2d52e") '('"_partition_mode" '"aggregate")))
(let $10 (DqPhyStage '($8) (lambda '($42) (block '(
  (let $43 (lambda '($48 $49 $50) $49 $50))
  (let $44 (lambda '($51 $52 $53 $54 $55) (Extend $52 $54) $55))
  (let $45 (WideCombiner (ExpandMap (NarrowMap (ToFlow $42) $3) $2) '"" (lambda '($46 $47) $47) $43 $44 $43))
  (return (FromFlow (NarrowMap $45 (lambda '($56 $57) (block '(
    (let $58 (AsStruct '('AggregateList0 $56) '('"id" $57)))
    (return (AsStruct '('"id" (Member $58 '"id")) '('"profiles" (Member $58 'AggregateList0))))
  ))))))
))) $9))
(let $11 (DqCnUnionAll (TDqOutput $10 '0)))
(let $12 (DqPhyStage '($11) (lambda '($59) $59) '('('"_logical_id" '2150) '('"_id" '"87a0410a-d75cdae3-7b7d0028-5d3e099d"))))
(let $13 '($7 $10 $12))
(let $14 (DqCnResult (TDqOutput $12 '0) '('"profiles" '"id")))
(return (KqpPhysicalQuery '((KqpPhysicalTx $13 '($14) '() '('('"type" '"generic")))) '((KqpTxResultBinding (ListType (StructType $5 '('"profiles" $4))) '0 '0)) '('('"type" '"query"))))
)
