(
(let $1 (DataSource '"yt" '"/Root/plato"))
(let $2 '('NativeYtTypeFlags '0))
(let $3 '('StrictSchema '1))
(let $4 '@@["StructType";[["key";["DataType";"String"]];["subkey";["DataType";"String"]];["value";["DataType";"String"]]]]@@)
(let $5 '('Type $4))
(let $6 (YtMeta '('CanWrite '1) '('DoesExist '1) '('YqlCompatibleScheme '1) '('InferredScheme '0) '('IsDynamic '0) '('Attrs '('('"native_strict_schema" '"false")))))
(let $7 '('ChunkCount '1))
(let $8 '('ModifyTime '0))
(let $9 '('Revision '0))
(let $10 '('"key" '"subkey" '"value"))
(let $11 (DataType 'String))
(let $12 (OptionalType $11))
(let $13 (StructType '('"key" $11) '('"sk" $12) '('"val" $11)))
(let $14 '('('"_logical_id" '1330) '('"_id" '"9c83d69e-227ad785-775ce0bb-7cfc9567") '('"_wide_channels" $13)))
(let $15 (DqPhyStage '() (lambda '() (block '(
  (let $24 (YqlRowSpec $2 $3 '('UniqueKeys '0) $5))
  (let $25 (YtStat '('Id '"Unsorted") '('RecordsCount '4) '('DataSize '"166") $7 $8 $9))
  (let $26 (YtTable '"Unsorted" $24 $6 $25 '() (Void) (Void) '"/Root/plato"))
  (let $27 (YtReadTable! world $1 '((YtSection '((YtPath $26 $10 (Void) (Void))) '()))))
  (let $28 (lambda '($29 $30 $31) (block '(
    (let $32 (IfPresent (+ (SafeCast $30 (OptionalType (DataType 'Int32))) (Int32 '2)) (lambda '($33) (Just (SafeCast $33 $11))) (Nothing $12)))
    (return $29 $32 $31)
  ))))
  (return (FromFlow (WideMap (DqReadWideWrap $27 '()) $28)))
))) $14))
(let $16 (DqCnBroadcast (TDqOutput $15 '0)))
(let $17 (StructType '('"a.key" $11) '('"a.subkey" $11) '('"a.value" $11) '('"b.key" $11) '('"b.sk" $12) '('"b.val" $11)))
(let $18 '('('"_logical_id" '1430) '('"_id" '"58f6596a-1f80f08a-24a7bfe2-37ef644e") '('"_wide_channels" $17)))
(let $19 (DqPhyStage '($16) (lambda '($34) (block '(
  (let $35 '('Many 'Hashed 'Compact))
  (let $36 (SqueezeToDict (NarrowFlatMap (WideFilter (ToFlow $34) (lambda '($38 $39 $40) (Exists $39))) (lambda '($41 $42 $43) (IfPresent (FilterNullElements (Just '($42 $43)) '('0)) (lambda '($44) (block '(
    (let $45 (AsStruct '('"key" $41) '('"sk" $42) '('"val" $43)))
    (return (Just '($44 $45)))
  ))) (Nothing (OptionalType (TupleType (TupleType $11 $11) $13)))))) (lambda '($46) (Nth $46 '0)) (lambda '($47) (Nth $47 '1)) $35))
  (let $37 (Bool 'true))
  (return (FromFlow (WideSort (FlatMap $36 (lambda '($48) (block '(
    (let $49 '"SortedBySubkeyValue")
    (let $50 '('"subkey" '"value"))
    (let $51 (YqlRowSpec $2 $3 '('UniqueKeys '1) $5 '('SortDirections '($37 $37)) '('SortMembers $50) '('SortedBy $50) '('SortedByTypes '($11 $11))))
    (let $52 (YtStat '('Id $49) '('RecordsCount '"14") '('DataSize '"608") $7 $8 $9))
    (let $53 (YtTable $49 $51 $6 $52 '() (Void) (Void) '"/Root/plato"))
    (let $54 (YtReadTable! world $1 '((YtSection '((YtPath $53 $10 (Void) (Void))) '()))))
    (let $55 '('0 '0 '1 '1 '2 '2))
    (let $56 '('"key" '3 '"sk" '4 '"val" '5))
    (return (MapJoinCore (DqReadWideWrap $54 '()) $48 'Inner '('1 '2) '('"sk" '"val") $55 $56 '('"a.subkey" '"a.value") '('"b.sk" '"b.val")))
  )))) '('('0 $37) '('3 $37)))))
))) $18))
(let $20 (DqCnMerge (TDqOutput $19 '0) '('('0 '"Asc") '('3 '"Asc"))))
(let $21 (DqPhyStage '($20) (lambda '($57) (FromFlow (NarrowMap (ToFlow $57) (lambda '($58 $59 $60 $61 $62 $63) (AsStruct '('"a.key" $58) '('"a.subkey" $59) '('"a.value" $60) '('"b.key" $61) '('"b.sk" $62) '('"b.val" $63)))))) '('('"_logical_id" '1442) '('"_id" '"90865717-bd891bf4-db5cb0a3-a502e618"))))
(let $22 '($15 $19 $21))
(let $23 (DqCnResult (TDqOutput $21 '0) '()))
(return (KqpPhysicalQuery '((KqpPhysicalTx $22 '($23) '() '('('"type" '"generic")))) '((KqpTxResultBinding (ListType $17) '0 '0)) '('('"type" '"query"))))
)
