SQL
Last updated
Last updated
SQL transform plugin
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.
source_table_name
string
yes
-
result_table_name
string
yes
-
query
string
yes
-
The source table name, the query SQL table name must match this field.
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.
the query expression can be select [table_name.]column_a
to query the column that named column_a
. and the table name is optional.
or select c_row.c_inner_row.column_b
to query the inline struct column that named column_b
within c_row
column and c_inner_row
column. In this query expression, can't have table name.
The data read from source is a table like this:
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:
Then the data in result table fake1
will update to
1
Joy Ding_
21
2
May Ding_
22
3
Kin Dom_
25
4
Joy Dom_
23
if your upstream data schema is like this:
Those query all are valid:
But this query are not valid:
The map must be the latest struct, can't query the nesting map.