tencent cloud

Data Lake Compute

Release Notes
Product Introduction
Overview
Strengths
Use Cases
Purchase Guide
Billing Overview
Refund
Payment Overdue
Configuration Adjustment Fees
Getting Started
Complete Process for New User Activation
DLC Data Import Guide
Quick Start with Data Analytics in Data Lake Compute
Quick Start with Permission Management in Data Lake Compute
Quick Start with Partition Table
Enabling Data Optimization
Cross-Source Analysis of EMR Hive Data
Standard Engine Configuration Guide
Configuring Data Access Policy
Operation Guide
Console Operation Introduction
Development Guide
Runtime Environment
SparkJar Job Development Guide
PySpark Job Development Guide
Query Performance Optimization Guide
UDF Function Development Guide
System Restraints
Client Access
JDBC Access
TDLC Command Line Interface Tool Access
Third-party Software Linkage
Python Access
Practical Tutorial
Accessing DLC Data with Power BI
Table Creation Practice
Using Apache Airflow to Schedule DLC Engine to Submit Tasks
Direct Query of DLC Internal Storage with StarRocks
Spark cost optimization practice
DATA + AI
Using DLC to Analyze CLS Logs
Using Role SSO to Access DLC
Resource-Level Authentication Guide
Implementing Tencent Cloud TCHouse-D Read and Write Operations in DLC
DLC Native Table
SQL Statement
SuperSQL Statement
Overview of Standard Spark Statement
Overview of Standard Presto Statement
Reserved Words
API Documentation
History
Introduction
API Category
Making API Requests
Data Table APIs
Task APIs
Metadata APIs
Service Configuration APIs
Permission Management APIs
Database APIs
Data Source Connection APIs
Data Optimization APIs
Data Engine APIs
Resource Group for the Standard Engine APIs
Data Types
Error Codes
General Reference
Error Codes
Quotas and limits
Operation Guide on Connecting Third-Party Software to DLC
FAQs
FAQs on Permissions
FAQs on Engines
FAQs on Features
FAQs on Spark Jobs
DLC Policy
Privacy Policy
Data Privacy And Security Agreement
Service Level Agreement
Contact Us

Binary Functions

PDF
Focus Mode
Font Size
Last updated: 2024-08-07 17:30:56

CRC32

Function statement:
CRC32(<expr> string|binary)
Supported engines: SPARKSQL and PRESTO
Usage instructions: Compute the cyclic redundancy check value of the expression using the CRC32 algorithm.
Return type: bigint
Example:
> select crc32('tencent');
820633257

MD5

Function statement:
MD5(<expr string|binary)
Supported engines: SPARKSQL and PRESTO
Usage instructions: Return the MD5 128-bit checksum as a hexadecimal string.
Return type: string
Example:
> select md5('tencent');
3da576879001c77b442b9f8ef95c09d6

HASH

Function statement:
HASH(&lt;expr1&gt; any[, &lt;expr2&gt; any, ...])
Supported engines: SPARKSQL and PRESTO
Usage instructions: Return the hash value of all parameters. The calculation methods in SPARKSQL and PRESTO are inconsistent, so the results may differ.
Return type: integer
Example:
> SELECT hash('tencent', array(123), 2);
-412995102

XXHASH64

Function statement:
XXHASH64(&lt;expr1&gt; any[, &lt;expr2&gt; any, ...])
Supported engines: SPARKSQL and PRESTO
Usage instructions: Return the 64-bit hash value of the parameter. The calculation methods in SPARKSQL and PRESTO are inconsistent, so the results may differ.
Return type: bigint
Example:
> SELECT xxhash64('tencent', array(123), 2);
-1900074178543885261

SHA

Function statement:
SHA(<expr> string|binary)
Supported engines: SPARKSQL and PRESTO
Usage instructions: Return the SHA-1 hash value of expr as a hexadecimal string.
Return type: string
Example:
> select sha('tencent');
f94b2c96e2f127726ef4bcec6bc779f0f2e7888f

SHA1

Function statement:
SHA1(<expr> string|binary)
Supported engines: SPARKSQL and PRESTO
Usage instructions: Return the SHA-1 hash value of expr as a hexadecimal string.
Return type: string
Example:
> select sha1('tencent');
f94b2c96e2f127726ef4bcec6bc779f0f2e7888f

SHA2

Function statement:
SHA2(expr string|binary, bitLength int)
Supported engines: SPARKSQL and PRESTO
Usage instructions: Return the checksum of expr for the SHA-2 family as a hexadecimal string. SHA-224, SHA-256, SHA-384, and SHA-512 are supported. A bit length of 0 equals to 256.
Return type: string
Example:
> select sha2('tencent', 256);
9c8ae69b84f21a2e46df9edf0063a697afec050188ff2884ddc8ab32b5e58c43

AES_ENCRYPT

Function statement:
AES_ENCRYPT(<expr> string|binary, <key> string|binary)
Supported engines: PRESTO
Usage instructions: Encrypt expr using the AES algorithm.
Return type: binary
Example:
> SELECT hex(aes_encrypt('tencent', '0000111122223333'));
B99B99CE3359A736DBB9811ED8815C01

AES_DECRYPT

Function statement:
AES_DECRYPT(<expr> string|binary, <key> string|binary)
Supported engine: PRESTO
Usage instructions: Decrypt expr using the AES algorithm.
Return type: binary
Example:
> SELECT aes_decrypt(unhex('B99B99CE3359A736DBB9811ED8815C01'), '0000111122223333');
tencent



Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback