Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fewer parens #207

Merged
merged 1 commit into from
Nov 5, 2024
Merged

fewer parens #207

merged 1 commit into from
Nov 5, 2024

Conversation

ruslandoga
Copy link
Contributor

@ruslandoga ruslandoga commented Nov 2, 2024

Context: plausible/analytics@6399cf5

Preview: plausible/analytics#4769

ast before this PR
0cdf854b7d84 :) explain ast SELECT 1 FROM values((1)) WHERE ((((((((1 AND 1) AND 1) AND 1) AND 1) AND 1) AND 1) AND 1) AND 1);

EXPLAIN AST
SELECT 1
FROM values(1)
WHERE (((((((1 AND 1) AND 1) AND 1) AND 1) AND 1) AND 1) AND 1) AND 1

Query id: 3bd5dd60-a3d0-410c-9ca2-50d0c10eb1b9

    ┌─explain───────────────────────────────────────┐
 1. │ SelectWithUnionQuery (children 1)             │
 2. │  ExpressionList (children 1)                  │
 3. │   SelectQuery (children 3)                    │
 4. │    ExpressionList (children 1)                │
 5. │     Literal UInt64_1                          │
 6. │    TablesInSelectQuery (children 1)           │
 7. │     TablesInSelectQueryElement (children 1)   │
 8. │      TableExpression (children 1)             │
 9. │       Function values (children 1)            │
10. │        ExpressionList (children 1)            │
11. │         Literal UInt64_1                      │
12. │    Function and (children 1)                  │
13. │     ExpressionList (children 2)               │
14. │      Function and (children 1)                │
15. │       ExpressionList (children 2)             │
16. │        Function and (children 1)              │
17. │         ExpressionList (children 2)           │
18. │          Function and (children 1)            │
19. │           ExpressionList (children 2)         │
20. │            Function and (children 1)          │
21. │             ExpressionList (children 2)       │
22. │              Function and (children 1)        │
23. │               ExpressionList (children 2)     │
24. │                Function and (children 1)      │
25. │                 ExpressionList (children 2)   │
26. │                  Function and (children 1)    │
27. │                   ExpressionList (children 2) │
28. │                    Literal UInt64_1           │
29. │                    Literal UInt64_1           │
30. │                  Literal UInt64_1             │
31. │                Literal UInt64_1               │
32. │              Literal UInt64_1                 │
33. │            Literal UInt64_1                   │
34. │          Literal UInt64_1                     │
35. │        Literal UInt64_1                       │
36. │      Literal UInt64_1                         │
    └───────────────────────────────────────────────┘
ast after this pr
0cdf854b7d84 :) explain ast SELECT 1 FROM values((1)) WHERE 1 AND 1 AND 1 AND 1 AND 1 AND 1 AND 1 AND 1 AND 1;

EXPLAIN AST
SELECT 1
FROM values(1)
WHERE 1 AND 1 AND 1 AND 1 AND 1 AND 1 AND 1 AND 1 AND 1

Query id: 4939be02-0611-4d8b-a24f-79e9c5831ee7

    ┌─explain─────────────────────────────────────┐
 1. │ SelectWithUnionQuery (children 1)           │
 2. │  ExpressionList (children 1)                │
 3. │   SelectQuery (children 3)                  │
 4. │    ExpressionList (children 1)              │
 5. │     Literal UInt64_1                        │
 6. │    TablesInSelectQuery (children 1)         │
 7. │     TablesInSelectQueryElement (children 1) │
 8. │      TableExpression (children 1)           │
 9. │       Function values (children 1)          │
10. │        ExpressionList (children 1)          │
11. │         Literal UInt64_1                    │
12. │    Function and (children 1)                │
13. │     ExpressionList (children 9)             │
14. │      Literal UInt64_1                       │
15. │      Literal UInt64_1                       │
16. │      Literal UInt64_1                       │
17. │      Literal UInt64_1                       │
18. │      Literal UInt64_1                       │
19. │      Literal UInt64_1                       │
20. │      Literal UInt64_1                       │
21. │      Literal UInt64_1                       │
22. │      Literal UInt64_1                       │
    └─────────────────────────────────────────────┘

This PR tries to keep changes minimal, so there is another PR that completely removes unnecessary parens: #209 (to be merged later)

@ruslandoga ruslandoga mentioned this pull request Nov 2, 2024
@ruslandoga ruslandoga force-pushed the fewer-parens-easy branch 3 times, most recently from 4833f6b to 8bc4319 Compare November 2, 2024 15:09
@ruslandoga ruslandoga marked this pull request as ready for review November 2, 2024 15:14
@ruslandoga ruslandoga force-pushed the fewer-parens-easy branch 7 times, most recently from 778de16 to cd04a9b Compare November 4, 2024 03:53
@ruslandoga ruslandoga merged commit 70bbb4c into master Nov 5, 2024
14 checks passed
@ruslandoga ruslandoga deleted the fewer-parens-easy branch November 5, 2024 07:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant