You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/04/15 03:24:27 UTC

[GitHub] [spark] c21 commented on a change in pull request #32159: [WIP][SPARK-35055][SQL] Fix the requirement in BitSet.union

c21 commented on a change in pull request #32159:
URL: https://github.com/apache/spark/pull/32159#discussion_r613730549



##########
File path: core/src/main/scala/org/apache/spark/util/collection/BitSet.scala
##########
@@ -240,7 +240,7 @@ class BitSet(numBits: Int) extends Serializable {
    * Compute bit-wise union with another BitSet and overwrite bits in this BitSet with the result.
    */
   def union(other: BitSet): Unit = {
-    require(this.numWords <= other.numWords)
+    require(this.numWords >= other.numWords)
     var ind = 0
     while( ind < this.numWords ) {

Review comment:
       Force equal length of two bitsets sounds fine. btw Java `java.util.BitSet` allows two bitsets to be different lengths (`or()`, `and()`, etc).




-- 
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



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org