Skip to main content
Version: 1.x

Sql

Filter plugin : Sql

Description

Processing Rows using SQL, feel free to use Spark UDF.

Options

nametyperequireddefault value
sqlstringyes-
table_namestringyes-
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 username and address fields, 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 telephone field.

sql {
sql = "select avg(age) from user_info",
table_name = "user_info"
}

Get the aggregation of the average of age using the avg functions.