Skip to content

Implement native function of crc32 #1511

@slfan1989

Description

@slfan1989

Description

This PR implements the crc32 function to calculate the CRC32 checksum of input data, which is compatible with Spark's crc32 function.

Rationale

The addition of the crc32 function allows users to calculate the CRC32 hash of binary or string data. This functionality is essential for performing checksum operations, especially for data integrity checks and error detection. By integrating this function, we align with Spark’s existing set of cryptographic functions and provide the ability to efficiently compute CRC32 checksums.

Functionality

Function Name: crc32

  • Input:

    • The function accepts a STRING or BINARY input.
  • Output:

    • It returns a LONG value representing the CRC32 checksum of the input.
  • Behavior:

    • The function computes the CRC32 checksum for the input string or binary data.
    • It is null-safe and returns NULL when the input is NULL.
    • This implementation follows the standard CRC32 algorithm.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions