feat: support parsing stored procedures for bigquery dialect#761
Draft
AlexJBSilva wants to merge 2 commits intoreata:masterfrom
Draft
feat: support parsing stored procedures for bigquery dialect#761AlexJBSilva wants to merge 2 commits intoreata:masterfrom
AlexJBSilva wants to merge 2 commits intoreata:masterfrom
Conversation
2d509e3 to
5836345
Compare
Author
|
This is still a Work in Progress as the test is passing with sqlfluff 4.0.4 but failing with sqlfluff 4.1.0. |
Owner
|
Hi @AlexJBSilva , thanks for contributing. Sorry it took me a while. Here's some early feedback:
Putting implementation effort aside, the way I'm thinking about stored procedure is, should we split one create procedure statement into multiple SQL statement, or we tackle it within a single statement? Personally I'd prefer the latter approach, but let me know your thought. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Address (in part, and specifically for bigquery dialect) what was asked in Discussion #556 and Issue #643.
The task is accomplished by adding the case for
multi_statement_segmentinmethod
_list_specific_statement_segmentfrom classSqlFluffLineageAnalyzercombined with the method
recursive_crawl("statement")to extract all statementsfrom multi statement segments and a filter for processing only the statement types
supported by sqllineage (no warnings or exceptions as procedures can contain
many statements meaningless for lineage construction).
To cope with many statements inside a multi statement segment, the parse and
cache strategy from
analyzer.split_tsql()method was leveraged (probably thismethod should be renamed as it seems this approach can be useful for parsing
procedures from other dialects).
This pull request is in draft mode as I just made parsing stored procedures for bigquery dialect to work.
Any thoughts are welcome for getting this PR ready for merge.