core.rrb-vector

Seq has broken support for reducers

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None

Description

RRB-T Vector uses existing VecSeq for seqs created from it. However, internal reduce in VecSeq is fixed at 32 elements per array, and this cause skipping when RRB-T Vector has different array sized.

user=> (require 'clojure.core.rrb-vector)
nil
user=> (def v1 (clojure.core.rrb-vector/subvec (clojure.core/vec (clojure.core/range 1003)) 500))
#'user/v1
user=> (def v2 (clojure.core/range 500 1003))
#'user/v2
user=> (= v1 v2)
true
user=> (reduce + 0 v1)
377753
user=> (reduce + 0 v2)
377753
user=> (reduce + 0 (clojure.core.reducers/map identity (seq v1)))
366786
user=> (reduce + 0 (clojure.core.reducers/map identity (seq v2)))
377753

Activity

Hide
Michał Marczyk added a comment -
Show
Michał Marczyk added a comment - Fixed as of this commit: https://github.com/clojure/core.rrb-vector/commit/d8941e8b064bebe2b0f13535d39faeb3341d6459 Thanks for the report!
Michał Marczyk made changes -
Field Original Value New Value
Resolution Completed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]
Michał Marczyk made changes -
Status Resolved [ 5 ] Closed [ 6 ]

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: