You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by zo...@apache.org on 2023/03/05 09:20:43 UTC
[incubator-seatunnel] branch dev updated: [Feature][Transform] Add SimpleSQL transform plugin (#4148)
This is an automated email from the ASF dual-hosted git repository.
zongwen pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-seatunnel.git
The following commit(s) were added to refs/heads/dev by this push:
new b914d49ab [Feature][Transform] Add SimpleSQL transform plugin (#4148)
b914d49ab is described below
commit b914d49abfdbc18e34df5d981643e36bca55481d
Author: Marvin <29...@qq.com>
AuthorDate: Sun Mar 5 17:20:34 2023 +0800
[Feature][Transform] Add SimpleSQL transform plugin (#4148)
---
LICENSE | 4 +
docs/en/faq.md | 2 -
docs/en/transform-v2/sql-functions.md | 893 +++++++++++++++++++++
docs/en/transform-v2/sql.md | 100 +++
pom.xml | 1 +
release-note.md | 1 +
.../api/transform/SeaTunnelTransform.java | 6 +
.../assertion/excecutor/AssertExecutor.java | 33 +
.../seatunnel/assertion/rule/AssertFieldRule.java | 1 +
.../seatunnel/assertion/rule/AssertRuleParser.java | 9 +
.../seatunnel/assertion/sink/AssertConfig.java | 2 +
.../apache/seatunnel/e2e/transform/TestSQLIT.java | 313 ++++++++
.../resources/sql_functions/binary_expression.conf | 104 +++
.../resources/sql_functions/filter_and_or.conf | 73 ++
.../resources/sql_functions/filter_equals_to.conf | 72 ++
.../resources/sql_functions/filter_function.conf | 72 ++
.../resources/sql_functions/filter_great_than.conf | 72 ++
.../sql_functions/filter_great_than_equals.conf | 72 ++
.../test/resources/sql_functions/filter_in.conf | 73 ++
.../sql_functions/filter_is_not_null.conf | 72 ++
.../resources/sql_functions/filter_is_null.conf | 72 ++
.../resources/sql_functions/filter_minor_than.conf | 72 ++
.../sql_functions/filter_minor_than_equals.conf | 72 ++
.../sql_functions/filter_not_equals_to.conf | 72 ++
.../resources/sql_functions/filter_not_in.conf | 73 ++
.../src/test/resources/sql_functions/func_abs.conf | 76 ++
.../test/resources/sql_functions/func_acos.conf | 69 ++
.../test/resources/sql_functions/func_ascii.conf | 84 ++
.../test/resources/sql_functions/func_asin.conf | 69 ++
.../test/resources/sql_functions/func_atan.conf | 69 ++
.../resources/sql_functions/func_bit_length.conf | 84 ++
.../test/resources/sql_functions/func_cast.conf | 104 +++
.../test/resources/sql_functions/func_ceil.conf | 76 ++
.../resources/sql_functions/func_char_length.conf | 84 ++
.../src/test/resources/sql_functions/func_chr.conf | 84 ++
.../resources/sql_functions/func_coalesce.conf | 69 ++
.../test/resources/sql_functions/func_concat.conf | 76 ++
.../resources/sql_functions/func_concat_ws.conf | 76 ++
.../src/test/resources/sql_functions/func_cos.conf | 69 ++
.../test/resources/sql_functions/func_cosh.conf | 69 ++
.../src/test/resources/sql_functions/func_cot.conf | 69 ++
.../resources/sql_functions/func_current_date.conf | 76 ++
.../resources/sql_functions/func_current_time.conf | 76 ++
.../sql_functions/func_current_timestamp.conf | 83 ++
.../resources/sql_functions/func_date_trunc.conf | 104 +++
.../test/resources/sql_functions/func_dateadd.conf | 111 +++
.../resources/sql_functions/func_datediff.conf | 112 +++
.../resources/sql_functions/func_day_of_month.conf | 85 ++
.../resources/sql_functions/func_day_of_week.conf | 88 ++
.../resources/sql_functions/func_day_of_year.conf | 85 ++
.../test/resources/sql_functions/func_dayname.conf | 116 +++
.../src/test/resources/sql_functions/func_exp.conf | 69 ++
.../test/resources/sql_functions/func_extract.conf | 127 +++
.../test/resources/sql_functions/func_floor.conf | 76 ++
.../sql_functions/func_formatdatetime.conf | 83 ++
.../resources/sql_functions/func_hextoraw.conf | 76 ++
.../test/resources/sql_functions/func_hour.conf | 69 ++
.../test/resources/sql_functions/func_ifnull.conf | 69 ++
.../test/resources/sql_functions/func_insert.conf | 76 ++
.../test/resources/sql_functions/func_left.conf | 69 ++
.../src/test/resources/sql_functions/func_ln.conf | 76 ++
.../test/resources/sql_functions/func_locate.conf | 83 ++
.../src/test/resources/sql_functions/func_log.conf | 76 ++
.../test/resources/sql_functions/func_log10.conf | 76 ++
.../test/resources/sql_functions/func_lower.conf | 76 ++
.../test/resources/sql_functions/func_lpad.conf | 76 ++
.../test/resources/sql_functions/func_ltrim.conf | 76 ++
.../test/resources/sql_functions/func_minute.conf | 69 ++
.../src/test/resources/sql_functions/func_mod.conf | 83 ++
.../test/resources/sql_functions/func_month.conf | 69 ++
.../resources/sql_functions/func_monthname.conf | 69 ++
.../test/resources/sql_functions/func_nullif.conf | 76 ++
.../resources/sql_functions/func_octet_length.conf | 76 ++
.../sql_functions/func_parsedatetime.conf | 78 ++
.../src/test/resources/sql_functions/func_pi.conf | 69 ++
.../test/resources/sql_functions/func_power.conf | 76 ++
.../test/resources/sql_functions/func_quarter.conf | 69 ++
.../test/resources/sql_functions/func_radians.conf | 69 ++
.../test/resources/sql_functions/func_rand.conf | 73 ++
.../resources/sql_functions/func_rawtohex.conf | 76 ++
.../resources/sql_functions/func_regexp_like.conf | 76 ++
.../sql_functions/func_regexp_replace.conf | 76 ++
.../sql_functions/func_regexp_substr.conf | 76 ++
.../test/resources/sql_functions/func_repeat.conf | 69 ++
.../test/resources/sql_functions/func_replace.conf | 76 ++
.../test/resources/sql_functions/func_right.conf | 69 ++
.../test/resources/sql_functions/func_round.conf | 76 ++
.../test/resources/sql_functions/func_rpad.conf | 76 ++
.../test/resources/sql_functions/func_rtrim.conf | 76 ++
.../test/resources/sql_functions/func_second.conf | 69 ++
.../test/resources/sql_functions/func_sign.conf | 92 +++
.../src/test/resources/sql_functions/func_sin.conf | 69 ++
.../test/resources/sql_functions/func_sinh.conf | 69 ++
.../test/resources/sql_functions/func_soundex.conf | 69 ++
.../test/resources/sql_functions/func_space.conf | 69 ++
.../test/resources/sql_functions/func_sqrt.conf | 76 ++
.../test/resources/sql_functions/func_substr.conf | 76 ++
.../src/test/resources/sql_functions/func_tan.conf | 69 ++
.../test/resources/sql_functions/func_tanh.conf | 69 ++
.../test/resources/sql_functions/func_to_char.conf | 69 ++
.../resources/sql_functions/func_translate.conf | 69 ++
.../test/resources/sql_functions/func_trim.conf | 76 ++
.../test/resources/sql_functions/func_trunc.conf | 76 ++
.../test/resources/sql_functions/func_upper.conf | 76 ++
.../test/resources/sql_functions/func_week.conf | 69 ++
.../test/resources/sql_functions/func_year.conf | 69 ++
.../src/test/resources/sql_transform.conf | 112 +++
.../server/task/flow/TransformFlowLifeCycle.java | 33 +
seatunnel-transforms-v2/pom.xml | 5 +
.../apache/seatunnel/transform/SQLTransform.java | 103 +++
.../seatunnel/transform/SQLTransformFactory.java | 39 +
.../common/AbstractSeaTunnelTransform.java | 8 +-
.../transform/exception/TransformException.java | 36 +
.../seatunnel/transform/sqlengine/SQLEngine.java | 31 +
.../transform/sqlengine/SQLEngineFactory.java | 40 +
.../transform/sqlengine/zeta/ZetaSQLEngine.java | 202 +++++
.../transform/sqlengine/zeta/ZetaSQLFilter.java | 329 ++++++++
.../transform/sqlengine/zeta/ZetaSQLFunction.java | 544 +++++++++++++
.../transform/sqlengine/zeta/ZetaSQLType.java | 328 ++++++++
.../sqlengine/zeta/functions/DateTimeFunction.java | 544 +++++++++++++
.../sqlengine/zeta/functions/NumericFunction.java | 444 ++++++++++
.../sqlengine/zeta/functions/StringFunction.java | 667 +++++++++++++++
.../sqlengine/zeta/functions/SystemFunction.java | 125 +++
tools/dependencies/known-dependencies.txt | 1 +
124 files changed, 12190 insertions(+), 6 deletions(-)
diff --git a/LICENSE b/LICENSE
index 8d74dcda4..bd06a0380 100644
--- a/LICENSE
+++ b/LICENSE
@@ -236,3 +236,7 @@ seatunnel-engine/seatunnel-engine-core/src/main/java/org/apache/seatunnel/engine
seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/checkpoint/StandaloneCheckpointIDCounter.java from https://github.com/apache/flink
seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/metrics from https://github.com/hazelcast/hazelcast
seatunnel-api/src/main/java/org/apache/seatunnel/api/common/metrics from https://github.com/hazelcast/hazelcast
+seatunnel-transforms-v2/src/main/java/org/apache/seatunnel/transform/sqlengine/zeta/ZetaSQLEngine.java from https://github.com/JSQLParser/JSqlParser
+seatunnel-transforms-v2/src/main/java/org/apache/seatunnel/transform/sqlengine/zeta/ZetaSQLType.java from https://github.com/JSQLParser/JSqlParser
+seatunnel-transforms-v2/src/main/java/org/apache/seatunnel/transform/sqlengine/zeta/ZetaSQLFilter.java from https://github.com/JSQLParser/JSqlParser
+seatunnel-transforms-v2/src/main/java/org/apache/seatunnel/transform/sqlengine/zeta/ZetaSQLFunction.java from https://github.com/JSQLParser/JSqlParser
\ No newline at end of file
diff --git a/docs/en/faq.md b/docs/en/faq.md
index f68fb61c8..b3f698e19 100644
--- a/docs/en/faq.md
+++ b/docs/en/faq.md
@@ -303,8 +303,6 @@ http://spark.apache.org/docs/latest/configuration.html#configuring-logging
https://medium.com/@iacomini.riccardo/spark-logging-configuration-in-yarn-faf5ba5fdb01
-https://stackoverflow.com/questions/27781187/how-to-stop-info-messages-displaying-on-spark-console
-
## Error when writing to ClickHouse: ClassCastException
In SeaTunnel, the data type will not be actively converted. After the Input reads the data, the corresponding
diff --git a/docs/en/transform-v2/sql-functions.md b/docs/en/transform-v2/sql-functions.md
new file mode 100644
index 000000000..dd8b8dbfd
--- /dev/null
+++ b/docs/en/transform-v2/sql-functions.md
@@ -0,0 +1,893 @@
+# SQL Functions
+
+> The Functions of SQL transform plugin
+
+## String Functions
+
+### ASCII
+
+```ASCII(string)```
+
+Returns the ```ASCII``` value of the first character in the string. This method returns an int.
+
+Example:
+
+ASCII('Hi')
+
+### BIT_LENGTH
+
+```BIT_LENGTH(bytes)```
+
+Returns the number of bits in a binary string. This method returns a long.
+
+Example:
+
+BIT_LENGTH(NAME)
+
+### CHAR_LENGTH / LENGTH
+
+```CHAR_LENGTH | LENGTH (string)```
+
+Returns the number of characters in a character string. This method returns a long.
+
+Example:
+
+CHAR_LENGTH(NAME)
+
+### OCTET_LENGTH
+
+```OCTET_LENGTH(bytes)```
+
+Returns the number of bytes in a binary string. This method returns a long.
+
+Example:
+
+OCTET_LENGTH(NAME)
+
+### CHAR / CHR
+
+```CHAR | CHR (int)```
+
+Returns the character that represents the ASCII value. This method returns a string.
+
+Example:
+
+CHAR(65)
+
+### CONCAT
+
+```CONCAT(string, string[, string ...] )```
+
+Combines strings. Unlike with the operator ```||```, **NULL** parameters are ignored, and do not cause the result to become **NULL**. If all parameters are NULL the result is an empty string. This method returns a string.
+
+Example:
+
+CONCAT(NAME, '_')
+
+### CONCAT_WS
+
+```CONCAT_WS(separatorString, string, string[, string ...] )```
+
+Combines strings with separator. If separator is **NULL** it is treated like an empty string. Other **NULL** parameters are ignored. Remaining **non-NULL** parameters, if any, are concatenated with the specified separator. If there are no remaining parameters the result is an empty string. This method returns a string.
+
+Example:
+
+CONCAT_WS(',', NAME, '_')
+
+### HEXTORAW
+
+```HEXTORAW(string)```
+
+Converts a hex representation of a string to a string. 4 hex characters per string character are used.
+
+Example:
+
+HEXTORAW(DATA)
+
+### RAWTOHEX
+
+```RAWTOHEX(string)```
+
+```RAWTOHEX(bytes)```
+
+Converts a string or bytes to the hex representation. 4 hex characters per string character are used. This method returns a string.
+
+Example:
+
+RAWTOHEX(DATA)
+
+### INSERT
+
+```INSERT(originalString, startInt, lengthInt, addString)```
+
+Inserts a additional string into the original string at a specified start position. The length specifies the number of characters that are removed at the start position in the original string. This method returns a string.
+
+Example:
+
+INSERT(NAME, 1, 1, ' ')
+
+### LOWER / LCASE
+
+```LOWER | LCASE (string)```
+
+Converts a string to lowercase.
+
+Example:
+
+LOWER(NAME)
+
+### UPPER / UCASE
+
+```UPPER | UCASE (string)```
+
+Converts a string to uppercase.
+
+Example:
+
+UPPER(NAME)
+
+### LEFT
+
+```LEFT(string, int)```
+
+Returns the leftmost number of characters.
+
+Example:
+
+LEFT(NAME, 3)
+
+### RIGHT
+
+```RIGHT(string, int)```
+
+Returns the rightmost number of characters.
+
+Example:
+
+RIGHT(NAME, 3)
+
+### LOCATE / INSTR / POSITION
+
+```LOCATE(searchString, string[, startInit])```
+
+```INSTR(string, searchString[, startInit])```
+
+```POSITION(searchString, string)```
+
+Returns the location of a search string in a string. If a start position is used, the characters before it are ignored. If position is negative, the rightmost location is returned. 0 is returned if the search string is not found. Please note this function is case sensitive, even if the parameters are not.
+
+Example:
+
+LOCATE('.', NAME)
+
+### LPAD
+
+```LPAD(string ,int[, string])```
+
+Left pad the string to the specified length. If the length is shorter than the string, it will be truncated at the end. If the padding string is not set, spaces will be used.
+
+Example:
+
+LPAD(AMOUNT, 10, '*')
+
+### RPAD
+
+```RPAD(string, int[, string])```
+
+Right pad the string to the specified length. If the length is shorter than the string, it will be truncated. If the padding string is not set, spaces will be used.
+
+Example:
+
+RPAD(TEXT, 10, '-')
+
+### LTRIM
+
+```LTRIM(string[, characterToTrimString])```
+
+Removes all leading spaces or other specified characters from a string.
+
+This function is deprecated, use TRIM instead of it.
+
+Example:
+
+LTRIM(NAME)
+
+### RTRIM
+
+```RTRIM(string[, characterToTrimString])```
+
+Removes all trailing spaces or other specified characters from a string.
+
+This function is deprecated, use TRIM instead of it.
+
+Example:
+
+RTRIM(NAME)
+
+### TRIM
+
+```TRIM(string[, characterToTrimString])```
+
+Removes all leading spaces or other specified characters from a string.
+
+This function is deprecated, use TRIM instead of it.
+
+Example:
+
+LTRIM(NAME)
+
+### REGEXP_REPLACE
+
+```REGEXP_REPLACE(inputString, regexString, replacementString[, flagsString])```
+
+Replaces each substring that matches a regular expression. For details, see the Java String.replaceAll() method. If any parameter is null (except optional flagsString parameter), the result is null.
+
+Flags values are limited to 'i', 'c', 'n', 'm'. Other symbols cause exception. Multiple symbols could be used in one flagsString parameter (like 'im'). Later flags override first ones, for example 'ic' is equivalent to case sensitive matching 'c'.
+
+'i' enables case insensitive matching (Pattern.CASE_INSENSITIVE)
+
+'c' disables case insensitive matching (Pattern.CASE_INSENSITIVE)
+
+'n' allows the period to match the newline character (Pattern.DOTALL)
+
+'m' enables multiline mode (Pattern.MULTILINE)
+
+Example:
+
+REGEXP_REPLACE('Hello World', ' +', ' ')
+REGEXP_REPLACE('Hello WWWWorld', 'w+', 'W', 'i')
+
+### REGEXP_LIKE
+
+```REGEXP_LIKE(inputString, regexString[, flagsString])```
+
+Matches string to a regular expression. For details, see the Java Matcher.find() method. If any parameter is null (except optional flagsString parameter), the result is null.
+
+Flags values are limited to 'i', 'c', 'n', 'm'. Other symbols cause exception. Multiple symbols could be used in one flagsString parameter (like 'im'). Later flags override first ones, for example 'ic' is equivalent to case sensitive matching 'c'.
+
+'i' enables case insensitive matching (Pattern.CASE_INSENSITIVE)
+
+'c' disables case insensitive matching (Pattern.CASE_INSENSITIVE)
+
+'n' allows the period to match the newline character (Pattern.DOTALL)
+
+'m' enables multiline mode (Pattern.MULTILINE)
+
+Example:
+
+REGEXP_LIKE('Hello World', '[A-Z ]*', 'i')
+
+### REGEXP_SUBSTR
+
+```REGEXP_SUBSTR(inputString, regexString[, positionInt, occurrenceInt, flagsString, groupInt])```
+
+Matches string to a regular expression and returns the matched substring. For details, see the java.util.regex.Pattern and related functionality.
+
+The parameter position specifies where in inputString the match should start. Occurrence indicates which occurrence of pattern in inputString to search for.
+
+Flags values are limited to 'i', 'c', 'n', 'm'. Other symbols cause exception. Multiple symbols could be used in one flagsString parameter (like 'im'). Later flags override first ones, for example 'ic' is equivalent to case sensitive matching 'c'.
+
+'i' enables case insensitive matching (Pattern.CASE_INSENSITIVE)
+
+'c' disables case insensitive matching (Pattern.CASE_INSENSITIVE)
+
+'n' allows the period to match the newline character (Pattern.DOTALL)
+
+'m' enables multiline mode (Pattern.MULTILINE)
+
+If the pattern has groups, the group parameter can be used to specify which group to return.
+
+Example:
+
+REGEXP_SUBSTR('2020-10-01', '\d{4}')
+REGEXP_SUBSTR('2020-10-01', '(\d{4})-(\d{2})-(\d{2})', 1, 1, NULL, 2)
+
+### REPEAT
+
+```REPEAT(string, int)```
+
+Returns a string repeated some number of times.
+
+Example:
+
+REPEAT(NAME || ' ', 10)
+
+### REPLACE
+
+```REPLACE(string, searchString[, replacementString])```
+
+Replaces all occurrences of a search string in a text with another string. If no replacement is specified, the search string is removed from the original string. If any parameter is null, the result is null.
+
+Example:
+
+REPLACE(NAME, ' ')
+
+### SOUNDEX
+
+```SOUNDEX(string)```
+
+Returns a four character code representing the sound of a string. This method returns a string, or null if parameter is null. See https://en.wikipedia.org/wiki/Soundex for more information.
+
+Example:
+
+SOUNDEX(NAME)
+
+### SPACE
+
+```SPACE(int)```
+
+Returns a string consisting of a number of spaces.
+
+Example:
+
+SPACE(80)
+
+### SUBSTRING / SUBSTR
+
+```SUBSTRING | SUBSTR (string, startInt[, lengthInt ])```
+
+Returns a substring of a string starting at a position. If the start index is negative, then the start index is relative to the end of the string. The length is optional.
+
+Example:
+
+CALL SUBSTRING('[Hello]', 2);
+CALL SUBSTRING('hour', 3, 2);
+
+### TO_CHAR
+
+```TO_CHAR(value[, formatString])```
+
+Oracle-compatible TO_CHAR function that can format a timestamp, a number, or text.
+
+Example:
+
+CALL TO_CHAR(SYS_TIME, 'yyyy-MM-dd HH:mm:ss')
+
+### TRANSLATE
+
+```TRANSLATE(value, searchString, replacementString)```
+
+Oracle-compatible TRANSLATE function that replaces a sequence of characters in a string with another set of characters.
+
+Example:
+
+CALL TRANSLATE('Hello world', 'eo', 'EO')
+
+## Numeric Functions
+
+### ABS
+
+```ABS(numeric)```
+
+Returns the absolute value of a specified value. The returned value is of the same data type as the parameter.
+
+Note that TINYINT, SMALLINT, INT, and BIGINT data types cannot represent absolute values of their minimum negative values, because they have more negative values than positive. For example, for INT data type allowed values are from -2147483648 to 2147483647. ABS(-2147483648) should be 2147483648, but this value is not allowed for this data type. It leads to an exception. To avoid it cast argument of this function to a higher data type.
+
+Example:
+
+ABS(I)
+
+### ACOS
+
+```ACOS(numeric)```
+
+Calculate the arc cosine. See also Java Math.acos. This method returns a double.
+
+Example:
+
+ACOS(D)
+
+### ASIN
+
+```ASIN(numeric)```
+
+Calculate the arc sine. See also Java Math.asin. This method returns a double.
+
+Example:
+
+ASIN(D)
+
+### ATAN
+
+```ATAN(numeric)```
+
+Calculate the arc tangent. See also Java Math.atan. This method returns a double.
+
+Example:
+
+ATAN(D)
+
+### COS
+
+```COS(numeric)```
+
+Calculate the trigonometric cosine. See also Java Math.cos. This method returns a double.
+
+Example:
+
+COS(ANGLE)
+
+### COSH
+
+```COSH(numeric)```
+
+Calculate the hyperbolic cosine. See also Java Math.cosh. This method returns a double.
+
+Example:
+
+COSH(X)
+
+### COT
+
+```COT(numeric)```
+
+Calculate the trigonometric cotangent (1/TAN(ANGLE)). See also Java Math.* functions. This method returns a double.
+
+Example:
+
+COT(ANGLE)
+
+### SIN
+
+```SIN(numeric)```
+
+Calculate the trigonometric sine. See also Java Math.sin. This method returns a double.
+
+Example:
+
+SIN(ANGLE)
+
+### SINH
+
+```SINH(numeric)```
+
+Calculate the hyperbolic sine. See also Java Math.sinh. This method returns a double.
+
+Example:
+
+SINH(ANGLE)
+
+### TAN
+
+```TAN(numeric)```
+
+Calculate the trigonometric tangent. See also Java Math.tan. This method returns a double.
+
+Example:
+
+TAN(ANGLE)
+
+### TANH
+
+```TANH(numeric)```
+
+Calculate the hyperbolic tangent. See also Java Math.tanh. This method returns a double.
+
+Example:
+
+TANH(X)
+
+### MOD
+
+```MOD(dividendNumeric, divisorNumeric )```
+
+The modulus expression.
+
+Result has the same type as divisor. Result is NULL if either of arguments is NULL. If divisor is 0, an exception is raised. Result has the same sign as dividend or is equal to 0.
+
+Usually arguments should have scale 0, but it isn't required by H2.
+
+Example:
+
+MOD(A, B)
+
+### CEIL / CEILING
+
+```CEIL | CEILING (numeric)```
+
+Returns the smallest integer value that is greater than or equal to the argument. This method returns value of the same type as argument, but with scale set to 0 and adjusted precision, if applicable.
+
+Example:
+
+CEIL(A)
+
+### EXP
+
+```EXP(numeric)```
+
+See also Java Math.exp. This method returns a double.
+
+Example:
+
+EXP(A)
+
+### FLOOR
+
+```FLOOR(numeric)```
+
+Returns the largest integer value that is less than or equal to the argument. This method returns value of the same type as argument, but with scale set to 0 and adjusted precision, if applicable.
+
+Example:
+
+FLOOR(A)
+
+### LN
+
+```LN(numeric)```
+
+Calculates the natural (base e) logarithm as a double value. Argument must be a positive numeric value.
+
+Example:
+
+LN(A)
+
+### LOG
+
+```LOG(baseNumeric, numeric)```
+
+Calculates the logarithm with specified base as a double value. Argument and base must be positive numeric values. Base cannot be equal to 1.
+
+The default base is e (natural logarithm), in the PostgreSQL mode the default base is base 10. In MSSQLServer mode the optional base is specified after the argument.
+
+Single-argument variant of LOG function is deprecated, use LN or LOG10 instead.
+
+Example:
+
+LOG(2, A)
+
+### LOG10
+
+```LOG10(numeric)```
+
+Calculates the base 10 logarithm as a double value. Argument must be a positive numeric value.
+
+Example:
+
+LOG10(A)
+
+### RADIANS
+
+```RADIANS(numeric)```
+
+See also Java Math.toRadians. This method returns a double.
+
+Example:
+
+RADIANS(A)
+
+### SQRT
+
+```SQRT(numeric)```
+
+See also Java Math.sqrt. This method returns a double.
+
+Example:
+
+SQRT(A)
+
+### PI
+
+```PI()```
+
+See also Java Math.PI. This method returns a double.
+
+Example:
+
+PI()
+
+### POWER
+
+```POWER(numeric, numeric)```
+
+See also Java Math.pow. This method returns a double.
+
+Example:
+
+POWER(A, B)
+
+### RAND / RANDOM
+
+```RAND | RANDOM([ int ])```
+
+Calling the function without parameter returns the next a pseudo random number. Calling it with an parameter seeds the session's random number generator. This method returns a double between 0 (including) and 1 (excluding).
+
+Example:
+
+RAND()
+
+### ROUND
+
+```ROUND(numeric[, digitsInt])```
+
+Rounds to a number of fractional digits. This method returns value of the same type as argument, but with adjusted precision and scale, if applicable.
+
+Example:
+
+ROUND(N, 2)
+
+### SIGN
+
+```SIGN(numeric)```
+
+Returns -1 if the value is smaller than 0, 0 if zero or NaN, and otherwise 1.
+
+Example:
+
+SIGN(N)
+
+### TRUNC
+
+```TRUNC | TRUNCATE(numeric[, digitsInt])```
+
+When a numeric argument is specified, truncates it to a number of digits (to the next value closer to 0) and returns value of the same type as argument, but with adjusted precision and scale, if applicable.
+
+Example:
+
+TRUNC(N, 2)
+
+## Time and Date Functions
+
+### CURRENT_DATE
+
+```CURRENT_DATE [()]```
+
+Returns the current date.
+
+These functions return the same value within a transaction (default) or within a command depending on database mode.
+
+Example:
+
+CURRENT_DATE
+
+### CURRENT_TIME
+
+```CURRENT_TIME [()]```
+
+Returns the current time with system time zone. The actual maximum available precision depends on operating system and JVM and can be 3 (milliseconds) or higher. Higher precision is not available before Java 9.
+
+Example:
+
+CURRENT_TIME
+
+### CURRENT_TIMESTAMP / NOW
+
+```CURRENT_TIMESTAMP[()] | NOW()```
+
+Returns the current timestamp with system time zone. The actual maximum available precision depends on operating system and JVM and can be 3 (milliseconds) or higher. Higher precision is not available before Java 9.
+
+Example:
+
+CURRENT_TIMESTAMP
+
+### DATEADD / TIMESTAMPADD
+
+```DATEADD| TIMESTAMPADD(dateAndTime, addIntLong, datetimeFieldString)```
+
+Adds units to a date-time value. The datetimeFieldString indicates the unit. Use negative values to subtract units. addIntLong may be a long value when manipulating milliseconds, microseconds, or nanoseconds otherwise its range is restricted to int. This method returns a value with the same type as specified value if unit is compatible with this value. If specified field is a HOUR, MINUTE, SECOND, MILLISECOND, etc and value is a DATE value DATEADD returns combined TIMESTAMP. Fields DAY, [...]
+
+Example:
+
+DATEADD(CREATED, 1, 'MONTH')
+
+### DATEDIFF
+
+```DATEDIFF(aDateAndTime, bDateAndTime, datetimeFieldString)```
+
+Returns the number of crossed unit boundaries between two date-time values. This method returns a long. The datetimeField indicates the unit.
+
+Example:
+
+DATEDIFF(T1.CREATED, T2.CREATED, 'MONTH')
+
+### DATE_TRUNC
+
+```DATE_TRUNC (dateAndTime, datetimeFieldString)```
+
+Truncates the specified date-time value to the specified field.
+
+Example:
+
+DATE_TRUNC(CREATED, 'DAY');
+
+### DAYNAME
+
+```DAYNAME(dateAndTime)```
+
+Returns the name of the day (in English).
+
+Example:
+
+DAYNAME(CREATED)
+
+### DAY_OF_MONTH
+
+```DAY_OF_MONTH(dateAndTime)```
+
+Returns the day of the month (1-31).
+
+Example:
+
+DAY_OF_MONTH(CREATED)
+
+### DAY_OF_WEEK
+
+```DAY_OF_WEEK(dateAndTime)```
+
+Returns the day of the week (1-7) (Monday-Sunday), locale-specific.
+
+Example:
+
+DAY_OF_WEEK(CREATED)
+
+### DAY_OF_YEAR
+
+```DAY_OF_YEAR(dateAndTime)```
+
+Returns the day of the year (1-366).
+
+Example:
+
+DAY_OF_YEAR(CREATED)
+
+### EXTRACT
+
+```EXTRACT ( datetimeField FROM dateAndTime)```
+
+Returns a value of the specific time unit from a date/time value. This method returns a numeric value with EPOCH field and an int for all other fields.
+
+Example:
+
+EXTRACT(SECOND FROM CURRENT_TIMESTAMP)
+
+### FORMATDATETIME
+
+```FORMATDATETIME (dateAndTime, formatString)```
+
+Formats a date, time or timestamp as a string. The most important format characters are: y year, M month, d day, H hour, m minute, s second. For details of the format, see java.time.format.DateTimeFormatter.
+
+This method returns a string.
+
+Example:
+
+CALL FORMATDATETIME(CREATED, 'yyyy-MM-dd HH:mm:ss')
+
+### HOUR
+
+```HOUR(dateAndTime)```
+
+Returns the hour (0-23) from a date/time value.
+
+Example:
+
+HOUR(CREATED)
+
+### MINUTE
+
+```MINUTE(dateAndTime)```
+
+Returns the minute (0-59) from a date/time value.
+
+This function is deprecated, use EXTRACT instead of it.
+
+Example:
+
+MINUTE(CREATED)
+
+### MONTH
+
+```MONTH(dateAndTime)```
+
+Returns the month (1-12) from a date/time value.
+
+This function is deprecated, use EXTRACT instead of it.
+
+Example:
+
+MONTH(CREATED)
+
+### MONTHNAME
+
+```MONTHNAME(dateAndTime)```
+
+Returns the name of the month (in English).
+
+Example:
+
+MONTHNAME(CREATED)
+
+### PARSEDATETIME / TO_DATE
+
+```PARSEDATETIME | TO_DATE(string, formatString)```
+Parses a string and returns a TIMESTAMP WITH TIME ZONE value. The most important format characters are: y year, M month, d day, H hour, m minute, s second. For details of the format, see java.time.format.DateTimeFormatter.
+
+Example:
+
+CALL PARSEDATETIME('2021-04-08 13:34:45','yyyy-MM-dd HH:mm:ss')
+
+### QUARTER
+
+```QUARTER(dateAndTime)```
+
+Returns the quarter (1-4) from a date/time value.
+
+Example:
+
+QUARTER(CREATED)
+
+### SECOND
+
+```SECOND(dateAndTime)```
+
+Returns the second (0-59) from a date/time value.
+
+This function is deprecated, use EXTRACT instead of it.
+
+Example:
+
+SECOND(CREATED)
+
+### WEEK
+
+```WEEK(dateAndTime)```
+
+Returns the week (1-53) from a date/time value.
+
+This function uses the current system locale.
+
+Example:
+
+WEEK(CREATED)
+
+### YEAR
+
+```YEAR(dateAndTime)```
+
+Returns the year from a date/time value.
+
+Example:
+
+YEAR(CREATED)
+
+## System Functions
+
+### CAST
+
+```CAST(value as dataType)```
+
+Converts a value to another data type.
+
+Supported data types: STRING | VARCHAR, INT | INTEGER, LONG | BIGINT, BYTE, FLOAT, DOUBLE, DECIMAL(p,s), TIMESTAMP, DATE, TIME
+
+Example:
+
+CONVERT(NAME AS INT)
+
+### COALESCE
+
+```COALESCE(aValue, bValue [,...])```
+
+Returns the first value that is not null.
+
+Example:
+
+COALESCE(A, B, C)
+
+### IFNULL
+
+```IFNULL(aValue, bValue)```
+
+Returns the first value that is not null.
+
+Example:
+
+IFNULL(A, B)
+
+### NULLIF
+
+```NULLIF(aValue, bValue)```
+
+Returns NULL if 'a' is equal to 'b', otherwise 'a'.
+
+Example:
+
+NULLIF(A, B)
diff --git a/docs/en/transform-v2/sql.md b/docs/en/transform-v2/sql.md
new file mode 100644
index 000000000..b6c2306c6
--- /dev/null
+++ b/docs/en/transform-v2/sql.md
@@ -0,0 +1,100 @@
+# SQL
+
+> SQL transform plugin
+
+## Description
+
+Use SQL to transform given input row.
+
+SQL transform use memory SQL engine, we can via SQL functions and ability of SQL engine to implement the transform task.
+
+## Options
+
+| name | type | required | default value |
+|-------------------|--------|----------|---------------|
+| source_table_name | string | yes | - |
+| result_table_name | string | yes | - |
+| query | string | yes | - |
+
+### source_table_name [string]
+
+The source table name, the query SQL table name must match this field.
+
+### query [string]
+
+The query SQL, it's a simple SQL supported base function and criteria filter operation. But the complex SQL unsupported yet, include: multi source table/rows JOIN and AGGREGATE operation and the like.
+
+## Example
+
+The data read from source is a table like this:
+
+| id | name | age |
+|----|----------|-----|
+| 1 | Joy Ding | 20 |
+| 2 | May Ding | 21 |
+| 3 | Kin Dom | 24 |
+| 4 | Joy Dom | 22 |
+
+We use SQL query to transform the source data like this:
+
+```
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select id, concat(name, '_') as name, age+1 as age from fake where id>0"
+ }
+}
+```
+
+Then the data in result table `fake1` will update to
+
+| id | name | age |
+|----|-----------|-----|
+| 1 | Joy Ding_ | 21 |
+| 2 | May Ding_ | 22 |
+| 3 | Kin Dom_ | 25 |
+| 4 | Joy Dom_ | 23 |
+
+## Job Config Example
+
+```
+env {
+ job.mode = "BATCH"
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ row.num = 100
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ age = "int"
+ }
+ }
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select id, concat(name, '_') as name, age+1 as age from fake where id>0"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+}
+```
+
+## Changelog
+
+### new version
+
+- Add SQL Transform Connector
+
diff --git a/pom.xml b/pom.xml
index 42f2d6c1d..6b11c0c44 100644
--- a/pom.xml
+++ b/pom.xml
@@ -126,6 +126,7 @@
<maven-scm-provider-jgit.version>1.9.5</maven-scm-provider-jgit.version>
<testcontainer.version>1.17.3</testcontainer.version>
<spotless.version>2.29.0</spotless.version>
+ <jsqlparser.version>4.5</jsqlparser.version>
<!-- Option args -->
<skipUT>false</skipUT>
<skipIT>true</skipIT>
diff --git a/release-note.md b/release-note.md
index 3f0bb6017..b309cf640 100644
--- a/release-note.md
+++ b/release-note.md
@@ -11,6 +11,7 @@
### Transformer
- [Spark] Support transform-v2 for spark (#3409)
- [ALL]Add FieldMapper Transform #3781
+- [ALL]Add SQL Transform #4148
### Connectors
- [Elasticsearch] Support https protocol & compatible with opensearch
- [Hbase] Add hbase sink connector #4049
diff --git a/seatunnel-api/src/main/java/org/apache/seatunnel/api/transform/SeaTunnelTransform.java b/seatunnel-api/src/main/java/org/apache/seatunnel/api/transform/SeaTunnelTransform.java
index 452e903f9..292486f7d 100644
--- a/seatunnel-api/src/main/java/org/apache/seatunnel/api/transform/SeaTunnelTransform.java
+++ b/seatunnel-api/src/main/java/org/apache/seatunnel/api/transform/SeaTunnelTransform.java
@@ -30,6 +30,9 @@ public interface SeaTunnelTransform<T>
SeaTunnelPluginLifeCycle,
SeaTunnelJobAware {
+ /** call it when Transformer initialed */
+ default void open() {}
+
/**
* Set the data type info of input data.
*
@@ -51,4 +54,7 @@ public interface SeaTunnelTransform<T>
* @return transformed data.
*/
T map(T row);
+
+ /** call it when Transformer completed */
+ default void close() {}
}
diff --git a/seatunnel-connectors-v2/connector-assert/src/main/java/org/apache/seatunnel/connectors/seatunnel/assertion/excecutor/AssertExecutor.java b/seatunnel-connectors-v2/connector-assert/src/main/java/org/apache/seatunnel/connectors/seatunnel/assertion/excecutor/AssertExecutor.java
index 01eb69661..c8666cd9a 100644
--- a/seatunnel-connectors-v2/connector-assert/src/main/java/org/apache/seatunnel/connectors/seatunnel/assertion/excecutor/AssertExecutor.java
+++ b/seatunnel-connectors-v2/connector-assert/src/main/java/org/apache/seatunnel/connectors/seatunnel/assertion/excecutor/AssertExecutor.java
@@ -27,6 +27,12 @@ import org.apache.commons.lang3.StringUtils;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.LocalTime;
+import java.time.format.DateTimeFormatter;
+import java.time.temporal.TemporalAccessor;
+import java.time.temporal.TemporalQueries;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
@@ -101,6 +107,33 @@ public class AssertExecutor {
&& AssertFieldRule.AssertRuleType.MIN.equals(valueRule.getRuleType())) {
return ((Number) value).doubleValue() >= valueRule.getRuleValue();
}
+ if (valueRule.getEqualTo() != null) {
+ if (value instanceof String) {
+ return value.equals(valueRule.getEqualTo());
+ }
+ if (value instanceof Number) {
+ return ((Number) value).doubleValue() == Double.parseDouble(valueRule.getEqualTo());
+ }
+ if (value instanceof Boolean) {
+ return value.equals(Boolean.parseBoolean(valueRule.getEqualTo()));
+ }
+ if (value instanceof LocalDateTime) {
+ TemporalAccessor parsedTimestamp =
+ DateTimeFormatter.ISO_LOCAL_DATE_TIME.parse(valueRule.getEqualTo());
+ LocalTime localTime = parsedTimestamp.query(TemporalQueries.localTime());
+ LocalDate localDate = parsedTimestamp.query(TemporalQueries.localDate());
+ return ((LocalDateTime) value).isEqual(LocalDateTime.of(localDate, localTime));
+ }
+ if (value instanceof LocalDate) {
+ DateTimeFormatter fmt = DateTimeFormatter.ofPattern("yyyy-MM-dd");
+ return ((LocalDate) value).isEqual(LocalDate.parse(valueRule.getEqualTo(), fmt));
+ }
+ if (value instanceof LocalTime) {
+ DateTimeFormatter fmt = DateTimeFormatter.ofPattern("HH:mm:ss");
+ return value.equals(LocalTime.parse(valueRule.getEqualTo(), fmt));
+ }
+ return false;
+ }
String valueStr = Objects.isNull(value) ? StringUtils.EMPTY : String.valueOf(value);
if (AssertFieldRule.AssertRuleType.MAX_LENGTH.equals(valueRule.getRuleType())) {
diff --git a/seatunnel-connectors-v2/connector-assert/src/main/java/org/apache/seatunnel/connectors/seatunnel/assertion/rule/AssertFieldRule.java b/seatunnel-connectors-v2/connector-assert/src/main/java/org/apache/seatunnel/connectors/seatunnel/assertion/rule/AssertFieldRule.java
index 187228e95..12d2e28ba 100644
--- a/seatunnel-connectors-v2/connector-assert/src/main/java/org/apache/seatunnel/connectors/seatunnel/assertion/rule/AssertFieldRule.java
+++ b/seatunnel-connectors-v2/connector-assert/src/main/java/org/apache/seatunnel/connectors/seatunnel/assertion/rule/AssertFieldRule.java
@@ -34,6 +34,7 @@ public class AssertFieldRule implements Serializable {
public static class AssertRule implements Serializable {
private AssertRuleType ruleType;
private Double ruleValue;
+ private String equalTo;
}
/**
diff --git a/seatunnel-connectors-v2/connector-assert/src/main/java/org/apache/seatunnel/connectors/seatunnel/assertion/rule/AssertRuleParser.java b/seatunnel-connectors-v2/connector-assert/src/main/java/org/apache/seatunnel/connectors/seatunnel/assertion/rule/AssertRuleParser.java
index 13893e726..f479dfa5c 100644
--- a/seatunnel-connectors-v2/connector-assert/src/main/java/org/apache/seatunnel/connectors/seatunnel/assertion/rule/AssertRuleParser.java
+++ b/seatunnel-connectors-v2/connector-assert/src/main/java/org/apache/seatunnel/connectors/seatunnel/assertion/rule/AssertRuleParser.java
@@ -20,6 +20,7 @@ package org.apache.seatunnel.connectors.seatunnel.assertion.rule;
import org.apache.seatunnel.shade.com.typesafe.config.Config;
import org.apache.seatunnel.api.table.type.BasicType;
+import org.apache.seatunnel.api.table.type.LocalTimeType;
import org.apache.seatunnel.api.table.type.SeaTunnelDataType;
import com.google.common.collect.Maps;
@@ -28,6 +29,7 @@ import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
+import static org.apache.seatunnel.connectors.seatunnel.assertion.sink.AssertConfig.EQUALS_TO;
import static org.apache.seatunnel.connectors.seatunnel.assertion.sink.AssertConfig.FIELD_NAME;
import static org.apache.seatunnel.connectors.seatunnel.assertion.sink.AssertConfig.FIELD_TYPE;
import static org.apache.seatunnel.connectors.seatunnel.assertion.sink.AssertConfig.FIELD_VALUE;
@@ -75,6 +77,9 @@ public class AssertRuleParser {
if (config.hasPath(RULE_VALUE)) {
valueRule.setRuleValue(config.getDouble(RULE_VALUE));
}
+ if (config.hasPath(EQUALS_TO)) {
+ valueRule.setEqualTo(config.getString(EQUALS_TO));
+ }
return valueRule;
})
.collect(Collectors.toList());
@@ -96,5 +101,9 @@ public class AssertRuleParser {
TYPES.put("float", BasicType.FLOAT_TYPE);
TYPES.put("double", BasicType.DOUBLE_TYPE);
TYPES.put("void", BasicType.VOID_TYPE);
+ TYPES.put("timestamp", LocalTimeType.LOCAL_DATE_TIME_TYPE);
+ TYPES.put("datetime", LocalTimeType.LOCAL_DATE_TIME_TYPE);
+ TYPES.put("date", LocalTimeType.LOCAL_DATE_TYPE);
+ TYPES.put("time", LocalTimeType.LOCAL_TIME_TYPE);
}
}
diff --git a/seatunnel-connectors-v2/connector-assert/src/main/java/org/apache/seatunnel/connectors/seatunnel/assertion/sink/AssertConfig.java b/seatunnel-connectors-v2/connector-assert/src/main/java/org/apache/seatunnel/connectors/seatunnel/assertion/sink/AssertConfig.java
index d27b3b126..3e3da9f68 100644
--- a/seatunnel-connectors-v2/connector-assert/src/main/java/org/apache/seatunnel/connectors/seatunnel/assertion/sink/AssertConfig.java
+++ b/seatunnel-connectors-v2/connector-assert/src/main/java/org/apache/seatunnel/connectors/seatunnel/assertion/sink/AssertConfig.java
@@ -26,6 +26,8 @@ public class AssertConfig {
public static final String RULE_VALUE = "rule_value";
+ public static final String EQUALS_TO = "equals_to";
+
public static final String ROW_RULES = "row_rules";
public static final String FIELD_NAME = "field_name";
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/java/org/apache/seatunnel/e2e/transform/TestSQLIT.java b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/java/org/apache/seatunnel/e2e/transform/TestSQLIT.java
new file mode 100644
index 000000000..ba923e825
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/java/org/apache/seatunnel/e2e/transform/TestSQLIT.java
@@ -0,0 +1,313 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.seatunnel.e2e.transform;
+
+import org.apache.seatunnel.e2e.common.container.TestContainer;
+import org.apache.seatunnel.e2e.common.container.spark.AbstractTestSparkContainer;
+
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.TestTemplate;
+import org.testcontainers.containers.Container;
+
+import java.io.IOException;
+
+public class TestSQLIT extends TestSuiteBase {
+
+ @TestTemplate
+ public void testSQL(TestContainer container) throws IOException, InterruptedException {
+ if (container instanceof AbstractTestSparkContainer) {
+ return; // skip test for spark, because some problems of Timestamp convert unresolved.
+ }
+
+ Container.ExecResult execResult = container.executeJob("/sql_transform.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ // -------------binary expression-------------
+ execResult = container.executeJob("/sql_functions/binary_expression.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ // -------------start test functions-------------
+ execResult = container.executeJob("/sql_functions/func_ascii.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_bit_length.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_char_length.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_octet_length.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_chr.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_concat.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_hextoraw.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_rawtohex.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_insert.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_lower.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_upper.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_left.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_right.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_lpad.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_rpad.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_ltrim.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_rtrim.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_trim.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_regexp_replace.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_regexp_like.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_regexp_substr.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_repeat.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_replace.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_soundex.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_space.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_substr.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_to_char.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_translate.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_abs.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_acos.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_asin.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_atan.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_cos.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_cosh.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_sin.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_sinh.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_tan.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_tanh.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_mod.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_ceil.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_exp.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_floor.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_ln.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_log.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_log10.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_radians.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_sqrt.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_pi.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_power.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_rand.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_round.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_sign.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_trunc.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_current_date.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_current_time.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_current_timestamp.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_dateadd.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_datediff.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_date_trunc.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_dayname.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_day_of_week.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_day_of_year.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_extract.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_formatdatetime.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_hour.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_minute.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_month.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_monthname.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_parsedatetime.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_quarter.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_second.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_week.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_year.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_cast.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_coalesce.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_ifnull.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/func_nullif.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ // -------------start test filter-------------
+ execResult = container.executeJob("/sql_functions/filter_equals_to.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/filter_not_equals_to.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/filter_great_than.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/filter_great_than_equals.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/filter_minor_than.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/filter_minor_than_equals.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/filter_is_null.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/filter_is_not_null.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/filter_in.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/filter_not_in.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/filter_function.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ execResult = container.executeJob("/sql_functions/filter_and_or.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+ }
+}
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/binary_expression.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/binary_expression.conf
new file mode 100644
index 000000000..595e9ea5f
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/binary_expression.conf
@@ -0,0 +1,104 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ price = "double"
+ }
+ }
+ rows = [
+ { fields = [1, "Joy Ding", 134.22], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select id+1 as id, id*4 as id2, price/3 as price, price-34.22 as price2, price%23.12 as price3, name||'_'||id as name from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "id"
+ field_type = "int"
+ field_value = [
+ { equals_to = 2 }
+ ]
+ },
+ {
+ field_name = "id2"
+ field_type = "int"
+ field_value = [
+ { equals_to = 4 }
+ ]
+ },
+ {
+ field_name = "price"
+ field_type = "double"
+ field_value = [
+ { equals_to = 44.74 }
+ ]
+ },
+ {
+ field_name = "price2"
+ field_type = "double"
+ field_value = [
+ { equals_to = 100 }
+ ]
+ },
+ {
+ field_name = "price3"
+ field_type = "double"
+ field_value = [
+ { equals_to = 18.619999999999994 }
+ ]
+ },
+ {
+ field_name = "name"
+ field_type = "string"
+ field_value = [
+ { equals_to = "Joy Ding_1" }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/filter_and_or.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/filter_and_or.conf
new file mode 100644
index 000000000..3a125426d
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/filter_and_or.conf
@@ -0,0 +1,73 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ age = "int"
+ }
+ }
+ rows = [
+ { fields = [1, "Joy Ding", 20], kind = INSERT }
+ { fields = [2, "May Ding", 22], kind = INSERT }
+ { fields = [3, "Kin Dom", 21], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select id,name,age from fake where name<>'Kin Dom' and (id=1 or age<22)"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules =
+ {
+ row_rules = [
+ {
+ rule_type = MIN_ROW
+ rule_value = 1
+ },
+ {
+ rule_type = MAX_ROW
+ rule_value = 1
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/filter_equals_to.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/filter_equals_to.conf
new file mode 100644
index 000000000..647de59df
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/filter_equals_to.conf
@@ -0,0 +1,72 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ age = "int"
+ }
+ }
+ rows = [
+ { fields = [1, "Joy Ding", 20], kind = INSERT }
+ { fields = [2, "May Ding", 22], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select id,name,age from fake where id=1"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules =
+ {
+ row_rules = [
+ {
+ rule_type = MIN_ROW
+ rule_value = 1
+ },
+ {
+ rule_type = MAX_ROW
+ rule_value = 1
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/filter_function.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/filter_function.conf
new file mode 100644
index 000000000..eebedf771
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/filter_function.conf
@@ -0,0 +1,72 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ age = "int"
+ }
+ }
+ rows = [
+ { fields = [1, "Joy Ding", 20], kind = INSERT }
+ { fields = [2, "May Ding", 22], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select id,name,age from fake where regexp_like(name, '[A-Z ]*')"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules =
+ {
+ row_rules = [
+ {
+ rule_type = MIN_ROW
+ rule_value = 2
+ },
+ {
+ rule_type = MAX_ROW
+ rule_value = 2
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/filter_great_than.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/filter_great_than.conf
new file mode 100644
index 000000000..1ed18af6e
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/filter_great_than.conf
@@ -0,0 +1,72 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ age = "int"
+ }
+ }
+ rows = [
+ { fields = [1, "Joy Ding", 20], kind = INSERT }
+ { fields = [2, "May Ding", 22], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select id,name,age from fake where id>1"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules =
+ {
+ row_rules = [
+ {
+ rule_type = MIN_ROW
+ rule_value = 1
+ },
+ {
+ rule_type = MAX_ROW
+ rule_value = 1
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/filter_great_than_equals.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/filter_great_than_equals.conf
new file mode 100644
index 000000000..a8f49794e
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/filter_great_than_equals.conf
@@ -0,0 +1,72 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ age = "int"
+ }
+ }
+ rows = [
+ { fields = [1, "Joy Ding", 20], kind = INSERT }
+ { fields = [2, "May Ding", 22], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select id,name,age from fake where id>=2"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules =
+ {
+ row_rules = [
+ {
+ rule_type = MIN_ROW
+ rule_value = 1
+ },
+ {
+ rule_type = MAX_ROW
+ rule_value = 1
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/filter_in.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/filter_in.conf
new file mode 100644
index 000000000..18d159744
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/filter_in.conf
@@ -0,0 +1,73 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ age = "int"
+ }
+ }
+ rows = [
+ { fields = [1, "Joy Ding", 20], kind = INSERT }
+ { fields = [2, "May Ding", 22], kind = INSERT }
+ { fields = [3, "Kin Dom", 21], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select id,name,age from fake where id in (1,2)"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules =
+ {
+ row_rules = [
+ {
+ rule_type = MIN_ROW
+ rule_value = 2
+ },
+ {
+ rule_type = MAX_ROW
+ rule_value = 2
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/filter_is_not_null.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/filter_is_not_null.conf
new file mode 100644
index 000000000..dedad35c8
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/filter_is_not_null.conf
@@ -0,0 +1,72 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ age = "int"
+ }
+ }
+ rows = [
+ { fields = [1, "Joy Ding", 20], kind = INSERT }
+ { fields = [2, null, 22], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select id,name,age from fake where name is not null"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules =
+ {
+ row_rules = [
+ {
+ rule_type = MIN_ROW
+ rule_value = 1
+ },
+ {
+ rule_type = MAX_ROW
+ rule_value = 1
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/filter_is_null.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/filter_is_null.conf
new file mode 100644
index 000000000..8a9d5f6d7
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/filter_is_null.conf
@@ -0,0 +1,72 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ age = "int"
+ }
+ }
+ rows = [
+ { fields = [1, "Joy Ding", 20], kind = INSERT }
+ { fields = [2, null, 22], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select id,name,age from fake where name is null"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules =
+ {
+ row_rules = [
+ {
+ rule_type = MIN_ROW
+ rule_value = 1
+ },
+ {
+ rule_type = MAX_ROW
+ rule_value = 1
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/filter_minor_than.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/filter_minor_than.conf
new file mode 100644
index 000000000..37d98e910
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/filter_minor_than.conf
@@ -0,0 +1,72 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ age = "int"
+ }
+ }
+ rows = [
+ { fields = [1, "Joy Ding", 20], kind = INSERT }
+ { fields = [2, "May Ding", 22], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select id,name,age from fake where id<2"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules =
+ {
+ row_rules = [
+ {
+ rule_type = MIN_ROW
+ rule_value = 1
+ },
+ {
+ rule_type = MAX_ROW
+ rule_value = 1
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/filter_minor_than_equals.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/filter_minor_than_equals.conf
new file mode 100644
index 000000000..3f4762eb6
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/filter_minor_than_equals.conf
@@ -0,0 +1,72 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ age = "int"
+ }
+ }
+ rows = [
+ { fields = [1, "Joy Ding", 20], kind = INSERT }
+ { fields = [2, "May Ding", 22], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select id,name,age from fake where id<=1"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules =
+ {
+ row_rules = [
+ {
+ rule_type = MIN_ROW
+ rule_value = 1
+ },
+ {
+ rule_type = MAX_ROW
+ rule_value = 1
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/filter_not_equals_to.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/filter_not_equals_to.conf
new file mode 100644
index 000000000..90a21dce5
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/filter_not_equals_to.conf
@@ -0,0 +1,72 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ age = "int"
+ }
+ }
+ rows = [
+ { fields = [1, "Joy Ding", 20], kind = INSERT }
+ { fields = [2, "May Ding", 22], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select id,name,age from fake where id<>1"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules =
+ {
+ row_rules = [
+ {
+ rule_type = MIN_ROW
+ rule_value = 1
+ },
+ {
+ rule_type = MAX_ROW
+ rule_value = 1
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/filter_not_in.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/filter_not_in.conf
new file mode 100644
index 000000000..141be6b5a
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/filter_not_in.conf
@@ -0,0 +1,73 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ age = "int"
+ }
+ }
+ rows = [
+ { fields = [1, "Joy Ding", 20], kind = INSERT }
+ { fields = [2, "May Ding", 22], kind = INSERT }
+ { fields = [3, "Kin Dom", 21], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select id,name,age from fake where id not in (1,2)"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules =
+ {
+ row_rules = [
+ {
+ rule_type = MIN_ROW
+ rule_value = 1
+ },
+ {
+ rule_type = MAX_ROW
+ rule_value = 1
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_abs.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_abs.conf
new file mode 100644
index 000000000..d7a0d9e04
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_abs.conf
@@ -0,0 +1,76 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ price = "double"
+ }
+ }
+ rows = [
+ { fields = [-1, "book", -120.72], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select abs(id) as id, abs(price) as price from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "id"
+ field_type = "int"
+ field_value = [
+ { equals_to = 1 }
+ ]
+ }
+ {
+ field_name = "price"
+ field_type = "double"
+ field_value = [
+ { equals_to = 120.72 }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_acos.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_acos.conf
new file mode 100644
index 000000000..403a58d25
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_acos.conf
@@ -0,0 +1,69 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ age = "int"
+ }
+ }
+ rows = [
+ { fields = [1, "Joy Ding", 13], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select acos(id) as id from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "id"
+ field_type = "double"
+ field_value = [
+ { equals_to = 0 }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_ascii.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_ascii.conf
new file mode 100644
index 000000000..9595753d1
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_ascii.conf
@@ -0,0 +1,84 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ test1 = "string"
+ test2 = "string"
+ test3 = "string"
+ }
+ }
+ rows = [
+ { fields = [1, "A", "b" , "&"], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select ascii(test1) as test1, ascii(test2) as test2, ascii(test3) as test3 from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "test1"
+ field_type = "int"
+ field_value = [
+ { equals_to = 65 }
+ ]
+ },
+ {
+ field_name = "test2"
+ field_type = "int"
+ field_value = [
+ { equals_to = 98 }
+ ]
+ },
+ {
+ field_name = "test3"
+ field_type = "int"
+ field_value = [
+ { equals_to = 38 }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_asin.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_asin.conf
new file mode 100644
index 000000000..fbe33e0f0
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_asin.conf
@@ -0,0 +1,69 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ age = "int"
+ }
+ }
+ rows = [
+ { fields = [0, "Joy Ding", 13], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select asin(id) as id from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "id"
+ field_type = "double"
+ field_value = [
+ { equals_to = 0 }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_atan.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_atan.conf
new file mode 100644
index 000000000..72c73a3e1
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_atan.conf
@@ -0,0 +1,69 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "double"
+ name = "string"
+ age = "int"
+ }
+ }
+ rows = [
+ { fields = [0, "Joy Ding", 13], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select atan(id) as id from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "id"
+ field_type = "double"
+ field_value = [
+ { equals_to = 0.0 }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_bit_length.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_bit_length.conf
new file mode 100644
index 000000000..0bcceacd6
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_bit_length.conf
@@ -0,0 +1,84 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ test1 = "string"
+ test2 = "string"
+ test3 = "string"
+ }
+ }
+ rows = [
+ { fields = [1, "A", "My test" , "&^^$wef9"], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select bit_length(test1) as test1, bit_length(test2) as test2, bit_length(test3) as test3 from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "test1"
+ field_type = "long"
+ field_value = [
+ { equals_to = 8 }
+ ]
+ },
+ {
+ field_name = "test2"
+ field_type = "long"
+ field_value = [
+ { equals_to = 56 }
+ ]
+ },
+ {
+ field_name = "test3"
+ field_type = "long"
+ field_value = [
+ { equals_to = 64 }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_cast.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_cast.conf
new file mode 100644
index 000000000..7961c2ffd
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_cast.conf
@@ -0,0 +1,104 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "bigint"
+ name = "string"
+ c_time = "timestamp"
+ }
+ }
+ rows = [
+ { fields = [1, "12.4", "2012-12-21T12:34:56"], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select cast(id as STRING) as id, cast(id as INT) as id2, cast(id as DOUBLE) as id3 , cast(name as double) as name, cast(name as DECIMAL(10,2)) as name2, cast(c_time as DATE) as c_time, cast(c_time as time) as c_time2 from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "id"
+ field_type = "string"
+ field_value = [
+ { equals_to = "1" }
+ ]
+ },
+ {
+ field_name = "id2"
+ field_type = "int"
+ field_value = [
+ { equals_to = 1 }
+ ]
+ },
+ {
+ field_name = "id3"
+ field_type = "double"
+ field_value = [
+ { equals_to = 1 }
+ ]
+ },
+ {
+ field_name = "name"
+ field_type = "double"
+ field_value = [
+ { equals_to = 12.4 }
+ ]
+ },
+ {
+ field_name = "c_time"
+ field_type = "date"
+ field_value = [
+ { equals_to = "2012-12-21" }
+ ]
+ },
+ {
+ field_name = "c_time2"
+ field_type = "time"
+ field_value = [
+ { equals_to = "12:34:56" }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_ceil.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_ceil.conf
new file mode 100644
index 000000000..68404a2e2
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_ceil.conf
@@ -0,0 +1,76 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ price = "double"
+ }
+ }
+ rows = [
+ { fields = [4, "Joy Ding", 13.2], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select ceil(id) as id, ceiling(price) as price from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "id"
+ field_type = "int"
+ field_value = [
+ { equals_to = 4 }
+ ]
+ }
+ {
+ field_name = "price"
+ field_type = "int"
+ field_value = [
+ { equals_to = 14 }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_char_length.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_char_length.conf
new file mode 100644
index 000000000..19bffde19
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_char_length.conf
@@ -0,0 +1,84 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ test1 = "string"
+ test2 = "string"
+ test3 = "string"
+ }
+ }
+ rows = [
+ { fields = [1, "A", "My test" , "&^^$wef9"], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select char_length(test1) as test1, char_length(test2) as test2, length(test3) as test3 from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "test1"
+ field_type = "long"
+ field_value = [
+ { equals_to = 1 }
+ ]
+ },
+ {
+ field_name = "test2"
+ field_type = "long"
+ field_value = [
+ { equals_to = 7 }
+ ]
+ },
+ {
+ field_name = "test3"
+ field_type = "long"
+ field_value = [
+ { equals_to = 8 }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_chr.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_chr.conf
new file mode 100644
index 000000000..db30093cf
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_chr.conf
@@ -0,0 +1,84 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ test1 = "int"
+ test2 = "int"
+ test3 = "int"
+ }
+ }
+ rows = [
+ { fields = [1, 65, 98 , 38], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select chr(test1) as test1, char(test2) as test2, char(test3) as test3 from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "test1"
+ field_type = "string"
+ field_value = [
+ { equals_to = "A" }
+ ]
+ },
+ {
+ field_name = "test2"
+ field_type = "string"
+ field_value = [
+ { equals_to = "b" }
+ ]
+ },
+ {
+ field_name = "test3"
+ field_type = "string"
+ field_value = [
+ { equals_to = "&" }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_coalesce.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_coalesce.conf
new file mode 100644
index 000000000..f1dd93d2e
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_coalesce.conf
@@ -0,0 +1,69 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ c_time = "timestamp"
+ }
+ }
+ rows = [
+ { fields = [1, null, "2021-04-08T13:34:45.235"], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select coalesce(name,'Unknown') test1 from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "test1"
+ field_type = "string"
+ field_value = [
+ { equals_to = "Unknown" }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_concat.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_concat.conf
new file mode 100644
index 000000000..b130e569a
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_concat.conf
@@ -0,0 +1,76 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ age = "int"
+ }
+ }
+ rows = [
+ { fields = [null, "Joy Ding", 15 ], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select concat(name,'_',age) as name, concat(name,id,'!') as name2 from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "name"
+ field_type = "string"
+ field_value = [
+ { equals_to = "Joy Ding_15" }
+ ]
+ },
+ {
+ field_name = "name2"
+ field_type = "string"
+ field_value = [
+ { equals_to = "Joy Ding!" }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_concat_ws.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_concat_ws.conf
new file mode 100644
index 000000000..5dc5efe1c
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_concat_ws.conf
@@ -0,0 +1,76 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ age = "int"
+ }
+ }
+ rows = [
+ { fields = [null, "Joy Ding", 15 ], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select concat_ws('_',name,age) as name, concat_ws('_',name,id,'!') as name2 from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "name"
+ field_type = "string"
+ field_value = [
+ { equals_to = "Joy Ding_15" }
+ ]
+ },
+ {
+ field_name = "name2"
+ field_type = "string"
+ field_value = [
+ { equals_to = "Joy Ding_!" }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_cos.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_cos.conf
new file mode 100644
index 000000000..74afb29e4
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_cos.conf
@@ -0,0 +1,69 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "double"
+ name = "string"
+ age = "int"
+ }
+ }
+ rows = [
+ { fields = [0, "Joy Ding", 13], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select cos(id) as id from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "id"
+ field_type = "double"
+ field_value = [
+ { equals_to = 1 }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_cosh.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_cosh.conf
new file mode 100644
index 000000000..1e99bb986
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_cosh.conf
@@ -0,0 +1,69 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "double"
+ name = "string"
+ age = "int"
+ }
+ }
+ rows = [
+ { fields = [0, "Joy Ding", 13], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select cosh(id) as id from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "id"
+ field_type = "double"
+ field_value = [
+ { equals_to = 1 }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_cot.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_cot.conf
new file mode 100644
index 000000000..bfde0933c
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_cot.conf
@@ -0,0 +1,69 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "double"
+ name = "string"
+ age = "int"
+ }
+ }
+ rows = [
+ { fields = [4, "Joy Ding", 13], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select cot(pi()/id) as id from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "id"
+ field_type = "double"
+ field_value = [
+ { equals_to = 1.0000000000000002 }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_current_date.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_current_date.conf
new file mode 100644
index 000000000..0302a3580
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_current_date.conf
@@ -0,0 +1,76 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ age = "int"
+ }
+ }
+ rows = [
+ { fields = [1, "Joy Ding", 14], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select current_date as cd, current_date() as cd2 from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "cd"
+ field_type = "date"
+ field_value = [
+ { rule_type = NOT_NULL }
+ ]
+ }
+ {
+ field_name = "cd2"
+ field_type = "date"
+ field_value = [
+ { rule_type = NOT_NULL }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_current_time.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_current_time.conf
new file mode 100644
index 000000000..3dde98408
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_current_time.conf
@@ -0,0 +1,76 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ age = "int"
+ }
+ }
+ rows = [
+ { fields = [1, "Joy Ding", 14], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select current_time as ct, current_time() as ct2 from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "ct"
+ field_type = "time"
+ field_value = [
+ { rule_type = NOT_NULL }
+ ]
+ }
+ {
+ field_name = "ct2"
+ field_type = "time"
+ field_value = [
+ { rule_type = NOT_NULL }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_current_timestamp.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_current_timestamp.conf
new file mode 100644
index 000000000..c5360f22f
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_current_timestamp.conf
@@ -0,0 +1,83 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ age = "int"
+ }
+ }
+ rows = [
+ { fields = [1, "Joy Ding", 14], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select current_timestamp as cd, current_timestamp() as cd2, now() as now from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "cd"
+ field_type = "timestamp"
+ field_value = [
+ { rule_type = NOT_NULL }
+ ]
+ }
+ {
+ field_name = "cd2"
+ field_type = "timestamp"
+ field_value = [
+ { rule_type = NOT_NULL }
+ ]
+ }
+ {
+ field_name = "now"
+ field_type = "timestamp"
+ field_value = [
+ { rule_type = NOT_NULL }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_date_trunc.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_date_trunc.conf
new file mode 100644
index 000000000..f84cd2dfb
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_date_trunc.conf
@@ -0,0 +1,104 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ c_time = "timestamp"
+ }
+ }
+ rows = [
+ { fields = [1, "Joy Ding", "2021-04-15T13:34:45.235"], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select date_trunc(c_time, 'YEAR') as test1, date_trunc(c_time, 'MONTH') as test2, date_trunc(c_time, 'DAY') as test3, date_trunc(c_time, 'HOUR') as test4, date_trunc(c_time, 'MINUTE') as test5, date_trunc(c_time, 'SECOND') as test6 from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "test1"
+ field_type = "timestamp"
+ field_value = [
+ { equals_to = "2021-01-01T00:00:00" }
+ ]
+ }
+ {
+ field_name = "test2"
+ field_type = "timestamp"
+ field_value = [
+ { equals_to = "2021-04-01T00:00:00" }
+ ]
+ }
+ {
+ field_name = "test3"
+ field_type = "timestamp"
+ field_value = [
+ { equals_to = "2021-04-15T00:00:00" }
+ ]
+ }
+ {
+ field_name = "test4"
+ field_type = "timestamp"
+ field_value = [
+ { equals_to = "2021-04-15T13:00:00" }
+ ]
+ }
+ {
+ field_name = "test5"
+ field_type = "timestamp"
+ field_value = [
+ { equals_to = "2021-04-15T13:34:00" }
+ ]
+ }
+ {
+ field_name = "test6"
+ field_type = "timestamp"
+ field_value = [
+ { equals_to = "2021-04-15T13:34:45" }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_dateadd.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_dateadd.conf
new file mode 100644
index 000000000..580549acd
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_dateadd.conf
@@ -0,0 +1,111 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ c_time = "timestamp"
+ }
+ }
+ rows = [
+ { fields = [1, "Joy Ding", "2021-04-15T13:34:45"], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select dateadd(c_time, 1) as test1, dateadd(c_time, 40, 'DAY') as test2, dateadd(c_time, 2, 'YEAR') as test3, dateadd(c_time, 10, 'MONTH') as test4, dateadd(c_time, 13, 'HOUR') as test5, dateadd(c_time, 40, 'MINUTE') as test6, dateadd(c_time, 30, 'SECOND') as test7 from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "test1"
+ field_type = "timestamp"
+ field_value = [
+ { equals_to = "2021-04-16T13:34:45" }
+ ]
+ }
+ {
+ field_name = "test2"
+ field_type = "timestamp"
+ field_value = [
+ { equals_to = "2021-05-25T13:34:45" }
+ ]
+ }
+ {
+ field_name = "test3"
+ field_type = "timestamp"
+ field_value = [
+ { equals_to = "2023-04-15T13:34:45" }
+ ]
+ }
+ {
+ field_name = "test4"
+ field_type = "timestamp"
+ field_value = [
+ { equals_to = "2022-02-15T13:34:45" }
+ ]
+ }
+ {
+ field_name = "test5"
+ field_type = "timestamp"
+ field_value = [
+ { equals_to = "2021-04-16T02:34:45" }
+ ]
+ }
+ {
+ field_name = "test6"
+ field_type = "timestamp"
+ field_value = [
+ { equals_to = "2021-04-15T14:14:45" }
+ ]
+ }
+ {
+ field_name = "test7"
+ field_type = "timestamp"
+ field_value = [
+ { equals_to = "2021-04-15T13:35:15" }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_datediff.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_datediff.conf
new file mode 100644
index 000000000..790fd1b8a
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_datediff.conf
@@ -0,0 +1,112 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ c_time = "timestamp"
+ m_time = "timestamp"
+ }
+ }
+ rows = [
+ { fields = [1, "Joy Ding", "2021-04-15T13:34:45", "2022-01-23T12:34:56"], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select datediff(c_time, m_time) as test, datediff(c_time, m_time, 'DAY') as test1, datediff(c_time, m_time, 'YEAR') as test2, datediff(c_time, m_time, 'MONTH') as test3, datediff(c_time, m_time, 'HOUR') as test4, datediff(c_time, m_time, 'MINUTE') as test5, datediff(c_time, m_time, 'SECOND') as test6 from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "test"
+ field_type = "long"
+ field_value = [
+ { equals_to = 283 }
+ ]
+ }
+ {
+ field_name = "test1"
+ field_type = "long"
+ field_value = [
+ { equals_to = 283 }
+ ]
+ }
+ {
+ field_name = "test2"
+ field_type = "long"
+ field_value = [
+ { equals_to = 0 }
+ ]
+ }
+ {
+ field_name = "test3"
+ field_type = "long"
+ field_value = [
+ { equals_to = 9 }
+ ]
+ }
+ {
+ field_name = "test4"
+ field_type = "long"
+ field_value = [
+ { equals_to = 6791 }
+ ]
+ }
+ {
+ field_name = "test5"
+ field_type = "long"
+ field_value = [
+ { equals_to = 407460 }
+ ]
+ }
+ {
+ field_name = "test6"
+ field_type = "long"
+ field_value = [
+ { equals_to = 24447611 }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_day_of_month.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_day_of_month.conf
new file mode 100644
index 000000000..825ee3f0a
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_day_of_month.conf
@@ -0,0 +1,85 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ c_time = "timestamp"
+ c_time2 = "timestamp"
+ c_time3 = "timestamp"
+ }
+ }
+ rows = [
+ { fields = [1, "Joy Ding", "2021-04-08T13:34:45.235", "2022-06-17T13:34:45", "2023-01-23T13:34:45"], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select day_of_month(c_time) test1, day_of_month(c_time2) test2, day_of_month(c_time3) test3 from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "test1"
+ field_type = "int"
+ field_value = [
+ { equals_to = 8 }
+ ]
+ }
+ {
+ field_name = "test2"
+ field_type = "int"
+ field_value = [
+ { equals_to = 17 }
+ ]
+ }
+ {
+ field_name = "test3"
+ field_type = "int"
+ field_value = [
+ { equals_to = 23 }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_day_of_week.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_day_of_week.conf
new file mode 100644
index 000000000..d2c941611
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_day_of_week.conf
@@ -0,0 +1,88 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ c_time = "timestamp"
+ c_time2 = "timestamp"
+ c_time3 = "timestamp"
+ }
+ }
+ rows = [
+ { fields = [1, "Joy Ding", "2021-04-08T13:34:45.235", "2021-04-05T13:34:45", "2021-04-11T13:34:45"], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select day_of_week(c_time) test1, day_of_week(c_time2) test2, day_of_week(c_time3) test3 from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "test1"
+ field_type = "int"
+ field_value = [
+ # Thursday
+ { equals_to = 4 }
+ ]
+ }
+ {
+ field_name = "test2"
+ field_type = "int"
+ field_value = [
+ # Monday
+ { equals_to = 1 }
+ ]
+ }
+ {
+ field_name = "test3"
+ field_type = "int"
+ field_value = [
+ # Sunday
+ { equals_to = 7 }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_day_of_year.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_day_of_year.conf
new file mode 100644
index 000000000..68b22cbe6
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_day_of_year.conf
@@ -0,0 +1,85 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ c_time = "timestamp"
+ c_time2 = "timestamp"
+ c_time3 = "timestamp"
+ }
+ }
+ rows = [
+ { fields = [1, "Joy Ding", "2021-04-08T13:34:45.235", "2022-06-17T13:34:45", "2023-01-23T13:34:45"], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select day_of_year(c_time) test1, day_of_year(c_time2) test2, day_of_year(c_time3) test3 from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "test1"
+ field_type = "int"
+ field_value = [
+ { equals_to = 98 }
+ ]
+ }
+ {
+ field_name = "test2"
+ field_type = "int"
+ field_value = [
+ { equals_to = 168 }
+ ]
+ }
+ {
+ field_name = "test3"
+ field_type = "int"
+ field_value = [
+ { equals_to = 23 }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_dayname.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_dayname.conf
new file mode 100644
index 000000000..6e44ba49b
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_dayname.conf
@@ -0,0 +1,116 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ c_time = "timestamp"
+ c_time2 = "timestamp"
+ c_time3 = "timestamp"
+ c_time4 = "timestamp"
+ c_time5 = "timestamp"
+ c_time6 = "timestamp"
+ }
+ }
+ rows = [
+ { fields = [1, "Joy Ding", "2021-04-15T13:34:45.235", "2021-04-17T13:34:45", "2021-04-18T13:34:45", "2021-04-19T13:34:45", "2021-04-20T13:34:45", "2021-04-21T13:34:45", "2021-04-22T13:34:45"], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select dayname(c_time) as test1, dayname(to_date('2021-04-16','yyyy-MM-dd')) as test2, dayname(c_time2) as test3, dayname(c_time3) as test4, dayname(c_time4) as test5, dayname(c_time5) as test6, dayname(c_time6) as test7 from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "test1"
+ field_type = "string"
+ field_value = [
+ { equals_to = "Thursday" }
+ ]
+ }
+ {
+ field_name = "test2"
+ field_type = "string"
+ field_value = [
+ { equals_to = "Friday" }
+ ]
+ }
+ {
+ field_name = "test3"
+ field_type = "string"
+ field_value = [
+ { equals_to = "Saturday" }
+ ]
+ }
+ {
+ field_name = "test4"
+ field_type = "string"
+ field_value = [
+ { equals_to = "Sunday" }
+ ]
+ }
+ {
+ field_name = "test5"
+ field_type = "string"
+ field_value = [
+ { equals_to = "Monday" }
+ ]
+ }
+ {
+ field_name = "test6"
+ field_type = "string"
+ field_value = [
+ { equals_to = "Tuesday" }
+ ]
+ }
+ {
+ field_name = "test7"
+ field_type = "string"
+ field_value = [
+ { equals_to = "Wednesday" }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_exp.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_exp.conf
new file mode 100644
index 000000000..a0d961e5f
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_exp.conf
@@ -0,0 +1,69 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ age = "int"
+ }
+ }
+ rows = [
+ { fields = [2, "Joy Ding", 13], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select exp(id) as id from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "id"
+ field_type = "double"
+ field_value = [
+ { equals_to = 7.38905609893065 }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_extract.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_extract.conf
new file mode 100644
index 000000000..45871cc5f
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_extract.conf
@@ -0,0 +1,127 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ c_time = "timestamp"
+ c_time2 = "timestamp"
+ c_time3 = "timestamp"
+ }
+ }
+ rows = [
+ { fields = [1, "Joy Ding", "2021-04-08T13:34:45.235", "2022-06-17T13:34:45", "2023-01-23T13:34:45"], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select extract(YEAR FROM c_time) test1, extract(MONTH FROM c_time2) test2, extract(DAY FROM c_time3) test3, extract(HOUR FROM c_time) test4, extract(MINUTE from c_time) test5, extract(SECOND from c_time) test6, extract(MILLISECOND from c_time) test7, extract(DAYOFWEEK FROM c_time) test8, extract(DAYOFYEAR FROM c_time) test9 from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "test1"
+ field_type = "int"
+ field_value = [
+ { equals_to = 2021 }
+ ]
+ }
+ {
+ field_name = "test2"
+ field_type = "int"
+ field_value = [
+ { equals_to = 6 }
+ ]
+ }
+ {
+ field_name = "test3"
+ field_type = "int"
+ field_value = [
+ { equals_to = 23 }
+ ]
+ }
+ {
+ field_name = "test4"
+ field_type = "int"
+ field_value = [
+ { equals_to = 13 }
+ ]
+ }
+ {
+ field_name = "test5"
+ field_type = "int"
+ field_value = [
+ { equals_to = 34 }
+ ]
+ }
+ {
+ field_name = "test6"
+ field_type = "int"
+ field_value = [
+ { equals_to = 45 }
+ ]
+ }
+ {
+ field_name = "test7"
+ field_type = "int"
+ field_value = [
+ { equals_to = 235 }
+ ]
+ }
+ {
+ field_name = "test8"
+ field_type = "int"
+ field_value = [
+ { equals_to = 4 }
+ ]
+ }
+ {
+ field_name = "test9"
+ field_type = "int"
+ field_value = [
+ { equals_to = 98 }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_floor.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_floor.conf
new file mode 100644
index 000000000..ec7d29f25
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_floor.conf
@@ -0,0 +1,76 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ price = "double"
+ }
+ }
+ rows = [
+ { fields = [4, "Joy Ding", 13.2], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select floor(id) as id, floor(price) as price from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "id"
+ field_type = "int"
+ field_value = [
+ { equals_to = 4 }
+ ]
+ }
+ {
+ field_name = "price"
+ field_type = "int"
+ field_value = [
+ { equals_to = 13 }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_formatdatetime.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_formatdatetime.conf
new file mode 100644
index 000000000..fa4758faa
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_formatdatetime.conf
@@ -0,0 +1,83 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ c_time = "timestamp"
+ }
+ }
+ rows = [
+ { fields = [1, "Joy Ding", "2021-04-08T13:34:45.235"], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select formatdatetime(c_time,'yyyy-MM-dd HH:mm:ss.S') test1, formatdatetime(c_time,'yyyy-MM-dd') test2, formatdatetime(c_time,'HH:mm:ss.SSS') test3 from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "test1"
+ field_type = "string"
+ field_value = [
+ { equals_to = "2021-04-08 13:34:45.2" }
+ ]
+ }
+ {
+ field_name = "test2"
+ field_type = "string"
+ field_value = [
+ { equals_to = "2021-04-08" }
+ ]
+ }
+ {
+ field_name = "test3"
+ field_type = "string"
+ field_value = [
+ { equals_to = "13:34:45.235" }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_hextoraw.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_hextoraw.conf
new file mode 100644
index 000000000..f20510e79
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_hextoraw.conf
@@ -0,0 +1,76 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ test1 = "string"
+ test2 = "string"
+ }
+ }
+ rows = [
+ { fields = [1, "0031", "0037"], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select hextoraw(test1) as test1, hextoraw(test2) as test2 from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "test1"
+ field_type = "string"
+ field_value = [
+ { equals_to = "1" }
+ ]
+ },
+ {
+ field_name = "test2"
+ field_type = "string"
+ field_value = [
+ { equals_to = "7" }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_hour.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_hour.conf
new file mode 100644
index 000000000..48b69cb25
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_hour.conf
@@ -0,0 +1,69 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ c_time = "timestamp"
+ }
+ }
+ rows = [
+ { fields = [1, "Joy Ding", "2021-04-08T13:34:45.235"], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select hour(c_time) test1 from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "test1"
+ field_type = "int"
+ field_value = [
+ { equals_to = 13 }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_ifnull.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_ifnull.conf
new file mode 100644
index 000000000..ed121304b
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_ifnull.conf
@@ -0,0 +1,69 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ c_time = "timestamp"
+ }
+ }
+ rows = [
+ { fields = [1, null, "2021-04-08T13:34:45.235"], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select ifnull(name,'Unknown') test1 from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "test1"
+ field_type = "string"
+ field_value = [
+ { equals_to = "Unknown" }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_insert.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_insert.conf
new file mode 100644
index 000000000..f702ed13e
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_insert.conf
@@ -0,0 +1,76 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ age = "int"
+ }
+ }
+ rows = [
+ { fields = [null, "Joy Ding", 15 ], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select insert(name,1,1,'j') as name, insert(name,2,2,'**') as name2 from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "name"
+ field_type = "string"
+ field_value = [
+ { equals_to = "joy Ding" }
+ ]
+ },
+ {
+ field_name = "name2"
+ field_type = "string"
+ field_value = [
+ { equals_to = "J** Ding" }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_left.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_left.conf
new file mode 100644
index 000000000..cefa0824a
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_left.conf
@@ -0,0 +1,69 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ age = "int"
+ }
+ }
+ rows = [
+ { fields = [null, "Joy Ding", 15 ], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select left(name, 3) as name from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "name"
+ field_type = "string"
+ field_value = [
+ { equals_to = "Joy" }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_ln.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_ln.conf
new file mode 100644
index 000000000..4d9dddd50
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_ln.conf
@@ -0,0 +1,76 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ price = "double"
+ }
+ }
+ rows = [
+ { fields = [4, "Joy Ding", 13.2], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select ln(id) as id, ln(price) as price from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "id"
+ field_type = "double"
+ field_value = [
+ { equals_to = 1.3862943611198906 }
+ ]
+ }
+ {
+ field_name = "price"
+ field_type = "double"
+ field_value = [
+ { equals_to = 2.580216829592325 }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_locate.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_locate.conf
new file mode 100644
index 000000000..ddafca7c7
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_locate.conf
@@ -0,0 +1,83 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ age = "int"
+ }
+ }
+ rows = [
+ { fields = [null, "Joy Ding", 15 ], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select locate(' ', name, 2) as name, instr(name, ' ', 3) as name2, position(' ', name) as name3 from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "name"
+ field_type = "int"
+ field_value = [
+ { equals_to = 4 }
+ ]
+ },
+ {
+ field_name = "name2"
+ field_type = "int"
+ field_value = [
+ { equals_to = 4 }
+ ]
+ },
+ {
+ field_name = "name3"
+ field_type = "int"
+ field_value = [
+ { equals_to = 4 }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_log.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_log.conf
new file mode 100644
index 000000000..5a6faf09f
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_log.conf
@@ -0,0 +1,76 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ price = "double"
+ }
+ }
+ rows = [
+ { fields = [4, "Joy Ding", 13.2], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select log(2,id) as id, log(10,price) as price from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "id"
+ field_type = "double"
+ field_value = [
+ { equals_to = 2 }
+ ]
+ }
+ {
+ field_name = "price"
+ field_type = "double"
+ field_value = [
+ { equals_to = 1.1205739312058498 }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_log10.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_log10.conf
new file mode 100644
index 000000000..52554790a
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_log10.conf
@@ -0,0 +1,76 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ price = "double"
+ }
+ }
+ rows = [
+ { fields = [100, "Joy Ding", 1324.252], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select log10(id) as id, log10(price) as price from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "id"
+ field_type = "double"
+ field_value = [
+ { equals_to = 2 }
+ ]
+ }
+ {
+ field_name = "price"
+ field_type = "double"
+ field_value = [
+ { equals_to = 3.1219706375172507 }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_lower.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_lower.conf
new file mode 100644
index 000000000..2f8d2f042
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_lower.conf
@@ -0,0 +1,76 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ age = "int"
+ }
+ }
+ rows = [
+ { fields = [null, "Joy Ding", 15 ], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select lower(name) as name, lcase(name) as name2 from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "name"
+ field_type = "string"
+ field_value = [
+ { equals_to = "joy ding" }
+ ]
+ },
+ {
+ field_name = "name2"
+ field_type = "string"
+ field_value = [
+ { equals_to = "joy ding" }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_lpad.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_lpad.conf
new file mode 100644
index 000000000..6e4c48dcf
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_lpad.conf
@@ -0,0 +1,76 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ age = "int"
+ }
+ }
+ rows = [
+ { fields = [null, "Joy Ding", 15 ], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select lpad(name, 3) as name, lpad(name, 10, '*') as name2 from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "name"
+ field_type = "string"
+ field_value = [
+ { equals_to = "Joy" }
+ ]
+ },
+ {
+ field_name = "name2"
+ field_type = "string"
+ field_value = [
+ { equals_to = "**Joy Ding" }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_ltrim.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_ltrim.conf
new file mode 100644
index 000000000..af093b9b0
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_ltrim.conf
@@ -0,0 +1,76 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ email = "string"
+ }
+ }
+ rows = [
+ { fields = [null, " Joy Ding ", "*Joy_Ding@s.com" ], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select ltrim(name) as name, ltrim(email, '*') as email from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "name"
+ field_type = "string"
+ field_value = [
+ { equals_to = "Joy Ding " }
+ ]
+ },
+ {
+ field_name = "email"
+ field_type = "string"
+ field_value = [
+ { equals_to = "Joy_Ding@s.com" }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_minute.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_minute.conf
new file mode 100644
index 000000000..94ae9d69d
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_minute.conf
@@ -0,0 +1,69 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ c_time = "timestamp"
+ }
+ }
+ rows = [
+ { fields = [1, "Joy Ding", "2021-04-08T13:34:45.235"], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select minute(c_time) test1 from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "test1"
+ field_type = "int"
+ field_value = [
+ { equals_to = 34 }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_mod.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_mod.conf
new file mode 100644
index 000000000..13d9ba408
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_mod.conf
@@ -0,0 +1,83 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ age = "bigint"
+ }
+ }
+ rows = [
+ { fields = [4, "Joy Ding", 13], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select mod(id, 3) as id, mod(age, 5) as age, mod(age, 5.4) as age2 from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "id"
+ field_type = "int"
+ field_value = [
+ { equals_to = 1 }
+ ]
+ }
+ {
+ field_name = "age"
+ field_type = "int"
+ field_value = [
+ { equals_to = 3 }
+ ]
+ }
+ {
+ field_name = "age2"
+ field_type = "double"
+ field_value = [
+ { equals_to = 2.2 }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_month.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_month.conf
new file mode 100644
index 000000000..9e25a679c
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_month.conf
@@ -0,0 +1,69 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ c_time = "timestamp"
+ }
+ }
+ rows = [
+ { fields = [1, "Joy Ding", "2021-04-08T13:34:45.235"], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select month(c_time) test1 from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "test1"
+ field_type = "int"
+ field_value = [
+ { equals_to = 4 }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_monthname.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_monthname.conf
new file mode 100644
index 000000000..af201da5b
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_monthname.conf
@@ -0,0 +1,69 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ c_time = "timestamp"
+ }
+ }
+ rows = [
+ { fields = [1, "Joy Ding", "2021-04-08T13:34:45.235"], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select monthname(c_time,'yyyy-MM-dd HH:mm:ss.S') test1 from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "test1"
+ field_type = "string"
+ field_value = [
+ { equals_to = "April" }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_nullif.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_nullif.conf
new file mode 100644
index 000000000..3f76f31ea
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_nullif.conf
@@ -0,0 +1,76 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ c_time = "timestamp"
+ }
+ }
+ rows = [
+ { fields = [1, "Joy Ding", "2021-04-08T13:34:45.235"], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select ifnull(nullif(name,'Joy Ding'),'NULL') test1, nullif(name,'Joy Ding_') test2 from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "test1"
+ field_type = "string"
+ field_value = [
+ { equals_to = "NULL" }
+ ]
+ }
+ {
+ field_name = "test2"
+ field_type = "string"
+ field_value = [
+ { equals_to = "Joy Ding" }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_octet_length.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_octet_length.conf
new file mode 100644
index 000000000..a166e0e37
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_octet_length.conf
@@ -0,0 +1,76 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ test1 = "string"
+ test2 = "string"
+ }
+ }
+ rows = [
+ { fields = [1, "A", "My test"], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select octet_length(test1) as test1, octet_length(test2) as test2 from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "test1"
+ field_type = "long"
+ field_value = [
+ { equals_to = 1 }
+ ]
+ },
+ {
+ field_name = "test2"
+ field_type = "long"
+ field_value = [
+ { equals_to = 7 }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_parsedatetime.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_parsedatetime.conf
new file mode 100644
index 000000000..51dcb666f
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_parsedatetime.conf
@@ -0,0 +1,78 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ c_time = "string"
+ c_time2 = "string"
+ c_time3 = "string"
+ }
+ }
+ rows = [
+ { fields = [1, "Joy Ding", "2021-04-08 13:34:45.235", "2021-04-08"], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select parsedatetime(c_time,'yyyy-MM-dd HH:mm:ss.SSS') test1,to_date(c_time2,'yyyy-MM-dd') test2 from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "test1"
+ field_type = "timestamp"
+ field_value = [
+ { equals_to = "2021-04-08T13:34:45.235" }
+ ]
+ }
+ {
+ field_name = "test2"
+ field_type = "date"
+ field_value = [
+ { equals_to = "2021-04-08" }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_pi.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_pi.conf
new file mode 100644
index 000000000..d99de437c
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_pi.conf
@@ -0,0 +1,69 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ age = "int"
+ }
+ }
+ rows = [
+ { fields = [1, "Joy Ding", 14], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select pi() as pi from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "pi"
+ field_type = "double"
+ field_value = [
+ { equals_to = 3.141592653589793 }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_power.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_power.conf
new file mode 100644
index 000000000..df385fbca
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_power.conf
@@ -0,0 +1,76 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ price = "double"
+ }
+ }
+ rows = [
+ { fields = [4, "book", 13.45], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select power(id,3) as id, power(price,2) as price from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "id"
+ field_type = "double"
+ field_value = [
+ { equals_to = 64 }
+ ]
+ }
+ {
+ field_name = "price"
+ field_type = "double"
+ field_value = [
+ { equals_to = 180.90249999999997 }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_quarter.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_quarter.conf
new file mode 100644
index 000000000..76350d7e4
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_quarter.conf
@@ -0,0 +1,69 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ c_time = "timestamp"
+ }
+ }
+ rows = [
+ { fields = [1, "Joy Ding", "2021-04-08T13:34:45.235"], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select quarter(c_time) test1 from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "test1"
+ field_type = "int"
+ field_value = [
+ { equals_to = 2 }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_radians.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_radians.conf
new file mode 100644
index 000000000..6f72bd6b7
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_radians.conf
@@ -0,0 +1,69 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ age = "int"
+ }
+ }
+ rows = [
+ { fields = [180, "Joy Ding", 14], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select radians(id) as id from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "id"
+ field_type = "double"
+ field_value = [
+ { equals_to = 3.141592653589793 }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_rand.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_rand.conf
new file mode 100644
index 000000000..72f2228a8
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_rand.conf
@@ -0,0 +1,73 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ row.num = 500
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ }
+ }
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select rand() as rand from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "rand"
+ field_type = "double"
+ field_value = [
+ {
+ rule_type = MAX
+ rule_value = 1
+ }
+ {
+ rule_type = MIN
+ rule_value = 0
+ }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_rawtohex.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_rawtohex.conf
new file mode 100644
index 000000000..add30b161
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_rawtohex.conf
@@ -0,0 +1,76 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ test1 = "string"
+ test2 = "string"
+ }
+ }
+ rows = [
+ { fields = [1, "1", "7"], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select rawtohex(test1) as test1, rawtohex(test2) as test2 from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "test1"
+ field_type = "string"
+ field_value = [
+ { equals_to = "0031" }
+ ]
+ },
+ {
+ field_name = "test2"
+ field_type = "string"
+ field_value = [
+ { equals_to = "0037" }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_regexp_like.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_regexp_like.conf
new file mode 100644
index 000000000..1a217fb20
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_regexp_like.conf
@@ -0,0 +1,76 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ email = "string"
+ }
+ }
+ rows = [
+ { fields = [null, "Joy Ding", "Joy_WWWDing@s.com" ], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select regexp_like(name, '[A-Z ]*', 'i') as name, regexp_like(email, '[A-Z ]*', 'i') as email from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "name"
+ field_type = "boolean"
+ field_value = [
+ { equals_to = true }
+ ]
+ },
+ {
+ field_name = "email"
+ field_type = "boolean"
+ field_value = [
+ { equals_to = true }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_regexp_replace.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_regexp_replace.conf
new file mode 100644
index 000000000..4113938f0
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_regexp_replace.conf
@@ -0,0 +1,76 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ email = "string"
+ }
+ }
+ rows = [
+ { fields = [null, "Joy Ding", "Joy_WWWDing@s.com" ], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select regexp_replace(name, '.+', 'b') as name, regexp_replace(email, 'w+', 'W', 'i') as email from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "name"
+ field_type = "string"
+ field_value = [
+ { equals_to = "b" }
+ ]
+ },
+ {
+ field_name = "email"
+ field_type = "string"
+ field_value = [
+ { equals_to = "Joy_WDing@s.com" }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_regexp_substr.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_regexp_substr.conf
new file mode 100644
index 000000000..ec016427e
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_regexp_substr.conf
@@ -0,0 +1,76 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ c_date = "string"
+ }
+ }
+ rows = [
+ { fields = [null, "Joy Ding", "2020-10-01" ], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select regexp_substr(c_date, '\\d{4}') as c_year, regexp_substr(c_date, '(\\d{4})-(\\d{2})-(\\d{2})', 1, 1, null, 2) as c_month from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "c_year"
+ field_type = "string"
+ field_value = [
+ { equals_to = "2020" }
+ ]
+ },
+ {
+ field_name = "c_month"
+ field_type = "string"
+ field_value = [
+ { equals_to = "10" }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_repeat.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_repeat.conf
new file mode 100644
index 000000000..bdb26687b
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_repeat.conf
@@ -0,0 +1,69 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ age = "int"
+ }
+ }
+ rows = [
+ { fields = [null, "Joy Ding", 15 ], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select repeat(name||' ',3) as name from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "name"
+ field_type = "string"
+ field_value = [
+ { equals_to = "Joy Ding Joy Ding Joy Ding " }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_replace.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_replace.conf
new file mode 100644
index 000000000..7f874eb86
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_replace.conf
@@ -0,0 +1,76 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ age = "int"
+ }
+ }
+ rows = [
+ { fields = [null, "Joy Ding", 15 ], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select replace(name,' ') as name, replace(name,' ','_') as name2 from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "name"
+ field_type = "string"
+ field_value = [
+ { equals_to = "JoyDing" }
+ ]
+ }
+ {
+ field_name = "name2"
+ field_type = "string"
+ field_value = [
+ { equals_to = "Joy_Ding" }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_right.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_right.conf
new file mode 100644
index 000000000..a6d0146c4
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_right.conf
@@ -0,0 +1,69 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ age = "int"
+ }
+ }
+ rows = [
+ { fields = [null, "Joy Ding", 15 ], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select right(name, 4) as name from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "name"
+ field_type = "string"
+ field_value = [
+ { equals_to = "Ding" }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_round.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_round.conf
new file mode 100644
index 000000000..77c35b8a5
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_round.conf
@@ -0,0 +1,76 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ price = "double"
+ }
+ }
+ rows = [
+ { fields = [1, "book", 120.72124], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select round(price) as price, round(price,2) as price2 from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "price"
+ field_type = "double"
+ field_value = [
+ { equals_to = 121 }
+ ]
+ }
+ {
+ field_name = "price2"
+ field_type = "double"
+ field_value = [
+ { equals_to = 120.72 }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_rpad.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_rpad.conf
new file mode 100644
index 000000000..cada9b4ac
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_rpad.conf
@@ -0,0 +1,76 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ age = "int"
+ }
+ }
+ rows = [
+ { fields = [null, "Joy Ding", 15 ], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select rpad(name, 3) as name, rpad(name, 10, '*') as name2 from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "name"
+ field_type = "string"
+ field_value = [
+ { equals_to = "Joy" }
+ ]
+ },
+ {
+ field_name = "name2"
+ field_type = "string"
+ field_value = [
+ { equals_to = "Joy Ding**" }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_rtrim.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_rtrim.conf
new file mode 100644
index 000000000..4289887ce
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_rtrim.conf
@@ -0,0 +1,76 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ email = "string"
+ }
+ }
+ rows = [
+ { fields = [null, " Joy Ding ", "Joy_Ding@s.com*" ], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select rtrim(name) as name, rtrim(email, '*') as email from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "name"
+ field_type = "string"
+ field_value = [
+ { equals_to = " Joy Ding" }
+ ]
+ },
+ {
+ field_name = "email"
+ field_type = "string"
+ field_value = [
+ { equals_to = "Joy_Ding@s.com" }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_second.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_second.conf
new file mode 100644
index 000000000..9564b7884
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_second.conf
@@ -0,0 +1,69 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ c_time = "timestamp"
+ }
+ }
+ rows = [
+ { fields = [1, "Joy Ding", "2021-04-08T13:34:45.235"], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select second(c_time) test1 from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "test1"
+ field_type = "int"
+ field_value = [
+ { equals_to = 45 }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_sign.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_sign.conf
new file mode 100644
index 000000000..4cb87ead3
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_sign.conf
@@ -0,0 +1,92 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ price = "double"
+ price2 = "double"
+ price3 = "double"
+ }
+ }
+ rows = [
+ { fields = [1, "book", -0.23, 0, null], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select sign(id) as id, sign(price) as price, sign(price2) as price2, sign(price3) as price3 from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "id"
+ field_type = "int"
+ field_value = [
+ { equals_to = 1 }
+ ]
+ }
+ {
+ field_name = "price"
+ field_type = "int"
+ field_value = [
+ { equals_to = -1 }
+ ]
+ }
+ {
+ field_name = "price2"
+ field_type = "int"
+ field_value = [
+ { equals_to = 0 }
+ ]
+ }
+ {
+ field_name = "price3"
+ field_type = "int"
+ field_value = [
+ { equals_to = null }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_sin.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_sin.conf
new file mode 100644
index 000000000..f03f4de33
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_sin.conf
@@ -0,0 +1,69 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ age = "int"
+ }
+ }
+ rows = [
+ { fields = [0, "Joy Ding", 13], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select sin(id) as id from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "id"
+ field_type = "double"
+ field_value = [
+ { equals_to = 0.0 }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_sinh.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_sinh.conf
new file mode 100644
index 000000000..820624994
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_sinh.conf
@@ -0,0 +1,69 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ age = "int"
+ }
+ }
+ rows = [
+ { fields = [0, "Joy Ding", 13], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select sinh(id) as id from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "id"
+ field_type = "double"
+ field_value = [
+ { equals_to = 0.0 }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_soundex.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_soundex.conf
new file mode 100644
index 000000000..c3273770f
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_soundex.conf
@@ -0,0 +1,69 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ age = "int"
+ }
+ }
+ rows = [
+ { fields = [null, "Joy Ding", 15 ], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select soundex(name) as name from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "name"
+ field_type = "string"
+ field_value = [
+ { equals_to = "J352" }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_space.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_space.conf
new file mode 100644
index 000000000..17309ff0c
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_space.conf
@@ -0,0 +1,69 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ age = "int"
+ }
+ }
+ rows = [
+ { fields = [null, "Joy Ding", 15 ], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select name || space(3) as name from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "name"
+ field_type = "string"
+ field_value = [
+ { equals_to = "Joy Ding " }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_sqrt.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_sqrt.conf
new file mode 100644
index 000000000..7f4bccd60
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_sqrt.conf
@@ -0,0 +1,76 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ price = "double"
+ }
+ }
+ rows = [
+ { fields = [100, "Joy Ding", 10.24], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select sqrt(id) as id, sqrt(price) as price from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "id"
+ field_type = "double"
+ field_value = [
+ { equals_to = 10 }
+ ]
+ }
+ {
+ field_name = "price"
+ field_type = "double"
+ field_value = [
+ { equals_to = 3.2 }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_substr.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_substr.conf
new file mode 100644
index 000000000..88efac20c
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_substr.conf
@@ -0,0 +1,76 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ age = "int"
+ }
+ }
+ rows = [
+ { fields = [1, "Joy Ding", 12], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select substr(name, 5) as name, substring(name, 1, 3) as name2 from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "name"
+ field_type = "string"
+ field_value = [
+ { equals_to = "Ding" }
+ ]
+ }
+ {
+ field_name = "name2"
+ field_type = "string"
+ field_value = [
+ { equals_to = "Joy" }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_tan.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_tan.conf
new file mode 100644
index 000000000..fc4c84863
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_tan.conf
@@ -0,0 +1,69 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "double"
+ name = "string"
+ age = "int"
+ }
+ }
+ rows = [
+ { fields = [4, "Joy Ding", 13], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select tan(pi()/id) as id from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "id"
+ field_type = "double"
+ field_value = [
+ { equals_to = 0.9999999999999999 }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_tanh.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_tanh.conf
new file mode 100644
index 000000000..2756a70c6
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_tanh.conf
@@ -0,0 +1,69 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ age = "int"
+ }
+ }
+ rows = [
+ { fields = [0, "Joy Ding", 13], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select tanh(id) as id from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "id"
+ field_type = "double"
+ field_value = [
+ { equals_to = 0.0 }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_to_char.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_to_char.conf
new file mode 100644
index 000000000..6ba924f28
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_to_char.conf
@@ -0,0 +1,69 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ c_time = "timestamp"
+ }
+ }
+ rows = [
+ { fields = [1, "Joy Ding", "2022-12-12T23:34:45"], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select to_char(id) as id, to_char(c_time,'yyyy-MM-dd') as c_date from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "c_date"
+ field_type = "string"
+ field_value = [
+ { equals_to = "2022-12-12" }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_translate.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_translate.conf
new file mode 100644
index 000000000..cb3cde920
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_translate.conf
@@ -0,0 +1,69 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ age = "int"
+ }
+ }
+ rows = [
+ { fields = [1, "Joy Ding", 12], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select translate(name, 'ing', 'ING') as name from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "name"
+ field_type = "string"
+ field_value = [
+ { equals_to = "Joy DING" }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_trim.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_trim.conf
new file mode 100644
index 000000000..b4d2caae5
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_trim.conf
@@ -0,0 +1,76 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ email = "string"
+ }
+ }
+ rows = [
+ { fields = [null, " Joy Ding ", "**Joy_Ding@s.com*" ], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select trim(name) as name, trim(email, '*') as email from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "name"
+ field_type = "string"
+ field_value = [
+ { equals_to = "Joy Ding" }
+ ]
+ },
+ {
+ field_name = "email"
+ field_type = "string"
+ field_value = [
+ { equals_to = "Joy_Ding@s.com" }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_trunc.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_trunc.conf
new file mode 100644
index 000000000..2a2e90a2d
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_trunc.conf
@@ -0,0 +1,76 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ price = "double"
+ }
+ }
+ rows = [
+ { fields = [1, "book", 120.72124], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select trunc(price) as price, trunc(price,2) as price2 from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "price"
+ field_type = "double"
+ field_value = [
+ { equals_to = 120 }
+ ]
+ }
+ {
+ field_name = "price2"
+ field_type = "double"
+ field_value = [
+ { equals_to = 120.72 }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_upper.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_upper.conf
new file mode 100644
index 000000000..24e96b988
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_upper.conf
@@ -0,0 +1,76 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ age = "int"
+ }
+ }
+ rows = [
+ { fields = [null, "Joy Ding", 15 ], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select upper(name) as name, ucase(name) as name2 from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "name"
+ field_type = "string"
+ field_value = [
+ { equals_to = "JOY DING" }
+ ]
+ },
+ {
+ field_name = "name2"
+ field_type = "string"
+ field_value = [
+ { equals_to = "JOY DING" }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_week.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_week.conf
new file mode 100644
index 000000000..d4610ba3e
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_week.conf
@@ -0,0 +1,69 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ c_time = "timestamp"
+ }
+ }
+ rows = [
+ { fields = [1, "Joy Ding", "2021-04-08T13:34:45.235"], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select week(c_time) test1 from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "test1"
+ field_type = "int"
+ field_value = [
+ { equals_to = 15 }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_year.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_year.conf
new file mode 100644
index 000000000..fa87c2379
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_functions/func_year.conf
@@ -0,0 +1,69 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+ checkpoint.interval = 10000
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ c_time = "timestamp"
+ }
+ }
+ rows = [
+ { fields = [1, "Joy Ding", "2021-04-08T13:34:45.235"], kind = INSERT }
+ ]
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ query = "select year(c_time) test1 from fake"
+ }
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules = {
+ field_rules = [
+ {
+ field_name = "test1"
+ field_type = "int"
+ field_value = [
+ { equals_to = 2021 }
+ ]
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_transform.conf b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_transform.conf
new file mode 100644
index 000000000..8273213b3
--- /dev/null
+++ b/seatunnel-e2e/seatunnel-transforms-v2-e2e/src/test/resources/sql_transform.conf
@@ -0,0 +1,112 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######
+###### This config file is a demonstration of streaming processing in seatunnel config
+######
+
+env {
+ job.mode = "BATCH"
+}
+
+source {
+ FakeSource {
+ result_table_name = "fake"
+ row.num = 100
+ schema = {
+ fields {
+ id = "int"
+ name = "string"
+ age = "int"
+ }
+ }
+ }
+}
+
+transform {
+ Sql {
+ source_table_name = "fake"
+ result_table_name = "fake1"
+ # the query table name must same as field 'source_table_name'
+ query = "select id, regexp_replace(name, '.+', 'b') as name, age+1 as age, pi() as pi from fake"
+ }
+ # The SQL transform support base function and criteria operation
+ # But the complex SQL unsupported yet, include: multi source table/rows JOIN and AGGREGATE operation and the like
+}
+
+sink {
+ Console {
+ source_table_name = "fake1"
+ }
+ Assert {
+ source_table_name = "fake1"
+ rules =
+ {
+ row_rules = [
+ {
+ rule_type = MIN_ROW
+ rule_value = 100
+ }
+ ]
+ field_rules = [
+ {
+ field_name = id
+ field_type = int
+ field_value = [
+ {
+ rule_type = NOT_NULL
+ }
+ ]
+ },
+ {
+ field_name = name
+ field_type = string
+ field_value = [
+ {
+ rule_type = NOT_NULL
+ },
+ {
+ rule_type = MIN_LENGTH
+ rule_value = 1
+ },
+ {
+ rule_type = MAX_LENGTH
+ rule_value = 1
+ }
+ ]
+ },
+ {
+ field_name = age
+ field_type = int
+ field_value = [
+ {
+ rule_type = NOT_NULL
+ }
+ ]
+ },
+ {
+ field_name = pi
+ field_type = double
+ field_value = [
+ {
+ rule_type = NOT_NULL
+ }
+ ]
+ }
+ ]
+ }
+ }
+}
diff --git a/seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/task/flow/TransformFlowLifeCycle.java b/seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/task/flow/TransformFlowLifeCycle.java
index 36d0e2d0f..d7a9cc4e3 100644
--- a/seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/task/flow/TransformFlowLifeCycle.java
+++ b/seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/task/flow/TransformFlowLifeCycle.java
@@ -28,6 +28,7 @@ import org.apache.seatunnel.engine.server.task.record.Barrier;
import lombok.extern.slf4j.Slf4j;
+import java.io.IOException;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.CompletableFuture;
@@ -53,6 +54,22 @@ public class TransformFlowLifeCycle<T> extends ActionFlowLifeCycle
this.collector = collector;
}
+ @Override
+ public void open() throws Exception {
+ super.open();
+ for (SeaTunnelTransform<T> t : transform) {
+ try {
+ t.open();
+ } catch (Exception e) {
+ log.error(
+ "Open transform: {} failed, cause: {}",
+ t.getPluginName(),
+ e.getMessage(),
+ e);
+ }
+ }
+ }
+
@Override
public void received(Record<?> record) {
if (record.getData() instanceof Barrier) {
@@ -93,4 +110,20 @@ public class TransformFlowLifeCycle<T> extends ActionFlowLifeCycle
public void restoreState(List<ActionSubtaskState> actionStateList) throws Exception {
// nothing
}
+
+ @Override
+ public void close() throws IOException {
+ for (SeaTunnelTransform<T> t : transform) {
+ try {
+ t.close();
+ } catch (Exception e) {
+ log.error(
+ "Close transform: {} failed, cause: {}",
+ t.getPluginName(),
+ e.getMessage(),
+ e);
+ }
+ }
+ super.close();
+ }
}
diff --git a/seatunnel-transforms-v2/pom.xml b/seatunnel-transforms-v2/pom.xml
index d5a6df759..5a6e59233 100644
--- a/seatunnel-transforms-v2/pom.xml
+++ b/seatunnel-transforms-v2/pom.xml
@@ -45,6 +45,11 @@
<groupId>org.apache.seatunnel</groupId>
<artifactId>seatunnel-api</artifactId>
</dependency>
+ <dependency>
+ <groupId>com.github.jsqlparser</groupId>
+ <artifactId>jsqlparser</artifactId>
+ <version>${jsqlparser.version}</version>
+ </dependency>
</dependencies>
<build>
diff --git a/seatunnel-transforms-v2/src/main/java/org/apache/seatunnel/transform/SQLTransform.java b/seatunnel-transforms-v2/src/main/java/org/apache/seatunnel/transform/SQLTransform.java
new file mode 100644
index 000000000..164c6ce26
--- /dev/null
+++ b/seatunnel-transforms-v2/src/main/java/org/apache/seatunnel/transform/SQLTransform.java
@@ -0,0 +1,103 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.seatunnel.transform;
+
+import org.apache.seatunnel.shade.com.typesafe.config.Config;
+
+import org.apache.seatunnel.api.configuration.Option;
+import org.apache.seatunnel.api.configuration.Options;
+import org.apache.seatunnel.api.table.type.SeaTunnelRow;
+import org.apache.seatunnel.api.table.type.SeaTunnelRowType;
+import org.apache.seatunnel.api.transform.SeaTunnelTransform;
+import org.apache.seatunnel.common.config.CheckConfigUtil;
+import org.apache.seatunnel.common.config.CheckResult;
+import org.apache.seatunnel.transform.common.AbstractSeaTunnelTransform;
+import org.apache.seatunnel.transform.sqlengine.SQLEngine;
+import org.apache.seatunnel.transform.sqlengine.SQLEngineFactory;
+import org.apache.seatunnel.transform.sqlengine.SQLEngineFactory.EngineType;
+
+import com.google.auto.service.AutoService;
+
+import static org.apache.seatunnel.transform.sqlengine.SQLEngineFactory.EngineType.ZETA;
+
+@AutoService(SeaTunnelTransform.class)
+public class SQLTransform extends AbstractSeaTunnelTransform {
+
+ public static final Option<String> KEY_QUERY =
+ Options.key("query").stringType().noDefaultValue().withDescription("The query SQL");
+
+ public static final Option<String> KEY_ENGINE =
+ Options.key("engine")
+ .stringType()
+ .defaultValue(ZETA.name())
+ .withDescription("The SQL engine type");
+
+ private String query;
+
+ private EngineType engineType;
+
+ private transient SQLEngine sqlEngine;
+
+ @Override
+ public String getPluginName() {
+ return "Sql";
+ }
+
+ @Override
+ protected void setConfig(Config pluginConfig) {
+ CheckResult checkResult = CheckConfigUtil.checkAllExists(pluginConfig, KEY_QUERY.key());
+ if (!checkResult.isSuccess()) {
+ throw new IllegalArgumentException("Failed to check config! " + checkResult.getMsg());
+ }
+ query = pluginConfig.getString(KEY_QUERY.key());
+ if (pluginConfig.hasPath(KEY_ENGINE.key())) {
+ engineType = EngineType.valueOf(pluginConfig.getString(KEY_ENGINE.key()).toUpperCase());
+ } else {
+ engineType = ZETA;
+ }
+ }
+
+ @Override
+ public void open() {
+ sqlEngine = SQLEngineFactory.getSQLEngine(engineType);
+ sqlEngine.init(inputTableName, inputRowType, query);
+ }
+
+ private void tryOpen() {
+ if (sqlEngine == null) {
+ open();
+ }
+ }
+
+ @Override
+ protected SeaTunnelRowType transformRowType(SeaTunnelRowType inputRowType) {
+ tryOpen();
+ return sqlEngine.typeMapping();
+ }
+
+ @Override
+ protected SeaTunnelRow transformRow(SeaTunnelRow inputRow) {
+ tryOpen();
+ return sqlEngine.transformBySQL(inputRow);
+ }
+
+ @Override
+ public void close() {
+ sqlEngine.close();
+ }
+}
diff --git a/seatunnel-transforms-v2/src/main/java/org/apache/seatunnel/transform/SQLTransformFactory.java b/seatunnel-transforms-v2/src/main/java/org/apache/seatunnel/transform/SQLTransformFactory.java
new file mode 100644
index 000000000..13b545085
--- /dev/null
+++ b/seatunnel-transforms-v2/src/main/java/org/apache/seatunnel/transform/SQLTransformFactory.java
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.seatunnel.transform;
+
+import org.apache.seatunnel.api.configuration.util.OptionRule;
+import org.apache.seatunnel.api.table.factory.Factory;
+import org.apache.seatunnel.api.table.factory.TableTransformFactory;
+
+import com.google.auto.service.AutoService;
+
+import static org.apache.seatunnel.transform.SQLTransform.KEY_QUERY;
+
+@AutoService(Factory.class)
+public class SQLTransformFactory implements TableTransformFactory {
+ @Override
+ public String factoryIdentifier() {
+ return "Sql";
+ }
+
+ @Override
+ public OptionRule optionRule() {
+ return OptionRule.builder().required(KEY_QUERY).build();
+ }
+}
diff --git a/seatunnel-transforms-v2/src/main/java/org/apache/seatunnel/transform/common/AbstractSeaTunnelTransform.java b/seatunnel-transforms-v2/src/main/java/org/apache/seatunnel/transform/common/AbstractSeaTunnelTransform.java
index 2c7b9d156..272e79db1 100644
--- a/seatunnel-transforms-v2/src/main/java/org/apache/seatunnel/transform/common/AbstractSeaTunnelTransform.java
+++ b/seatunnel-transforms-v2/src/main/java/org/apache/seatunnel/transform/common/AbstractSeaTunnelTransform.java
@@ -33,11 +33,11 @@ public abstract class AbstractSeaTunnelTransform implements SeaTunnelTransform<S
private static final String RESULT_TABLE_NAME = CommonOptions.RESULT_TABLE_NAME.key();
private static final String SOURCE_TABLE_NAME = CommonOptions.SOURCE_TABLE_NAME.key();
- private String inputTableName;
- private SeaTunnelRowType inputRowType;
+ protected String inputTableName;
+ protected SeaTunnelRowType inputRowType;
- private String outputTableName;
- private SeaTunnelRowType outputRowType;
+ protected String outputTableName;
+ protected SeaTunnelRowType outputRowType;
@Override
public void prepare(Config pluginConfig) throws PrepareFailException {
diff --git a/seatunnel-transforms-v2/src/main/java/org/apache/seatunnel/transform/exception/TransformException.java b/seatunnel-transforms-v2/src/main/java/org/apache/seatunnel/transform/exception/TransformException.java
new file mode 100644
index 000000000..8d1838473
--- /dev/null
+++ b/seatunnel-transforms-v2/src/main/java/org/apache/seatunnel/transform/exception/TransformException.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.seatunnel.transform.exception;
+
+import org.apache.seatunnel.common.exception.SeaTunnelErrorCode;
+import org.apache.seatunnel.common.exception.SeaTunnelRuntimeException;
+
+public class TransformException extends SeaTunnelRuntimeException {
+ public TransformException(SeaTunnelErrorCode seaTunnelErrorCode, String errorMessage) {
+ super(seaTunnelErrorCode, errorMessage);
+ }
+
+ public TransformException(
+ SeaTunnelErrorCode seaTunnelErrorCode, String errorMessage, Throwable cause) {
+ super(seaTunnelErrorCode, errorMessage, cause);
+ }
+
+ public TransformException(SeaTunnelErrorCode seaTunnelErrorCode, Throwable cause) {
+ super(seaTunnelErrorCode, cause);
+ }
+}
diff --git a/seatunnel-transforms-v2/src/main/java/org/apache/seatunnel/transform/sqlengine/SQLEngine.java b/seatunnel-transforms-v2/src/main/java/org/apache/seatunnel/transform/sqlengine/SQLEngine.java
new file mode 100644
index 000000000..116e5319f
--- /dev/null
+++ b/seatunnel-transforms-v2/src/main/java/org/apache/seatunnel/transform/sqlengine/SQLEngine.java
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.seatunnel.transform.sqlengine;
+
+import org.apache.seatunnel.api.table.type.SeaTunnelRow;
+import org.apache.seatunnel.api.table.type.SeaTunnelRowType;
+
+public interface SQLEngine {
+ void init(String inputTableName, SeaTunnelRowType inputRowType, String sql);
+
+ SeaTunnelRowType typeMapping();
+
+ SeaTunnelRow transformBySQL(SeaTunnelRow inputRow);
+
+ default void close() {}
+}
diff --git a/seatunnel-transforms-v2/src/main/java/org/apache/seatunnel/transform/sqlengine/SQLEngineFactory.java b/seatunnel-transforms-v2/src/main/java/org/apache/seatunnel/transform/sqlengine/SQLEngineFactory.java
new file mode 100644
index 000000000..c7e1aebe0
--- /dev/null
+++ b/seatunnel-transforms-v2/src/main/java/org/apache/seatunnel/transform/sqlengine/SQLEngineFactory.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
... 3278 lines suppressed ...