(
(let $1 (Bool 'false))
(let $2 (lambda '($41) $41))
(let $3 (DataType 'Double))
(let $4 '('('"_logical_id" '1581) '('"_id" '"99be5308-6f7d6f9f-afa25676-64b14a17") '('"_wide_channels" (StructType '('_yql_agg_0 $3)))))
(let $5 (DqPhyStage '() (lambda '() (block '(
  (let $14 '@@["StructType";[["l_orderkey";["DataType";"Int32"]];["l_linenumber";["DataType";"Int32"]];["l_discount";["DataType";"Double"]];["l_extendedprice";["DataType";"Double"]];["l_comment";["DataType";"String"]];["l_shipdate";["OptionalType";["DataType";"Date"]]];["l_returnflag";["DataType";"String"]];["l_partkey";["DataType";"Int32"]];["l_tax";["DataType";"Double"]];["l_shipinstruct";["DataType";"String"]];["l_commitdate";["OptionalType";["DataType";"Date"]]];["l_receiptdate";["OptionalType";["DataType";"Date"]]];["l_quantity";["DataType";"Double"]];["l_suppkey";["DataType";"Int32"]];["l_shipmode";["DataType";"String"]];["l_linestatus";["DataType";"String"]]]]@@)
  (let $15 (Bool 'true))
  (let $16 '('"l_orderkey" '"l_linenumber"))
  (let $17 (DataType 'Int32))
  (let $18 (YqlRowSpec '('NativeYtTypeFlags '2) '('StrictSchema '1) '('UniqueKeys '0) '('Type $14) '('SortDirections '($15 $15)) '('SortMembers $16) '('SortedBy $16) '('SortedByTypes '($17 $17))))
  (let $19 (YtMeta '('CanWrite '1) '('DoesExist '1) '('YqlCompatibleScheme '1) '('InferredScheme '0) '('IsDynamic '0)))
  (let $20 (YtStat '('Id '"lineitem") '('RecordsCount '1) '('DataSize '"343") '('ChunkCount '1) '('ModifyTime '0) '('Revision '0)))
  (let $21 (YtTable '"lineitem" $18 $19 $20 '() (Void) (Void) '"/Root/plato"))
  (let $22 '('"l_discount" '"l_extendedprice" '"l_quantity" '"l_shipdate"))
  (let $23 (YtReadTable! world (DataSource '"yt" '"/Root/plato") '((YtSection '((YtPath $21 $22 (Void) (Void))) '('('"unordered"))))))
  (let $24 (Condense1 (NarrowMap (WideFilter (DqReadWideWrap $23 '()) (lambda '($25 $26 $27 $28) (block '(
    (let $29 (DataType 'Timestamp))
    (let $30 (IfPresent $28 (lambda '($31) (Just (SafeCast $31 $29))) (Nothing (OptionalType $29))))
    (return (And (Coalesce (>= $30 (Date '"9131")) $1) (Coalesce (< $30 (Just (Date '"9496"))) $1) (>= $25 (Double '"0.060000000000000005")) (<= $25 (Double '"0.08")) (< $27 (Int32 '"25"))))
  )))) (lambda '($32 $33 $34 $35) (AsStruct '('"l_discount" $32) '('"l_extendedprice" $33)))) (lambda '($36) (* (Member $36 '"l_extendedprice") (Member $36 '"l_discount"))) (lambda '($37 $38) $1) (lambda '($39 $40) (AggrAdd (* (Member $39 '"l_extendedprice") (Member $39 '"l_discount")) $40))))
  (return (FromFlow (ExpandMap $24 $2)))
))) $4))
(let $6 (DqCnUnionAll (TDqOutput $5 '0)))
(let $7 (StructType '('Sum0 $3)))
(let $8 '('('"_logical_id" '2596) '('"_id" '"421741e-ab5965e9-da7e3fbe-3fdbf5d") '('"_partition_mode" '"aggregate") '('"_wide_channels" $7)))
(let $9 (DqPhyStage '($6) (lambda '($42) (FromFlow (WideCondense1 (ToFlow $42) $2 (lambda '($43 $44) $1) (lambda '($45 $46) (AggrAdd $45 $46))))) $8))
(let $10 (DqCnUnionAll (TDqOutput $9 '0)))
(let $11 (DqPhyStage '($10) (lambda '($47) (block '(
  (let $48 (Condense (NarrowMap (ToFlow $47) (lambda '($49) (AsStruct '('Sum0 $49)))) (List (ListType $7)) (lambda '($50 $51) $1) (lambda '($52 $53) (AsList $52))))
  (return (FromFlow (Map $48 (lambda '($54) (AsStruct '('"revenue" (Member (ToOptional $54) 'Sum0)))))))
))) '('('"_logical_id" '2650) '('"_id" '"4167c154-2a167673-ac9426d6-63abbfcf"))))
(let $12 '($5 $9 $11))
(let $13 (DqCnResult (TDqOutput $11 '0) '('"revenue")))
(return (KqpPhysicalQuery '((KqpPhysicalTx $12 '($13) '() '('('"type" '"generic")))) '((KqpTxResultBinding (ListType (StructType '('"revenue" (OptionalType $3)))) '0 '0)) '('('"type" '"query"))))
)
