(
(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" '"68ff8190-390e9b2d-d09ff6a9-cedb47c3") '('"_partition_mode" '"single")))
(let $7 (DqPhyStage '() (lambda '() (block '(
  (let $28 (Uint64 '10000))
  (let $29 (Int32 '1))
  (let $30 '((Just (Int32 '"62")) $29))
  (let $31 '((Nothing $2) $3))
  (let $32 (RangeMultiply $28 (RangeCreate (AsList '($30 $30))) (RangeIntersect (RangeCreate (AsList '('((Just (SafeCast (Date '"15887") $1)) $29) $31))) (RangeCreate (AsList '($31 '((Just (SafeCast (Date '"15917") $1)) $29)))))))
  (let $33 (Nothing $4))
  (let $34 '($33 (Nothing $5) $33 $3))
  (return (ToStream (Just '((RangeFinalize (RangeMultiply $28 (RangeUnion (RangeMultiply $28 $32 (RangeCreate (AsList '($34 $34)))))))))))
))) $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" '3721) '('"_id" '"b1591c6e-22ee6fe3-5238a831-85657faf") '('"_wide_channels" (StructType $14 '('_yql_agg_0 $15)))))
(let $17 (DqPhyStage '() (lambda '() (block '(
  (let $35 (KqpTable '"/local/test_db/olap_yatests/clickbench/hits" '"72075186224037897:8" '"" '1))
  (let $36 '('"DontCountHits" '"IsRefresh" '"URL"))
  (let $37 '('('"UsedKeyColumns" '('"CounterID" '"EventDate")) '('"ExpectedMaxRanges" '1) '('"PointPrefixLen" '1)))
  (let $38 (KqpBlockReadOlapTableRanges $35 %kqp%tx_result_binding_0_0 $36 '() $37 (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))
  )))))
  (let $39 (lambda '($46 $47 $48) (block '(
    (let $49 (BlockAsStruct '('"URL" $46) '('_yql_agg_0 $47)))
    (return (BlockMember $49 '"URL") (BlockMember $49 '_yql_agg_0) $48)
  ))))
  (return (FromFlow (WideMap $38 $39)))
))) $16))
(let $18 (DqCnHashShuffle (TDqOutput $17 '0) '('0)))
(let $19 (Uint64 '10))
(let $20 '('('"_logical_id" '4101) '('"_id" '"599096b7-249d9c73-4c82dc0-7bcd96b2") '('"_wide_channels" (StructType '('Count0 $15) $14))))
(let $21 (DqPhyStage '($18) (lambda '($50) (block '(
  (let $51 (lambda '($62 $63) $63 $62))
  (let $52 (WideCombiner (ToFlow (WideFromBlocks $50)) '"" (lambda '($53 $54) $53) (lambda '($55 $56 $57) $57) (lambda '($58 $59 $60 $61) (AggrAdd $60 $61)) $51))
  (return (FromFlow (WideTopSort $52 $19 '('('0 (Bool 'false))))))
))) $20))
(let $22 (DqCnMerge (TDqOutput $21 '0) '('('0 '"Desc"))))
(let $23 (DqPhyStage '($22) (lambda '($64) (FromFlow (NarrowMap (Take (ToFlow $64) $19) (lambda '($65 $66) (AsStruct '('"PageViews" $65) '('"URL" $66)))))) '('('"_logical_id" '4198) '('"_id" '"ce36db7a-eaf8ee52-ccb910f5-ddc7ca8f"))))
(let $24 '($17 $21 $23))
(let $25 (DqCnResult (TDqOutput $23 '0) '('"URL" '"PageViews")))
(let $26 (KqpTxResultBinding $13 '0 '0))
(let $27 (KqpPhysicalTx $24 '($25) '('($10 $26)) '('('"type" '"generic"))))
(return (KqpPhysicalQuery '($9 $27) '((KqpTxResultBinding (ListType (StructType '('"PageViews" $15) $14)) '1 '0)) '('('"type" '"query"))))
)
