Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-36811

Add bitwise functions for the BINARY data type

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: In Progress
    • Major
    • Resolution: Unresolved
    • 3.3.0
    • 3.3.0
    • SQL
    • None

    Description

      Add four new SQL functions operating on the `BINARY` data type for performing bitwise operations: BITAND, BITOR, BITXOR, and BITNOT.

      The BITAND, BITOR, and BITXOR functions take two byte strings as input and return the bitwise AND, OR, or XOR of the two input byte strings. The byte size of the result is the maximum of the byte sizes of the inputs, while the result is computed by aligning the two strings with respect to their least significant byte, and left-padding with zeros the shorter of the two inputs.

      The BITNOT function is a unary function and returns the input byte string with all the bits negated.

      Attachments

        Activity

          People

            Unassigned Unassigned
            mkaravel Menelaos Karavelas
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

                Estimated:
                Original Estimate - 336h
                336h
                Remaining:
                Remaining Estimate - 336h
                336h
                Logged:
                Time Spent - Not Specified
                Not Specified