(
(let $1 (OptionalType (DataType 'Int32)))
(let $2 (lambda '() (block '(
  (let $30 '@@["StructType";[["key";["DataType";"String"]];["subkey";["DataType";"String"]];["value";["DataType";"String"]]]]@@)
  (let $31 (YqlRowSpec '('NativeYtTypeFlags '0) '('StrictSchema '1) '('UniqueKeys '0) '('Type $30)))
  (let $32 (YtMeta '('CanWrite '1) '('DoesExist '1) '('YqlCompatibleScheme '1) '('InferredScheme '0) '('IsDynamic '0) '('Attrs '('('"native_strict_schema" 'false)))))
  (let $33 (YtStat '('Id '"Input1") '('RecordsCount '"4") '('DataSize '"166") '('ChunkCount '1) '('ModifyTime '0) '('Revision '0)))
  (let $34 (YtTable '"Input1" $31 $32 $33 '() (Void) (Void) '"/Root/plato"))
  (let $35 (YtReadTable! world (DataSource '"yt" '"/Root/plato") '((YtSection '((YtPath $34 '('"subkey") (Void) (Void))) '()))))
  (return (FromFlow (WideMap (DqReadWideWrap $35 '()) (lambda '($36) (SafeCast $36 $1)))))
))))
(let $3 '('"_logical_id" '2110))
(let $4 '('"_wide_channels" (StructType '('"v1" $1))))
(let $5 '($3 '('"_id" '"cb74a3e8-5ef9043c-daa9f271-bcc3fcfb") $4))
(let $6 (DqPhyStage '() $2 $5))
(let $7 (DqCnUnionAll (TDqOutput $6 '0)))
(let $8 (lambda '($37) $37))
(let $9 '('('"_logical_id" '2172) '('"_id" '"5400e023-24a1d448-9aeab287-923f09b6") $4))
(let $10 (DqPhyStage '($7) $8 $9))
(let $11 '('"_wide_channels" (StructType '('"v2" $1))))
(let $12 '($3 '('"_id" '"8ff97bdd-20179dfb-27d4a0da-c2b023e5") $11))
(let $13 (DqPhyStage '() $2 $12))
(let $14 (DqCnUnionAll (TDqOutput $13 '0)))
(let $15 '('('"_logical_id" '2159) '('"_id" '"460ceb1e-c9f70164-7df2d623-94a4b64f") $11))
(let $16 (DqPhyStage '($14) $8 $15))
(let $17 '('0))
(let $18 (DqCnHashShuffle (TDqOutput $10 '0) $17 '0 '"HashV2"))
(let $19 (DqCnHashShuffle (TDqOutput $16 '0) $17 '0 '"HashV2"))
(let $20 (Uint64 '1))
(let $21 (Bool 'false))
(let $22 (lambda '($57) $57))
(let $23 (DataType 'Uint64))
(let $24 '('('"_logical_id" '2308) '('"_id" '"87bf0ece-db9ad543-6803fb40-56eb605a") '('"_wide_channels" (StructType '('_yql_agg_0 $23)))))
(let $25 (DqPhyStage '($18 $19) (lambda '($38 $39) (block '(
  (let $40 (lambda '($44) $44))
  (let $41 '('Many 'Hashed 'Compact))
  (let $42 (NarrowSqueezeToDict (ToFlow $38) $40 (lambda '($45) (AsStruct '('"v1" $45))) $41))
  (let $43 (Condense1 (FlatMap $42 (lambda '($46) (block '(
    (let $47 (NarrowSqueezeToDict (ToFlow $39) $40 (lambda '($48) (AsStruct '('"v2" $48))) $41))
    (return (FlatMap $47 (lambda '($49) (block '(
      (let $50 (JoinDict $46 $49 'Full '()))
      (return (Map $50 (lambda '($51) (AsStruct))))
    )))))
  )))) (lambda '($52) $20) (lambda '($53 $54) $21) (lambda '($55 $56) (AggrAdd $56 $20))))
  (return (FromFlow (ExpandMap $43 $22)))
))) $24))
(let $26 (DqCnUnionAll (TDqOutput $25 '0)))
(let $27 (DqPhyStage '($26) (lambda '($58) (block '(
  (let $59 (WideCondense1 (ToFlow $58) $22 (lambda '($61 $62) $21) (lambda '($63 $64) (AggrAdd $63 $64))))
  (let $60 (Condense (NarrowMap (Take $59 $20) (lambda '($65) (AsStruct '('Count0 $65)))) (Nothing (OptionalType (StructType '('Count0 $23)))) (lambda '($66 $67) $21) (lambda '($68 $69) (Just $68))))
  (return (FromFlow (Map $60 (lambda '($70) (AsStruct '('"column0" (Coalesce (Member $70 'Count0) (Uint64 '0))))))))
))) '('('"_logical_id" '2707) '('"_id" '"9e8340e0-f890e4b8-eb5073a3-1a3542b9"))))
(let $28 '($6 $10 $13 $16 $25 $27))
(let $29 (DqCnResult (TDqOutput $27 '0) '('"column0")))
(return (KqpPhysicalQuery '((KqpPhysicalTx $28 '($29) '() '('('"type" '"generic")))) '((KqpTxResultBinding (ListType (StructType '('"column0" $23))) '0 '0)) '('('"type" '"query"))))
)
