Skip to content

Split parser into multiple files #351

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

Closed
wants to merge 7 commits into from
Closed

Split parser into multiple files #351

wants to merge 7 commits into from

Conversation

koushiro
Copy link
Member

@koushiro koushiro commented Sep 10, 2021

part of #344

I dropped the commit Differentiate methods of #344 to make it easier to be reviewed.

visibility changes (no breaking changes):

fn parse_prepare ==> pub fn parse_prepare
fn parse_execute ==> pub fn parse_execute
fn parse_deallocate ==> pub fn parse_deallocate

/cc @alamb

@coveralls
Copy link

coveralls commented Sep 10, 2021

Pull Request Test Coverage Report for Build 1277047061

  • 666 of 769 (86.61%) changed or added relevant lines in 5 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.01%) to 90.192%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/parser/tcl.rs 30 31 96.77%
src/parser/dml.rs 21 25 84.0%
src/parser/dql.rs 306 331 92.45%
src/parser/ddl.rs 293 366 80.05%
Totals Coverage Status
Change from base Build 1275126152: -0.01%
Covered Lines: 5821
Relevant Lines: 6454

💛 - Coveralls

@koushiro
Copy link
Member Author

koushiro commented Oct 9, 2021

@alamb PTAL

@alamb
Copy link
Contributor

alamb commented Oct 10, 2021

Checking this one out

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @koushiro -- I don't have time to review these changes. I realize they are mostly mechanical but I don't have time to scrutinize / double check that functionality wasn't dropped / lost during the moves.

@alamb
Copy link
Contributor

alamb commented Oct 10, 2021

FWIW I did do a spot check and try this code out with DataFusion and DataFusion's tests still pass

}

// Parse a tab separated values in COPY payload, used in a `COPY` statement
pub(super) fn parse_tab_values(&mut self) -> Vec<Option<String>> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this method moved to dml module by the parse_copy method is left in the root mod?

@@ -2225,6 +1654,7 @@ impl<'a> Parser<'a> {
}
}

/// Parse a SQL `DELETE` statement
pub fn parse_delete(&mut self) -> Result<Statement, ParserError> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this go into dql as well?

@houqp
Copy link
Member

houqp commented Oct 10, 2021

I also did a spot check, mostly looks good to me. Couple good improvements on the doc string as well 👍

I have to admit though, personally I think refactoring code into mods makes sense when they are mostly decoupled, which doesn't seem like the case here. I actually find it easier to navigate and search the code base when coupled code are in the same file. That said, it's not a strong no from me.

@alamb
Copy link
Contributor

alamb commented Feb 8, 2022

Sadly I don't have the time to help drive projects such as this. Unless one of the other maintainers wants to do so, PRs like this are not likely to be merged. I am sorry I don't have the time and I am sorry if your time was wasted.

As the current state of affairs might not have been clear in the project's README. I have added #416 to try and help

@coveralls
Copy link

coveralls commented Oct 3, 2024

Pull Request Test Coverage Report for Build 1226236288

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 675 of 780 (86.54%) changed or added relevant lines in 5 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.01%) to 90.052%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/parser/tcl.rs 30 31 96.77%
src/parser/mod.rs 25 27 92.59%
src/parser/dml.rs 21 25 84.0%
src/parser/dql.rs 306 331 92.45%
src/parser/ddl.rs 293 366 80.05%
Totals Coverage Status
Change from base Build 1221827261: -0.01%
Covered Lines: 5712
Relevant Lines: 6343

💛 - Coveralls

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.

4 participants