(
(let $1 (PgType 'int4))
(let $2 (DataType 'Int32))
(let $3 (OptionalType (OptionalType $2)))
(let $4 (TupleType $2 $2 $3))
(let $5 (OptionalType $1))
(let $6 (StructType '('"double_tuple" (OptionalType (OptionalType (OptionalType $4)))) '('"k" (DataType 'String)) '('"nested_opt" $3) '('"nested_opt_pg" (OptionalType $5)) '('"opt_pg" $5) '('"pg" $1) '('"tuple" $4)))
(let $7 '('('"_logical_id" '777) '('"_id" '"c5a41e35-4f3d67d1-d88a03ca-b980025") '('"_wide_channels" $6)))
(let $8 (DqPhyStage '() (lambda '() (block '(
  (let $13 '@@["StructType";[["key";["DataType";"String"]];["subkey";["DataType";"String"]];["value";["DataType";"String"]]]]@@)
  (let $14 (YqlRowSpec '('NativeYtTypeFlags '0) '('StrictSchema '1) '('UniqueKeys '0) '('Type $13)))
  (let $15 (YtMeta '('CanWrite '1) '('DoesExist '1) '('YqlCompatibleScheme '1) '('InferredScheme '0) '('IsDynamic '0) '('Attrs '('('"native_strict_schema" '"false")))))
  (let $16 (YtStat '('Id '"Input") '('RecordsCount '"10") '('DataSize '"420") '('ChunkCount '1) '('ModifyTime '0) '('Revision '0)))
  (let $17 (YtTable '"Input" $14 $15 $16 '() (Void) (Void) '"/Root/plato"))
  (let $18 (YtReadTable! world (DataSource '"yt" '"/Root/plato") '((YtSection '((YtPath $17 '('"key" '"subkey") (Void) (Void))) '()))))
  (let $19 (Sort (NarrowMap (DqReadWideWrap $18 '()) (lambda '($21 $22) (block '(
    (let $23 (Int32 '1))
    (let $24 (Int32 '"2"))
    (let $25 '($23 $24 (Just (Just $24))))
    (let $26 (Just (PgConst '1 $1)))
    (return (AsStruct '('"double_tuple" (Just (Just (Just $25)))) '('"k" (Concat $22 $21)) '('"nested_opt" (Just (Just $23))) '('"nested_opt_pg" (Just $26)) '('"opt_pg" $26) '('"pg" (PgConst '"2" $1)) '('"tuple" $25)))
  )))) (Bool 'true) (lambda '($27) (Member $27 '"k"))))
  (let $20 (lambda '($28) (Member $28 '"double_tuple") (Member $28 '"k") (Member $28 '"nested_opt") (Member $28 '"nested_opt_pg") (Member $28 '"opt_pg") (Member $28 '"pg") (Member $28 '"tuple")))
  (return (FromFlow (ExpandMap $19 $20)))
))) $7))
(let $9 (DqCnMerge (TDqOutput $8 '0) '('('1 '"Asc"))))
(let $10 (DqPhyStage '($9) (lambda '($29) (FromFlow (NarrowMap (ToFlow $29) (lambda '($30 $31 $32 $33 $34 $35 $36) (AsStruct '('"double_tuple" $30) '('"k" $31) '('"nested_opt" $32) '('"nested_opt_pg" $33) '('"opt_pg" $34) '('"pg" $35) '('"tuple" $36)))))) '('('"_logical_id" '789) '('"_id" '"1aae744b-cc31e93e-f8fe98ac-6be258ac"))))
(let $11 '('"k" '"nested_opt" '"opt_pg" '"nested_opt_pg" '"pg" '"tuple" '"double_tuple"))
(let $12 (DqCnResult (TDqOutput $10 '0) $11))
(return (KqpPhysicalQuery '((KqpPhysicalTx '($8 $10) '($12) '() '('('"type" '"generic")))) '((KqpTxResultBinding (ListType $6) '0 '0)) '('('"type" '"query"))))
)
