Add info about fix

This commit is contained in:
Dmitry Novik 2024-06-06 18:53:28 +02:00 committed by GitHub
parent e42791e9e8
commit ef9ef53fde
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -19,6 +19,7 @@ Optimizations could rewrite the initial query so it becomes valid and can be exe
In the new infrastructure, query validation takes place before the optimization step. In the new infrastructure, query validation takes place before the optimization step.
This means that invalid queries that were possible to execute before are now unsupported. This means that invalid queries that were possible to execute before are now unsupported.
In such cases, the query must be fixed manually.
**Example 1:** **Example 1:**
@ -45,6 +46,16 @@ HAVING number > 5
The same problem occurs in this query: column `number` is used after aggregation with another key. The same problem occurs in this query: column `number` is used after aggregation with another key.
The previous query analyzer fixed this query by moving the `number > 5` filter from the `HAVING` clause to the `WHERE` clause. The previous query analyzer fixed this query by moving the `number > 5` filter from the `HAVING` clause to the `WHERE` clause.
To fix the query, you should move all conditions that apply to non-aggregated columns to the `WHERE` section to conform to standard SQL syntax:
```sql
SELECT
number % 2 AS n,
sum(number)
FROM numbers(10)
WHERE number > 5
GROUP BY n
```
### Known incompatibilities of JOIN clause ### Known incompatibilities of JOIN clause
#### Join using column from projection #### Join using column from projection