(
(let $1 (DataType 'Utf8))
(let $2 (StructType '('"key" $1) '('"key1" $1) '('"subkey" $1) '('"subkey1" $1) '('"value" $1)))
(let $3 '('('"_logical_id" '2592) '('"_id" '"5d9fa00-e8dd2750-f6cee3d1-a75c8d2b") '('"_wide_channels" $2)))
(let $4 (DqPhyStage '() (lambda '() (block '(
  (let $8 (String '1))
  (let $9 (String '"a"))
  (let $10 (AsStruct '('"key" $8) '('"key1" $8) '('"subkey" $9) '('"subkey1" $9)))
  (let $11 (String '4))
  (let $12 (String '"d"))
  (let $13 (AsStruct '('"key" $11) '('"key1" $11) '('"subkey" $12) '('"subkey1" $12)))
  (let $14 (String '"-5"))
  (let $15 (String '"e"))
  (let $16 (AsStruct '('"key" $14) '('"key1" $14) '('"subkey" $15) '('"subkey1" $15)))
  (let $17 (OptionalType (DataType 'Uint64)))
  (let $18 (DataType 'String))
  (let $19 '('0 '1))
  (let $20 '('One 'Hashed 'Compact))
  (let $21 (SqueezeToDict (FlatMap (ToFlow (AsList $10 $13 $16)) (lambda '($22) (block '(
    (let $23 (OptionalType (DataType 'Int64)))
    (let $24 (OptionalType $1))
    (let $25 (lambda '($29) (Just (SafeCast $29 $18))))
    (let $26 (Nothing (OptionalType $18)))
    (let $27 (IfPresent (SafeCast (Member $22 '"subkey") $24) $25 $26))
    (let $28 (IfPresent (SafeCast (Member $22 '"subkey1") $24) $25 $26))
    (return (FilterNullElements (Just '((FilterNullElements (Just '((SafeCast (SafeCast (Member $22 '"key") $23) $17) $27)) $19) (FilterNullElements (Just '((SafeCast (SafeCast (Member $22 '"key1") $23) $17) $28)) $19))) $19))
  )))) (lambda '($30) $30) (lambda '($31) (Void)) $20))
  (return (FromFlow (WideSort (FlatMap $21 (lambda '($32) (block '(
    (let $33 '@@["StructType";[["key1";["DataType";"Utf8"]];["subkey1";["DataType";"Utf8"]];["key";["DataType";"Utf8"]];["subkey";["DataType";"Utf8"]];["value";["DataType";"Utf8"]]]]@@)
    (let $34 (YqlRowSpec '('NativeYtTypeFlags '0) '('StrictSchema '1) '('UniqueKeys '0) '('Type $33)))
    (let $35 (YtMeta '('CanWrite '1) '('DoesExist '1) '('YqlCompatibleScheme '1) '('InferredScheme '0) '('IsDynamic '0) '('Attrs '('('"native_strict_schema" '"false")))))
    (let $36 (YtStat '('Id '"Input") '('RecordsCount '4) '('DataSize '"292") '('ChunkCount '1) '('ModifyTime '0) '('Revision '0)))
    (let $37 (YtTable '"Input" $34 $35 $36 '() (Void) (Void) '"/Root/plato"))
    (let $38 '('"key" '"key1" '"subkey" '"subkey1" '"value"))
    (let $39 (YtReadTable! world (DataSource '"yt" '"/Root/plato") '((YtSection '((YtPath $37 $38 (Void) (Void))) '()))))
    (let $40 (lambda '($42 $43 $44 $45 $46) (block '(
      (let $47 '('0))
      (return (FilterNullElements (Just '((SafeCast $42 $17) (SafeCast $44 $18))) $47) (FilterNullElements (Just '((SafeCast $43 $17) (SafeCast $45 $18))) $47) $42 $43 $44 $45 $46)
    ))))
    (let $41 '('2 '0 '3 '1 '4 '2 '5 '3 '6 '4))
    (return (MapJoinCore (WideMap (DqReadWideWrap $39 '()) $40) $32 'LeftSemi $19 '('"_equijoin_column_2" '"_equijoin_column_3") $41 '() '('"A._equijoin_column_0" '"A._equijoin_column_1") '('"B._equijoin_column_2" '"B._equijoin_column_3")))
  )))) '('('0 (Bool 'true))))))
))) $3))
(let $5 (DqCnMerge (TDqOutput $4 '0) '('('0 '"Asc"))))
(let $6 (DqPhyStage '($5) (lambda '($48) (FromFlow (NarrowMap (ToFlow $48) (lambda '($49 $50 $51 $52 $53) (AsStruct '('"key" $49) '('"key1" $50) '('"subkey" $51) '('"subkey1" $52) '('"value" $53)))))) '('('"_logical_id" '2604) '('"_id" '"9886210e-f38021f7-c9e4f1ed-99899e0"))))
(let $7 (DqCnResult (TDqOutput $6 '0) '()))
(return (KqpPhysicalQuery '((KqpPhysicalTx '($4 $6) '($7) '() '('('"type" '"generic")))) '((KqpTxResultBinding (ListType $2) '0 '0)) '('('"type" '"query"))))
)
