Skip to content

fix: only require DESCRIBE TABLE for Snowflake and ClickHouse dialect #1386

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

Merged
merged 2 commits into from
Aug 16, 2024

Conversation

alamb
Copy link
Contributor

@alamb alamb commented Aug 15, 2024

Fixes #1385

Rationale

@git-hulk added support for DESCRIBE TABLE <..> syntax for ClickHouse and Snowflake in #1351

Unfrtunately, this seems to have caused a regression in describe table (aka describing a table named table which apparently we do in the DataFusion tests) which we did not have test coverage for

Changes

  1. Only require the DESCRIBE TABLE keyword for ClickHouse and Snowflake dialects
  2. Update the tests to match, update coverage

Some(Keyword::FORMATTED) => hive_format = Some(HiveDescribeFormat::Formatted),
_ => {}
}
let hive_format =
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this was a drive by cleanup to avoid using mut

_ => None,
};

let has_table_keyword = if self.dialect.describe_requires_table_keyword() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is the actual fix, and the rest of the PR is test updated / documentation

@alamb
Copy link
Contributor Author

alamb commented Aug 15, 2024

@iffyio and @git-hulk I would appreciate it if you had a few moments to review this PR given you were involved in #1351

@coveralls
Copy link

coveralls commented Aug 15, 2024

Pull Request Test Coverage Report for Build 10411444248

Details

  • 47 of 52 (90.38%) changed or added relevant lines in 7 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.004%) to 89.139%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/dialect/clickhouse.rs 1 2 50.0%
src/dialect/mod.rs 1 2 50.0%
src/dialect/snowflake.rs 1 2 50.0%
tests/sqlparser_clickhouse.rs 16 17 94.12%
tests/sqlparser_snowflake.rs 16 17 94.12%
Totals Coverage Status
Change from base Build 10404222889: -0.004%
Covered Lines: 28291
Relevant Lines: 31738

💛 - Coveralls

@alamb alamb mentioned this pull request Aug 15, 2024
5 tasks
Copy link
Contributor

@samuelcolvin samuelcolvin left a comment

Choose a reason for hiding this comment

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

Otherwise LGTM.

@git-hulk
Copy link
Member

@alamb Thanks for your fix, as well as thanks for @samuelcolvin finding this regression.

Copy link
Contributor

@iffyio iffyio left a comment

Choose a reason for hiding this comment

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

LGTM!

@alamb
Copy link
Contributor Author

alamb commented Aug 16, 2024

Thanks for the reviews @samuelcolvin @iffyio and @git-hulk -- let's ship this release! 🚀

@alamb alamb merged commit dd78084 into apache:main Aug 16, 2024
10 checks passed
ayman-sigma pushed a commit to sigmacomputing/sqlparser-rs that referenced this pull request Nov 19, 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.

Regression: describe table; is now invalid, wasn't previously
5 participants