beliefer opened a new pull request #31198:
URL: https://github.com/apache/spark/pull/31198


   ### What changes were proposed in this pull request?
   `GETBIT` is a bitwise expression function given an INTEGER value, returns 
the value of a bit at a specified position.
   `GETBIT( <integer_expr>, <bit_position> )`
   
   Examples
   select getbit(11, 100), getbit(11, 3), getbit(11, 2), getbit(11, 1), 
getbit(11, 0);
   GETBIT(11, 3) | GETBIT(11, 2) | GETBIT(11, 1) | GETBIT(11, 0)
   -- | -- | -- | --
   1 | 0 | 1 | 1
   
   The mainstream database support this feature show below:
   
   **Teradata**
   
https://docs.teradata.com/reader/kmuOwjp1zEYg98JsB8fu_A/PK1oV1b2jqvG~ohRnOro9w
   
   **Impala**
   
https://docs.cloudera.com/runtime/7.2.0/impala-sql-reference/topics/impala-bit-functions.html#bit_functions__getbit
   
   **Snowflake**
   https://docs.snowflake.com/en/sql-reference/functions/getbit.html
   
   **Yellowbrick**
   https://www.yellowbrick.com/docs/2.2/ybd_sqlref/getbit.html
   
   
   ### Why are the changes needed?
   GETBIT is very useful.
   
   
   ### Does this PR introduce _any_ user-facing change?
   Yes. GETBIT is a new bitwise function.
   
   
   ### How was this patch tested?
   Jenkins test
   


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