Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #33825

Re: stream concat distinct indeterministic

From Eric Sosman <esosman@comcast-dot-net.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: stream concat distinct indeterministic
Date 2016-02-15 14:08 -0500
Organization A noiseless patient Spider
Message-ID <n9t7i9$vlr$1@dont-email.me> (permalink)
References <6e75cf37-61c1-4ab8-af9b-851fc280244d@googlegroups.com> <n9suo2$qjc$1@dont-email.me> <e28ed25c-f151-4ec2-9258-6727405398d7@googlegroups.com>

Show all headers | View raw


On 2/15/2016 12:05 PM, Philipp Kraus wrote:
> Am Montag, 15. Februar 2016 17:38:18 UTC+1 schrieb Eric Sosman:
>> On 2/15/2016 11:08 AM, Philipp Kraus wrote:
>>       And what, exactly, do you mean by "indeterministic?"
>>
>>       Observe that with parallel streams, distinct() is necessarily
>> non-deterministic: When equal (as reported by equals()) elements are
>> present, exactly which of the equal elements passes through distinct()
>> is a matter of happenstance.
>
> The stream uses a class which overloads equal (for my data structure), I don't use any parallel stream operation, but the concated stream is incorrect. I use Stream.concat( myfirststream, mysecondstream).distinct().count(), and count returns different results by equal input.
>
> I tested sequential() but I don't see any mistake of my stream, so I would like to return a stream with unique elements of both streams, but in my two streams some objects are duplicated

     Once again: SSCCE?

     (I can't debug what I can't see.  Not usually, anyhow.)

-- 
esosman@comcast-dot-net.invalid
"Don't be afraid of work. Make work afraid of you." -- TLM

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

stream concat distinct indeterministic Philipp Kraus <philipp.kraus.flashpixx@gmail.com> - 2016-02-15 08:08 -0800
  Re: stream concat distinct indeterministic Arne Vajhøj <arne@vajhoej.dk> - 2016-02-15 11:30 -0500
    Re: stream concat distinct indeterministic Philipp Kraus <philipp.kraus.flashpixx@gmail.com> - 2016-02-15 12:54 -0800
      Re: stream concat distinct indeterministic Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-02-15 16:13 -0500
        Re: stream concat distinct indeterministic Martin Gregorie <martin@address-in-sig.invalid> - 2016-02-15 21:58 +0000
          Re: stream concat distinct indeterministic Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-02-15 17:45 -0500
            Re: stream concat distinct indeterministic Martin Gregorie <martin@address-in-sig.invalid> - 2016-02-15 23:29 +0000
              Re: stream concat distinct indeterministic Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-02-16 07:47 -0500
        Re: stream concat distinct indeterministic Arne Vajhøj <arne@vajhoej.dk> - 2016-02-15 21:45 -0500
  Re: stream concat distinct indeterministic Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-02-15 11:38 -0500
    Re: stream concat distinct indeterministic Philipp Kraus <philipp.kraus.flashpixx@gmail.com> - 2016-02-15 09:05 -0800
      Re: stream concat distinct indeterministic Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-02-15 14:08 -0500
      Re: stream concat distinct indeterministic Andreas Leitgeb <avl@logic.at> - 2016-02-16 18:40 +0000

csiph-web