(
(let $1 (DataType 'String))
(let $2 (StructType '('"key" $1) '('"subkey" $1) '('"value" $1)))
(let $3 '('('"_logical_id" '733) '('"_id" '"86bada4b-b8b9115b-58dbf978-dfe0d05c") '('"_wide_channels" $2)))
(let $4 (DqPhyStage '() (lambda '() (block '(
  (let $8 '@@["StructType";[["key";["DataType";"String"]];["subkey";["DataType";"String"]];["value";["DataType";"String"]]]]@@)
  (let $9 (YqlRowSpec '('NativeYtTypeFlags '0) '('StrictSchema '1) '('UniqueKeys '0) '('Type $8)))
  (let $10 (YtMeta '('CanWrite '1) '('DoesExist '1) '('YqlCompatibleScheme '1) '('InferredScheme '0) '('IsDynamic '0) '('Attrs '('('"native_strict_schema" '"false")))))
  (let $11 (YtStat '('Id '"Input") '('RecordsCount '"9") '('DataSize '"369") '('ChunkCount '1) '('ModifyTime '0) '('Revision '0)))
  (let $12 (YtTable '"Input" $9 $10 $11 '() (Void) (Void) '"/Root/plato"))
  (let $13 '('"key" '"subkey" '"value"))
  (let $14 (YtReadTable! world (DataSource '"yt" '"/Root/plato") '((YtSection '((YtPath $12 $13 (Void) (Void))) '()))))
  (return (FromFlow (DqReadWideWrap $14 '())))
))) $3))
(let $5 (DqCnUnionAll (TDqOutput $4 '0)))
(let $6 (DqPhyStage '($5) (lambda '($15) (block '(
  (let $16 (Bool 'true))
  (let $17 (Sort (NarrowMap (ToFlow $15) (lambda '($18 $19 $20) (block '(
    (let $21 (DataType 'Double))
    (let $22 (OptionalType $21))
    (let $23 (lambda '($27) (block '(
      (let $28 '($21 '"" '1))
      (let $29 (CallableType '() '($21) $28 $28))
      (let $30 (Udf '"Math.Pow" (Void) (VoidType) '"" $29 (VoidType) '"" '('('"strict"))))
      (return (Just (Apply $30 $27 (Convert (Int32 '"2") $21))))
    ))))
    (let $24 (Nothing $22))
    (let $25 (IfPresent (SafeCast $19 $22) $23 $24))
    (let $26 (IfPresent (SafeCast $18 $22) $23 $24))
    (return (AsStruct '('_yql_sys_order_by_0 $25) '('_yql_sys_order_by_1 $26) '('"key" $18) '('"subkey" $19) '('"value" $20)))
  )))) '($16 $16) (lambda '($31) '((Member $31 '_yql_sys_order_by_0) (Member $31 '_yql_sys_order_by_1)))))
  (return (FromFlow (OrderedMap $17 (lambda '($32) (AsStruct '('"key" (Member $32 '"key")) '('"subkey" (Member $32 '"subkey")) '('"value" (Member $32 '"value")))))))
))) '('('"_logical_id" '772) '('"_id" '"12945400-b9f26522-30fbd895-1f8e8411"))))
(let $7 (DqCnResult (TDqOutput $6 '0) '()))
(return (KqpPhysicalQuery '((KqpPhysicalTx '($4 $6) '($7) '() '('('"type" '"generic")))) '((KqpTxResultBinding (ListType $2) '0 '0)) '('('"type" '"query"))))
)
