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

make lemon warning as error and fix syntax conflicts in sql.y #29277

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

freemine
Copy link
Contributor

@freemine freemine commented Dec 23, 2024

#25845

original rule:

joined_table ::= 
     table_reference join_type join_subtype JOIN table_reference join_on_clause_opt 
     window_offset_clause_opt jlimit_clause_opt.

this generates syntax conflicts in sql.out

12531 State 147:                                                                      
12532           joined_table ::= table_reference * join_type join_subtype JOIN table_reference join_on_clause_opt window_offset_clause_opt jlimit_clause_opt
12533           joined_table ::= table_reference join_type join_subtype JOIN table_reference * join_on_clause_opt window_offset_clause_opt jlimit_clause_opt
12534     (700) join_type ::= *                                                       
12535           join_type ::= * INNER                                                 
12536           join_type ::= * LEFT                                                  
12537           join_type ::= * RIGHT                                                 
12538           join_type ::= * FULL                                                  
12539     (711) join_on_clause_opt ::= *                                              
12540           join_on_clause_opt ::= * ON search_condition                          
12541                                                                                 
12542                             ON shift        9                                   
12543                             ON reduce       711     ** Parsing conflict **                                                                                                
12544                           FULL shift-reduce 704    join_type ::= FULL           
12545                           FULL reduce       711     ** Parsing conflict **      
12546                           JOIN reduce       700    join_type ::=                
12547                           JOIN reduce       711     ** Parsing conflict **      
12548                          INNER shift-reduce 701    join_type ::= INNER          
12549                          INNER reduce       711     ** Parsing conflict **      
12550                           LEFT shift-reduce 702    join_type ::= LEFT           
12551                           LEFT reduce       711     ** Parsing conflict **      
12552                          RIGHT shift-reduce 703    join_type ::= RIGHT          
12553                          RIGHT reduce       711     ** Parsing conflict **      
12554                          OUTER reduce       700    join_type ::=                
12555                          OUTER reduce       711     ** Parsing conflict **      
12556                           SEMI reduce       700    join_type ::=                
12557                           SEMI reduce       711     ** Parsing conflict **      
12558                           ANTI reduce       700    join_type ::=                
12559                           ANTI reduce       711     ** Parsing conflict **      
12560                           ASOF reduce       700    join_type ::=                
12561                           ASOF reduce       711     ** Parsing conflict **      
12562                         WINDOW reduce       700    join_type ::=                
12563                         WINDOW reduce       711     ** Parsing conflict **      
12564                      join_type shift        218                                 
12565             join_on_clause_opt shift        345                                 
12566                      {default} reduce       711    join_on_clause_opt ::=       

normally, multiple tables join as as following:

select * from t1
     join t2 on t1.ts = t2.ts
     join t3 on t1.ts = t3.ts

which means table_reference in right hand side of JOIN is not necessary.

…exists

2. resolving joined_table syntax conflicts
@freemine
Copy link
Contributor Author

@guanshengliang #25845

@freemine freemine closed this Dec 25, 2024
@freemine freemine reopened this Dec 26, 2024
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