Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Applies to:
Databricks SQL
Databricks Runtime
Returns a checksum of the SHA-2 family as a hex string of expr.
Syntax
sha2(expr, bitLength)
Arguments
expr: ABINARYorSTRINGexpression.bitLength: AnINTEGERexpression.
Returns
A STRING.
bitLength can be 0, 224, 256, 384, or 512.
bitLength 0 is equivalent to 256.
Examples
>> SELECT sha2('Spark', 256);
529bc3b07127ecb7e53a4dcf1991d9152c24537d919178022b2c42657f79a26b