You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datasketches.apache.org by GitBox <gi...@apache.org> on 2020/02/14 01:31:38 UTC

[GitHub] [incubator-datasketches-java] jdob2 opened a new issue #301: Does Union support multi Sketch flavor updates?

jdob2 opened a new issue #301: Does Union support multi Sketch flavor updates?
URL: https://github.com/apache/incubator-datasketches-java/issues/301
 
 
   I am trying to understand why the following code doesn't work as intended
   
   
   `        Union set1 = Union.builder().setNominalEntries(SKETCH_LOG_ENTRY).buildUnion();
           set1.update(1);
           set1.update(2);
           set1.update(3);
           set1.update(4);
           set1.update(5);
           set1.update(6);
           set1.update(6);
           set1.update(6);
   
           Union set2 = Union.builder().setNominalEntries(SKETCH_LOG_ENTRY).buildUnion();
           set2.update(1);
   
           AnotB aNotB = Sketches.setOperationBuilder().setNominalEntries(SKETCH_LOG_ENTRY).buildANotB();
           aNotB.update(set1.getResult(), set2.getResult());
           System.out.println(aNotB.getResult().getEstimate());
   
           Union finalUnion = Union.builder().setNominalEntries(SKETCH_LOG_ENTRY).buildUnion();
           finalUnion.update(aNotB.getResult());
           System.out.println(finalUnion.getResult().getEstimate());`
   
   I am expecting the printout to be 
   
   `5.0`
   `5.0`
   
   but instead I get
   
   `5.0`
   `1.0`
   
   I must be doing something trivially wrong, or does Union update only support compactSketch from Union?
   
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org


[GitHub] [incubator-datasketches-java] jdob2 closed issue #301: Does Union support multi Sketch flavor updates?

Posted by GitBox <gi...@apache.org>.
jdob2 closed issue #301: Does Union support multi Sketch flavor updates?
URL: https://github.com/apache/incubator-datasketches-java/issues/301
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org


[GitHub] [incubator-datasketches-java] jdob2 commented on issue #301: Does Union support multi Sketch flavor updates?

Posted by GitBox <gi...@apache.org>.
jdob2 commented on issue #301: Does Union support multi Sketch flavor updates?
URL: https://github.com/apache/incubator-datasketches-java/issues/301#issuecomment-586448104
 
 
   Ah, you are absolutely correct, that make alot of sense, thanks

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org


[GitHub] [incubator-datasketches-java] leerho commented on issue #301: Does Union support multi Sketch flavor updates?

Posted by GitBox <gi...@apache.org>.
leerho commented on issue #301: Does Union support multi Sketch flavor updates?
URL: https://github.com/apache/incubator-datasketches-java/issues/301#issuecomment-586066714
 
 
   As stated in the [documentation](https://datasketches.apache.org/api/java/snapshot/apidocs/index.html), the AnotB operation is not iterative like Intersection and Union.  It is a stateless function that resets after the getResult.   So your second call to aNotB returns 0.   So instead of your code try this:
   
   ```
   AnotB aNotB = SetOperationBuilder.buildAnotB();
   aNotB.update(SketchA, SketchB); //Called only once.
   CompactSketch result = aNotB.getResult();
   System.out.println(result.getEstimate());
   
   Union finalUnion = Union.builder().setNominalEntries(4096).buildUnion();
   finalUnion.update(result);
   System.out.println(finalUnion.getResult().getEstimate());
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org


[GitHub] [incubator-datasketches-java] leerho commented on issue #301: Does Union support multi Sketch flavor updates?

Posted by GitBox <gi...@apache.org>.
leerho commented on issue #301: Does Union support multi Sketch flavor updates?
URL: https://github.com/apache/incubator-datasketches-java/issues/301#issuecomment-586069662
 
 
   You can also do this:
   ```
   AnotB aNotB = SetOperationBuilder.buildAnotB();
   CompactSketch result = aNotB.aNotB(SketchA, SketchB);
   System.out.println(result.getEstimate());
      ...
   ```
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org