tencent cloud

Stream Compute Service

Releases Notes and Announcements
Release Notes
Product Introduction
Overview
Strengths
Use Cases
Purchase Guide
Billing Overview
Billing Mode
Refund
Configuration Adjustments
Getting Started
Preparations
Creating a Private Cluster
Creating a SQL Job
Creating a JAR Job
Creating an ETL Job
Creating a Python Job
Operation Guide
Managing Jobs
Developing Jobs
Monitoring Jobs
Job Logs
Events and Diagnosis
Managing Metadata
Managing Checkpoints
Tuning Jobs
Managing Dependencies
Managing Clusters
Managing Permissions
SQL Developer Guide
Overview
Glossary and Data Types
DDL Statements
DML Statements
Merging MySQL CDC Sources
Connectors
SET Statement
Operators and Built-in Functions
Identifiers and Reserved Words
Python Developer Guide
ETL Developer Guide
Overview
Glossary
Connectors
FAQ
Contact Us

Comparison with Flink Built-in Functions

PDF
Modo Foco
Tamanho da Fonte
Última atualização: 2023-11-08 14:20:43
Based on the open-source Flink functions, Stream Compute Service has supplemented and optimized some functions. The following table lists some built-in functions.
Built-in Function
Stream Compute Service Definition
Flink Definition
Remarks
unbase64
unbase64(string)
-
Stream Compute Service: Decodes a Base64-encoded string. The input is a string and the output is an Array[Byte].
decode
DECODE(binary,charset), DECODE(binary)
DECODE(binary, string)
Stream Compute Service: DECODE(binary) uses charset="UTF-8” by default.
Flink: Returns NULL if any parameter is NULL.
split
SPLIT(string, separator)
-
Stream Compute Service: Splits string by separator, and returns a Row object.
get_row_field_str
GET_ROW_FIELD_STR(row, index)
-
Stream Compute Service: Gets the value of the indexth column in Row object row. index starts from 0. The return value is of VARCHAR type.
get_row_arity
GET_ROW_ARITY(row)
-
Stream Compute Service: Gets the number of columns in Row object row.
can_cast_to
CAN_CAST_TO(str, type)
-
Stream Compute Service: Checks whether the value of str can be converted to the type specified by type, and returns a Boolean value. The return value can be used as a condition in a CASE statement. For example, CAN_CAST_TO('123456', 'INTEGER') returns True, and CAN_CAST_TO('a145', 'DOUBLE') returns False.
date_format_simple
DATE_FORMAT_SIMPLE(timestamp, simple_format)
-
Stream Compute Service: Converts a field of BIGINT(Long) type (which represents a Unix timestamp in milliseconds) to a string using the format that is compatible with Java's SimpleDateFormat. For example, DATE_FORMAT_SIMPLE(unix_ts, 'yyyy-MM-dd HH:mm:ss') returns a string similar to "2020-01-01 12:13:14". The input type is Long and the output type is String.
to_timestamp
TO_TIMESTAMP(string, simple_format)
TO_TIMESTAMP(string1[, string2])
Stream Compute Service: Converts string to a timestamp using the simple_format, which is compatible with Java's SimpleDateFormat. UTC+8 is used by default. Example: `TO_TIMESTAMP(ts, 'yyyy-MM-dd HH:mm:ss')' The input type is String and the output type is Timestamp.
Flink: Same.
timestamp_to_long
TIMESTAMP_TO_LONG(timestamp), TIMESTAMP_TO_LONG(timestamp, mode)
-
Stream Compute Service: Converts a TIMESTAMP type parameter to a value of BIGINT (Long) type. If mode is 'SECOND', converts to a Unix timestamp in seconds, for example, 1548403425. If mode is any other value or not specified, converts to a Unix timestamp in milliseconds, for example, 1548403425512.
get_tumble_start
get_tumble_start(timestamp,windowSize), get_tumble_start(timestamp,offset,windowSize)
-
Stream Compute Service: Gets the start time of a window. The default offset is 0.
if_null_str
IF_NULL_STR(str, defaultValue)
-
Stream Compute Service: Returns the value of str itself if it is not NULL; otherwise, returns the value of defaultValue.
get_json_object
GET_JSON_OBJECT(json_str, path_str)
-
Stream Compute Service: Gets the nested elements of a JSON string. To view an example, see here.
split_index
SPLIT_INDEX(string, separator, index)
SPLIT_INDEX(string1, string2, integer1)
Splits string by separator, and returns the indexth string (VARCHAR) of the split strings. index starts from 0.
Stream Compute Service: If string or separator is null, returns string.
Flink: Returns null if any parameter is left empty.
first_str
FIRST_VALUE(expression)
FIRST_VALUE(expression)
Stream Compute Service: Returns the first value in a set of values.
Flink: Same.
last_str
LAST_VALUE(expression)
LAST_VALUE(expression)
Stream Compute Service: Returns the last value in a set of values.
Flink: Same.
explode
EXPLODE(inputStr, separator)
-
Stream Compute Service: Splits a string into a temporary table with multiple rows. This function is a table function, and you need to use the keyword LATERAL TABLE ( ) to reference this dynamically generated temporary table as the right table for JOIN.


Ajuda e Suporte

Esta página foi útil?

comentários