All Products
Search
Document Center

Realtime Compute for Apache Flink:WHERE

Last Updated:Dec 22, 2023

This topic describes how the compatibility between a deployment and the state data is affected after you modify the WHERE clause in an SQL statement for the deployment.

State data is not involved in a WHERE clause. Therefore, if you modify a WHERE clause, the state data compatibility of the operator of the WHERE clause is not affected but the state compatibility of its output operators is affected.

If you want to modify the condition in a WHERE condition to correct deployment data, such as filtering out dirty data, you can add the following configuration to the Other Configuration field in the Parameters section of the Configuration tab for the deployment. For more information, see How do I configure parameters for deployment running? After you add the following configuration and you modify the condition in the WHERE clause, the system ignores the impact of this modification on the state data compatibility of downstream operators.

table.optimizer.state-compatibility.ignore-filter=true
Note

The default value of table.optimizer.state-compatibility.ignore-filter is false.

-- Original SQL statement: 
select a, sum(b), max(c) from MyTable group by a;

-- Add a WHERE clause and set table.optimizer.state-compatibility.ignore-filter to false. After this modification, the deployment becomes incompatible with the state data. 
select a, sum(b), max(c) from (select * from MyTable where a > 10) group by a;

-- Add a WHERE clause and set table.optimizer.state-compatibility.ignore-filter to true. After this modification, the deployment remains fully compatible with the state data. 
select a, sum(b), max(c) from (select * from MyTable where a > 10) group by a;