(
(declare %kqp%tx_result_binding_0_0 (TupleType (ListType (TupleType (TupleType (OptionalType (DataType 'Int32)) (OptionalType (DataType 'Date32)) (OptionalType (DataType 'Int64)) (OptionalType (DataType 'Timestamp64)) (OptionalType (DataType 'Int64)) (DataType 'Int32)) (TupleType (OptionalType (DataType 'Int32)) (OptionalType (DataType 'Date32)) (OptionalType (DataType 'Int64)) (OptionalType (DataType 'Timestamp64)) (OptionalType (DataType 'Int64)) (DataType 'Int32))))))
(let $1 (DataType 'Date32))
(let $2 (OptionalType $1))
(let $3 (Int32 '0))
(let $4 (OptionalType (DataType 'Int64)))
(let $5 (OptionalType (DataType 'Timestamp64)))
(let $6 '('('"_logical_id" '3448) '('"_id" '"9fd7bdf4-ae4bd360-c459a387-a9540a8e") '('"_partition_mode" '"single")))
(let $7 (DqPhyStage '() (lambda '() (block '(
  (let $29 (Uint64 '10000))
  (let $30 (Int32 '1))
  (let $31 '((Just (Int32 '"62")) $30))
  (let $32 '((Nothing $2) $3))
  (let $33 (RangeMultiply $29 (RangeCreate (AsList '($31 $31))) (RangeIntersect (RangeCreate (AsList '('((Just (SafeCast (Date '"15887") $1)) $30) $32))) (RangeCreate (AsList '($32 '((Just (SafeCast (Date '"15917") $1)) $30)))))))
  (let $34 (Nothing $4))
  (let $35 '($34 (Nothing $5) $34 $3))
  (return (ToStream (Just '((RangeFinalize (RangeMultiply $29 (RangeUnion (RangeMultiply $29 $33 (RangeCreate (AsList '($35 $35)))))))))))
))) $6))
(let $8 (DqCnValue (TDqOutput $7 '0)))
(let $9 (KqpPhysicalTx '($7) '($8) '() '('('"type" '"compute"))))
(let $10 '"%kqp%tx_result_binding_0_0")
(let $11 (DataType 'Int32))
(let $12 (TupleType (OptionalType $11) $2 $4 $5 $4 $11))
(let $13 (TupleType (ListType (TupleType $12 $12))))
(let $14 '('"URL" (DataType 'Utf8)))
(let $15 (DataType 'Uint64))
(let $16 '('('"_logical_id" '3731) '('"_id" '"5b64469e-f54217f9-b3bcdeb5-ba672e84") '('"_wide_channels" (StructType $14 '('_yql_agg_0 $15)))))
(let $17 (DqPhyStage '() (lambda '() (block '(
  (let $36 (KqpTable '"/local/test_db/olap_yatests/clickbench/hits" '"72075186224037897:8" '"" '1))
  (let $37 '('"DontCountHits" '"IsRefresh" '"URL"))
  (let $38 '('('"UsedKeyColumns" '('"CounterID" '"EventDate")) '('"ExpectedMaxRanges" '1) '('"PointPrefixLen" '1)))
  (let $39 (KqpBlockReadOlapTableRanges $36 %kqp%tx_result_binding_0_0 $37 '() $38 (lambda '($40) (block '(
    (let $41 '('eq '"DontCountHits" $3))
    (let $42 '('eq '"IsRefresh" $3))
    (let $43 '('neq '"URL" (String '"")))
    (let $44 (KqpOlapAnd $41 $42 $43))
    (let $45 '('"URL"))
    (return (TKqpOlapAgg (TKqpOlapExtractMembers (KqpOlapFilter $40 $44) $45) '('('_yql_agg_0 '"count" '"*")) $45))
  )))))
  (return (FromFlow $39))
))) $16))
(let $18 '('0))
(let $19 (DqCnHashShuffle (TDqOutput $17 '0) $18 '0 '"HashV1"))
(let $20 (Uint64 '10))
(let $21 '('('"_logical_id" '4193) '('"_id" '"5fcf2f4f-4cec9ea9-cf4e060f-c468cadf") '('"_wide_channels" (StructType '('Count0 $15) $14))))
(let $22 (DqPhyStage '($19) (lambda '($46) (block '(
  (let $47 (AggBlockApplyState '"count_all" $15 $15))
  (let $48 (WideTopSort (ToFlow (WideFromBlocks (BlockMergeFinalizeHashed $46 $18 '('($47 '1))))) $20 '('('1 (Bool 'false)))))
  (let $49 (lambda '($50 $51) $51 $50))
  (return (FromFlow (WideMap $48 $49)))
))) $21))
(let $23 (DqCnMerge (TDqOutput $22 '0) '('('0 '"Desc"))))
(let $24 (DqPhyStage '($23) (lambda '($52) (FromFlow (NarrowMap (Take (ToFlow $52) $20) (lambda '($53 $54) (AsStruct '('"PageViews" $53) '('"URL" $54)))))) '('('"_logical_id" '4308) '('"_id" '"5c3e4755-2fdb1918-ce8f949-488d76b6"))))
(let $25 '($17 $22 $24))
(let $26 (DqCnResult (TDqOutput $24 '0) '('"URL" '"PageViews")))
(let $27 (KqpTxResultBinding $13 '0 '0))
(let $28 (KqpPhysicalTx $25 '($26) '('($10 $27)) '('('"type" '"generic"))))
(return (KqpPhysicalQuery '($9 $28) '((KqpTxResultBinding (ListType (StructType '('"PageViews" $15) $14)) '1 '0)) '('('"type" '"query"))))
)
