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

SQLFluff not able to parse BEGIN IF ELSE END as statement. #5985

Open
1 task done
DileepChakravarthiAvullapati opened this issue Jun 24, 2024 · 0 comments
Open
1 task done
Labels
bug Something isn't working

Comments

@DileepChakravarthiAvullapati

Search before asking

  • I searched the issues and found no similar issues.

What Happened

create or replace temp table temp_testing(
id int
);

IF ('2024-03-22' <= '2024-04-22') THEN

INSERT INTO temp_testing
(
  id
)
SELECT 1;
END IF;

select * from temp_testing```

I am writing a code similar to this. SQLFluff is giving me the following errors.

Found unparsable section: " IF ($increment_date <= '2024-04-22') TH..."
Found unparsable section: 'END IF'
Found unparsable section: 'END'

![image](https://github.com/sqlfluff/sqlfluff/assets/145964600/6e0ae1d6-5d47-4028-9338-c4b922bbdcf0)


### Expected Behaviour

I expected sqlfluff be able to parse this and show no linting errors.

### Observed Behaviour

I am getting linting errors. 

### How to reproduce

You can use the above mentioned code in a file and get this error.

### Dialect

Circle CI, I think?

### Version

sqlfluff, version 2.3.1

### Configuration

[sqlfluff_file.txt](https://github.com/user-attachments/files/15959397/sqlfluff_file.txt)


### Are you willing to work on and submit a PR to address the issue?

- [X] Yes I am willing to submit a PR!

### Code of Conduct

- [X] I agree to follow this project's [Code of Conduct](https://github.com/sqlfluff/sqlfluff/blob/main/CODE_OF_CONDUCT.md)
@DileepChakravarthiAvullapati DileepChakravarthiAvullapati added the bug Something isn't working label Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant