tanelk commented on a change in pull request #31170:
URL: https://github.com/apache/spark/pull/31170#discussion_r557033779



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/bitwiseExpressions.scala
##########
@@ -204,3 +205,48 @@ case class BitwiseCount(child: Expression)
     case LongType => java.lang.Long.bitCount(input.asInstanceOf[Long])
   }
 }
+
+object BitwiseGet {
+  def calculate(target: Int, pos: Int): Int = {
+    val bitCount = java.lang.Long.bitCount(target)

Review comment:
       This is the number of set bits:
   ```     
       * Returns the number of one-bits in the two's complement binary
        * representation of the specified {@code long} value.  This function is
        * sometimes referred to as the <i>population count</i>.
   ```
   The comparison should be against the `java.lang.Long.SIZE` or for each 
datatype the constant should be the one defined in the corresponding class 
(Integer, Short, Byte).  This is another reason to use `IntegralType`.




----------------------------------------------------------------
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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to