Sql
Filter plugin : Sql
- Author: InterestingLab
- Homepage: https://interestinglab.github.io/seatunnel-docs
- Version: 1.0.0
Description
Processing Rows using SQL, feel free to use Spark UDF.
Options
| name | type | required | default value |
|---|---|---|---|
| sql | string | yes | - |
| table_name | string | yes | - |
sql [string]
SQL content.
table_name [string]
When table set, the current batch of events will be registered as a table, named by this table setting, on which you can execute sql.
Examples
sql {
sql = "select username, address from user_info",
table_name = "user_info"
}
Select the
usernameandaddressfields, the remaining fields will be removed.
sql {
sql = "select substring(telephone, 0, 10) from user_info",
table_name = "user_info"
}
Use the substring function to retrieve a substring on the
telephonefield.
sql {
sql = "select avg(age) from user_info",
table_name = "user_info"
}
Get the aggregation of the average of
ageusing the avg functions.