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

Relation visitor fails to visit the SHOW COLUMNS statement in the latest commit of the main branch #1554

Closed
goldmedal opened this issue Nov 26, 2024 · 6 comments · Fixed by #1556

Comments

@goldmedal
Copy link
Contributor

Description

This problem can be reproduced by adding a test case at

fn test_sql() {
let tests = vec![
(

Consider a case

            (
                "SHOW COLUMNS FROM t1",
                vec![
                    "PRE: STATEMENT: SHOW COLUMNS FROM t1",
                    "PRE: RELATION: t1",
                    "POST: RELATION: t1",
                    "POST: STATEMENT: SHOW COLUMNS FROM t1",
                ],
            ),

The test case is passed in the previous release tag v0.52.0-rc3. However, in the latest commit of the main branch 525d178 , the test fails and the result is

     "PRE: STATEMENT: SHOW COLUMNS FROM t1",
     "POST: STATEMENT: SHOW COLUMNS FROM t1",

It may cause the upstream project, DataFusion, to fail to execute the SHOW COLUMNS FROM xxx SQL.
https://github.com/apache/datafusion/blob/18fc103a403ab0efe5245dd4352f3f3b93c2a4fe/datafusion/core/src/execution/session_state.rs#L540

@goldmedal
Copy link
Contributor Author

I think the reason is we changed the table name to Option<ObjectName> in #1501 but the visitor can only recognize the ObjectName. 🤔

pub struct ShowStatementIn {
pub clause: ShowStatementInClause,
pub parent_type: Option<ShowStatementInParentType>,
pub parent_name: Option<ObjectName>,

@alamb
Copy link
Contributor

alamb commented Nov 26, 2024

Thank you for debugging this @goldmedal 🙏

I was wondering why that test was failing on

@alamb
Copy link
Contributor

alamb commented Nov 26, 2024

I suspect this was introduced by this PR from @yoavcloud

Any chance you can help us fix it @yoavcloud?

@goldmedal
Copy link
Contributor Author

Thank you for debugging this @goldmedal 🙏

I was wondering why that test was failing on

I tried to support to visit the option field by #1556

@yoavcloud
Copy link
Contributor

Apologies for the regression here, I'm still learning my way around the project. Looks like @goldmedal has a PR already that addresses this issue.

@alamb
Copy link
Contributor

alamb commented Nov 27, 2024

No problems -- clearly we don't have good test coverage for this either 🤔

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 a pull request may close this issue.

3 participants