Skip to content

Commit e616968

Browse files
authored
[Improve][Transform] Rename sql transform table name from 'fake' to 'dual' (#8298)
1 parent b9d850e commit e616968

File tree

55 files changed

+70
-69
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+70
-69
lines changed

Diff for: docs/en/concept/config.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ transform {
314314
sql {
315315
plugin_input = "fake_test_table"
316316
plugin_output = "sql"
317-
query = "select * from fake_test_table where name = 'abc' "
317+
query = "select * from dual where name = 'abc' "
318318
}
319319
320320
}

Diff for: docs/en/connector-v2/source-common-options.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ transform {
7373
plugin_input = "fake"
7474
plugin_output = "fake1"
7575
# the query table name must same as field 'plugin_input'
76-
query = "select id, regexp_replace(name, '.+', 'b') as name, age+1 as age, pi() as pi, c_timestamp, c_date, c_map, c_array, c_decimal, c_row from fake"
76+
query = "select id, regexp_replace(name, '.+', 'b') as name, age+1 as age, pi() as pi, c_timestamp, c_date, c_map, c_array, c_decimal, c_row from dual"
7777
}
7878
# The SQL transform support base function and criteria operation
7979
# But the complex SQL unsupported yet, include: multi source table/rows JOIN and AGGREGATE operation and the like

Diff for: docs/en/faq.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Define the variable in the configuration. For example, in an SQL transformation
6868
...
6969
transform {
7070
Sql {
71-
query = "select * from user_view where city ='${city}' and dt = '${date}'"
71+
query = "select * from dual where city ='${city}' and dt = '${date}'"
7272
}
7373
}
7474
...

Diff for: docs/en/transform-v2/common-options.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ transform {
5757
plugin_input = "fake"
5858
plugin_output = "fake1"
5959
# the query table name must same as field 'plugin_input'
60-
query = "select id, regexp_replace(name, '.+', 'b') as name, age+1 as age, pi() as pi, c_timestamp, c_date, c_map, c_array, c_decimal, c_row from fake"
60+
query = "select id, regexp_replace(name, '.+', 'b') as name, age+1 as age, pi() as pi, c_timestamp, c_date, c_map, c_array, c_decimal, c_row from dual"
6161
}
6262
# The SQL transform support base function and criteria operation
6363
# But the complex SQL unsupported yet, include: multi source table/rows JOIN and AGGREGATE operation and the like

Diff for: docs/en/transform-v2/sql-functions.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -973,7 +973,7 @@ select
973973
else 0
974974
end as c_number_0
975975
from
976-
fake
976+
dual
977977
```
978978

979979
It is used to determine whether the condition is valid and return different values according to different judgments
@@ -1009,7 +1009,7 @@ OUTER EXPLODE will return NULL, while array is NULL or empty
10091009
EXPLODE(SPLIT(FIELD_NAME,separator))Used to split string type. The first parameter of SPLIT function is the field name, the second parameter is the separator
10101010
EXPLODE(ARRAY(value1,value2)) Used to custom array type.
10111011
```
1012-
SELECT * FROM fake
1012+
SELECT * FROM dual
10131013
LATERAL VIEW EXPLODE ( SPLIT ( NAME, ',' ) ) AS NAME
10141014
LATERAL VIEW EXPLODE ( SPLIT ( pk_id, ';' ) ) AS pk_id
10151015
LATERAL VIEW OUTER EXPLODE ( age ) AS age

Diff for: docs/en/transform-v2/sql-udf.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ transform {
112112
Sql {
113113
plugin_input = "fake"
114114
plugin_output = "fake1"
115-
query = "select id, example(name) as name, age from fake"
115+
query = "select id, example(name) as name, age from dual"
116116
}
117117
}
118118
```

Diff for: docs/en/transform-v2/sql.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ transform {
4545
Sql {
4646
plugin_input = "fake"
4747
plugin_output = "fake1"
48-
query = "select id, concat(name, '_') as name, age+1 as age from fake where id>0"
48+
query = "select id, concat(name, '_') as name, age+1 as age from dual where id>0"
4949
}
5050
}
5151
```
@@ -139,7 +139,7 @@ transform {
139139
Sql {
140140
plugin_input = "fake"
141141
plugin_output = "fake1"
142-
query = "select id, concat(name, '_') as name, age+1 as age from fake where id>0"
142+
query = "select id, concat(name, '_') as name, age+1 as age from dual where id>0"
143143
}
144144
}
145145

Diff for: docs/zh/concept/config.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ transform {
300300
sql {
301301
plugin_input = "fake_test_table"
302302
plugin_output = "sql"
303-
query = "select * from fake_test_table where name = 'abc' "
303+
query = "select * from dual where name = 'abc' "
304304
}
305305
306306
}

Diff for: docs/zh/connector-v2/source-common-options.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ transform {
7373
plugin_input = "fake"
7474
plugin_output = "fake1"
7575
# 查询表名必须与字段 'plugin_input' 相同
76-
query = "select id, regexp_replace(name, '.+', 'b') as name, age+1 as age, pi() as pi, c_timestamp, c_date, c_map, c_array, c_decimal, c_row from fake"
76+
query = "select id, regexp_replace(name, '.+', 'b') as name, age+1 as age, pi() as pi, c_timestamp, c_date, c_map, c_array, c_decimal, c_row from dual"
7777
}
7878
# SQL 转换支持基本函数和条件操作
7979
# 但不支持复杂的 SQL 操作,包括:多源表/行 JOIN 和聚合操作等

Diff for: docs/zh/faq.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ SeaTunnel 支持一部分数据源的精确一致性,例如支持 MySQL、Post
7373
...
7474
transform {
7575
Sql {
76-
query = "select * from user_view where city ='${city}' and dt = '${date}'"
76+
query = "select * from dual where city ='${city}' and dt = '${date}'"
7777
}
7878
}
7979
...

Diff for: docs/zh/transform-v2/sql-udf.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ transform {
111111
Sql {
112112
plugin_input = "fake"
113113
plugin_output = "fake1"
114-
query = "select id, example(name) as name, age from fake"
114+
query = "select id, example(name) as name, age from dual"
115115
}
116116
}
117117
```

Diff for: docs/zh/transform-v2/sql.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ transform {
4545
Sql {
4646
plugin_input = "fake"
4747
plugin_output = "fake1"
48-
query = "select id, concat(name, '_') as name, age+1 as age from fake where id>0"
48+
query = "select id, concat(name, '_') as name, age+1 as age from dual where id>0"
4949
}
5050
}
5151
```
@@ -139,7 +139,7 @@ transform {
139139
Sql {
140140
plugin_input = "fake"
141141
plugin_output = "fake1"
142-
query = "select id, concat(name, '_') as name, age+1 as age from fake where id>0"
142+
query = "select id, concat(name, '_') as name, age+1 as age from dual where id>0"
143143
}
144144
}
145145

Diff for: seatunnel-api/src/test/resources/conf/option-test.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ source {
9898

9999
transform {
100100
sql {
101-
sql = "select name,age from fake"
101+
sql = "select name,age from dual"
102102
}
103103
}
104104

Diff for: seatunnel-config/seatunnel-config-shade/src/test/resources/json/spark.batch.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ transform {
5050

5151
# you can also use other transform plugins, such as sql
5252
# sql {
53-
# sql = "select * from accesslog where request_time > 1000"
53+
# sql = "select * from dual where request_time > 1000"
5454
# }
5555

5656
# If you would like to get more information about how to configure seatunnel and see full list of transform plugins,

Diff for: seatunnel-config/seatunnel-config-shade/src/test/resources/seatunnel/variables.conf

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@ transform {
4141

4242
sql {
4343
table_name = "user_view"
44-
sql = "select * from user_view where city = '"${city2}"'"
44+
sql = "select * from dual where city = '"${city2}"'"
4545
plugin_output = "result1"
4646
}
4747

4848
sql {
4949
table_name = "user_view"
50-
sql = "select * from user_view where dt = '"${dt}"'"
50+
sql = "select * from dual where dt = '"${dt}"'"
5151
plugin_output = "result2"
5252
}
5353
}

Diff for: seatunnel-connectors-v2/connector-email/src/main/resources/fake_to_emailsink_flink.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ source {
3737

3838
transform {
3939
sql {
40-
sql = "select name,age from fake"
40+
sql = "select name,age from dual"
4141
}
4242

4343
# If you would like to get more information about how to configure seatunnel and see full list of transform plugins,

Diff for: seatunnel-connectors-v2/connector-kudu/src/main/resources/kudu_to_kudu_flink.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ source {
3838

3939
transform {
4040
sql {
41-
sql = "select id,name,age,sex from studentlyh2"
41+
sql = "select id,name,age,sex from dual"
4242
}
4343

4444
# If you would like to get more information about how to configure seatunnel and see full list of transform plugins,

Diff for: seatunnel-connectors-v2/connector-kudu/src/main/resources/kudu_to_kudu_spark.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ source {
4343

4444
transform {
4545
sql {
46-
sql = "select id,name,age,sex from studentlyh2"
46+
sql = "select id,name,age,sex from dual"
4747
}
4848

4949
# If you would like to get more information about how to configure seatunnel and see full list of transform plugins,

Diff for: seatunnel-connectors-v2/connector-maxcompute/src/main/resources/maxcompute_to_maxcompute.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ source {
7272
transform {
7373
sql {
7474
plugin_input = "fake"
75-
sql = "select * from fake"
75+
sql = "select * from dual"
7676
}
7777

7878
# If you would like to get more information about how to configure seatunnel and see full list of transform plugins,

Diff for: seatunnel-core/seatunnel-core-starter/src/test/resources/flink.batch.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ source {
3838

3939
transform {
4040
Sql {
41-
sql = "select * from test"
41+
sql = "select * from dual"
4242
}
4343

4444
# If you would like to get more information about how to configure seatunnel and see full list of filter plugins,

Diff for: seatunnel-e2e/seatunnel-connector-v2-e2e/connector-cdc-mysql-e2e/src/test/resources/mysqlcdc_to_mysql.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ transform {
4545
f_mediumint_unsigned, f_int, f_int_unsigned, f_integer, f_integer_unsigned, f_bigint, f_bigint_unsigned, f_numeric, f_decimal,
4646
f_float, f_double, f_double_precision, f_longtext, f_mediumtext, f_text, f_tinytext, f_varchar, f_date, f_datetime, f_timestamp,
4747
f_bit1, f_bit64, f_char, f_enum, f_mediumblob, f_long_varchar, f_real, f_time, f_tinyint, f_tinyint_unsigned, f_json, f_year
48-
from customers_mysql_cdc """
48+
from dual """
4949
plugin_output = "trans_mysql_cdc"
5050
}
5151
}

Diff for: seatunnel-e2e/seatunnel-connector-v2-e2e/connector-fake-e2e/src/test/resources/fake_to_assert.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ transform {
7171
Sql {
7272
plugin_input = "fake"
7373
plugin_output = "tmp1"
74-
query = """select * from fake"""
74+
query = """select * from dual"""
7575
}
7676
}
7777

Diff for: seatunnel-e2e/seatunnel-connector-v2-e2e/connector-fake-e2e/src/test/resources/fake_to_assert_with_compatible_source_and_result_table_name.conf

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ transform {
4949
source_table_name = "fake1"
5050
result_table_name = "tmp1"
5151

52-
query = """select * from fake1"""
52+
query = """select * from dual"""
5353
}
5454
Sql {
5555
source_table_name = "fake2"
5656
result_table_name = "tmp2"
5757

58-
query = """select * from fake2"""
58+
query = """select * from dual"""
5959
}
6060
}
6161

Diff for: seatunnel-e2e/seatunnel-connector-v2-e2e/connector-file-local-e2e/src/test/resources/json/local_file_json_lzo_to_console.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ transform {
8080
sql {
8181
plugin_input = "fake"
8282
plugin_output = "sqlresult"
83-
query = "select * from fake where c_string = 'WArEB'"
83+
query = "select * from dual where c_string = 'WArEB'"
8484
}
8585
}
8686

Diff for: seatunnel-e2e/seatunnel-connector-v2-e2e/connector-file-local-e2e/src/test/resources/text/local_file_text_lzo_to_assert.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ transform {
7979
sql {
8080
plugin_input = "fake"
8181
plugin_output = "sqlresult"
82-
query = "select * from fake where c_string = 'MTDna'"
82+
query = "select * from dual where c_string = 'MTDna'"
8383
}
8484
}
8585

Diff for: seatunnel-e2e/seatunnel-connector-v2-e2e/connector-file-oss-e2e/src/test/resources/json/oss_file_json_lzo_to_console.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ transform {
8282
sql {
8383
plugin_input = "fake"
8484
plugin_output = "sqlresult"
85-
query = "select * from fake where c_string = 'WArEB'"
85+
query = "select * from dual where c_string = 'WArEB'"
8686
}
8787
}
8888

Diff for: seatunnel-e2e/seatunnel-connector-v2-e2e/connector-file-oss-e2e/src/test/resources/text/oss_file_text_lzo_to_assert.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ transform {
8181
sql {
8282
plugin_input = "fake"
8383
plugin_output = "sqlresult"
84-
query = "select * from fake where c_string = 'MTDna'"
84+
query = "select * from dual where c_string = 'MTDna'"
8585
}
8686
}
8787

Diff for: seatunnel-e2e/seatunnel-connector-v2-e2e/connector-file-s3-e2e/src/test/resources/json/s3_file_json_lzo_to_console.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ transform {
8383
sql {
8484
plugin_input = "fake"
8585
plugin_output = "sqlresult"
86-
query = "select * from fake where c_string = 'WArEB'"
86+
query = "select * from dual where c_string = 'WArEB'"
8787
}
8888
}
8989

Diff for: seatunnel-e2e/seatunnel-connector-v2-e2e/connector-file-s3-e2e/src/test/resources/text/s3_file_text_lzo_to_assert.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ transform {
8282
sql {
8383
plugin_input = "fake"
8484
plugin_output = "sqlresult"
85-
query = "select * from fake where c_string = 'MTDna'"
85+
query = "select * from dual where c_string = 'MTDna'"
8686
}
8787
}
8888

Diff for: seatunnel-e2e/seatunnel-connector-v2-e2e/connector-http-e2e/src/test/resources/http_streaming_json_to_postgresql.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ transform {
4444
Sql {
4545
plugin_input = "fake"
4646
plugin_output = "fake1"
47-
query = "select CONCAT(c_string, CAST(RAND() AS STRING)) as c_string, c_int from fake"
47+
query = "select CONCAT(c_string, CAST(RAND() AS STRING)) as c_string, c_int from dual"
4848
}
4949
}
5050

Diff for: seatunnel-e2e/seatunnel-connector-v2-e2e/connector-kafka-e2e/src/test/resources/protobuf/kafka_protobuf_transform_to_assert.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ transform {
8989
Sql {
9090
plugin_input = "kafka_table"
9191
plugin_output = "kafka_table_transform"
92-
query = "select Address.city,c_string from kafka_table"
92+
query = "select Address.city,c_string from dual"
9393
}
9494
}
9595

Diff for: seatunnel-e2e/seatunnel-engine-e2e/connector-seatunnel-e2e-base/src/test/resources/batch_fakesource_to_console_error.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ transform {
3939
sql {
4040
plugin_input = "fake"
4141
plugin_output = "fake1"
42-
query ="select cast(name as int) as name, id,age from fake"
42+
query ="select cast(name as int) as name, id,age from dual"
4343
}
4444
}
4545
sink {

Diff for: seatunnel-e2e/seatunnel-engine-e2e/connector-seatunnel-e2e-base/src/test/resources/unify-env-param-test-resource/unify_flink_table_env_param_fakesource_to_console.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ transform {
4848
Sql {
4949
plugin_input = "fake"
5050
plugin_output = "fake1"
51-
query = "select id, concat(name, '_') as name, age as age from fake where id > 0"
51+
query = "select id, concat(name, '_') as name, age as age from dual where id > 0"
5252
}
5353
}
5454

Diff for: seatunnel-e2e/seatunnel-transforms-v2-e2e/seatunnel-transforms-v2-e2e-part-2/src/test/resources/sql_transform.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ transform {
5252
plugin_input = "fake"
5353
plugin_output = "fake1"
5454
# the query table name must same as field 'plugin_input'
55-
query = "select id, regexp_replace(name, '.+', 'b') as name, age+1 as age, pi() as pi, c_time, c_timestamp, c_date, c_map, c_array, c_decimal, c_row from fake"
55+
query = "select id, regexp_replace(name, '.+', 'b') as name, age+1 as age, pi() as pi, c_time, c_timestamp, c_date, c_map, c_array, c_decimal, c_row from dual"
5656
}
5757
# The SQL transform support base function and criteria operation
5858
# But the complex SQL unsupported yet, include: multi source table/rows JOIN and AGGREGATE operation and the like

Diff for: seatunnel-e2e/seatunnel-transforms-v2-e2e/seatunnel-transforms-v2-e2e-part-2/src/test/resources/sql_transform/binary_expression.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ transform {
4444
Sql {
4545
plugin_input = "fake"
4646
plugin_output = "fake1"
47-
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"
47+
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 dual"
4848
}
4949
}
5050

Diff for: seatunnel-e2e/seatunnel-transforms-v2-e2e/seatunnel-transforms-v2-e2e-part-2/src/test/resources/sql_transform/case_when.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ transform {
6565
case when c_tinyint != 117 or TO_CHAR(c_boolean)='true' then 1 else 0 end as c_tinyint_boolean_or_1,
6666
case when c_int > 1 and c_bigint >1 and c_float >1 and c_double > 1 and c_decimal > 1 then 1 else 0 end as c_number_1,
6767
case when c_tinyint <> 117 then 1 else 0 end as c_number_0
68-
from fake
68+
from dual
6969
"""
7070
}
7171
}

Diff for: seatunnel-e2e/seatunnel-transforms-v2-e2e/seatunnel-transforms-v2-e2e-part-2/src/test/resources/sql_transform/criteria_filter.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ transform {
5454
plugin_input = "fake"
5555
plugin_output = "fake1"
5656
query = """
57-
select id, name, age, email from fake
57+
select id, name, age, email from dual
5858
where ( id = 1 or id = 4 or id in (8, 9, 10, 11, 12) )
5959
and id != 0 and name <> 'Kin Dom'
6060
and ( age >= 20 or age < 22 )

Diff for: seatunnel-e2e/seatunnel-transforms-v2-e2e/seatunnel-transforms-v2-e2e-part-2/src/test/resources/sql_transform/explode_transform.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ transform {
5858
Sql {
5959
plugin_input = "fake"
6060
plugin_output = "fake1"
61-
query = "SELECT * FROM fake LATERAL VIEW OUTER EXPLODE(SPLIT(name, ',')) as name LATERAL VIEW OUTER EXPLODE(SPLIT(pk_id, ';')) as pk_id LATERAL VIEW OUTER EXPLODE(age) as age LATERAL VIEW EXPLODE(ARRAY(1,1)) as num"
61+
query = "SELECT * FROM dual LATERAL VIEW OUTER EXPLODE(SPLIT(name, ',')) as name LATERAL VIEW OUTER EXPLODE(SPLIT(pk_id, ';')) as pk_id LATERAL VIEW OUTER EXPLODE(age) as age LATERAL VIEW EXPLODE(ARRAY(1,1)) as num"
6262
}
6363
}
6464

Diff for: seatunnel-e2e/seatunnel-transforms-v2-e2e/seatunnel-transforms-v2-e2e-part-2/src/test/resources/sql_transform/explode_transform_with_outer.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ transform {
5050
Sql {
5151
plugin_input = "fake"
5252
plugin_output = "fake1"
53-
query = "SELECT * FROM fake LATERAL VIEW OUTER EXPLODE(age) as age LATERAL VIEW OUTER EXPLODE(ARRAY(null,null)) as num"
53+
query = "SELECT * FROM dual LATERAL VIEW OUTER EXPLODE(age) as age LATERAL VIEW OUTER EXPLODE(ARRAY(null,null)) as num"
5454
}
5555
}
5656

0 commit comments

Comments
 (0)