Skip to content

feat: Support TABLE keyword with SELECT INTO#487

Merged
alamb merged 1 commit intoapache:mainfrom
cube-js:upstream-select-into-temporary-table
May 9, 2022
Merged

feat: Support TABLE keyword with SELECT INTO#487
alamb merged 1 commit intoapache:mainfrom
cube-js:upstream-select-into-temporary-table

Conversation

@MazterQyou
Copy link
Copy Markdown
Contributor

This PR adds support for TABLE keyword with SELECT INTO queries which is valid as per PostgreSQL docs.
This allows processing queries like SELECT * INTO TEMPORARY TABLE "tmp" FROM (SELECT 1 AS COL) AS CHECKTEMP which otherwise would fail as TABLE would be parsed as a table name.

Copy link
Copy Markdown
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.

Looks good -- thank you @MazterQyou

Comment thread src/ast/query.rs
pub struct SelectInto {
pub temporary: bool,
pub unlogged: bool,
pub table: bool,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I like that this follows the rest of the crate's design to mirror the input syntax in the crated AST

👍

@alamb alamb merged commit 6b2fc81 into apache:main May 9, 2022
@coveralls
Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 2295027689

  • 4 of 5 (80.0%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.009%) to 90.435%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/parser.rs 1 2 50.0%
Totals Coverage Status
Change from base Build 2283154339: -0.009%
Covered Lines: 8178
Relevant Lines: 9043

💛 - Coveralls

@MazterQyou MazterQyou deleted the upstream-select-into-temporary-table branch May 9, 2022 19:07
MazterQyou added a commit to cube-js/sqlparser-rs that referenced this pull request May 9, 2022
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.

3 participants