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

[CALCITE-5553] noFlatteningForInput handles single field structs #3092

Closed
wants to merge 2 commits into from

Conversation

apilloud
Copy link
Member

@apilloud apilloud commented Mar 2, 2023

No description provided.

@apilloud apilloud changed the title Calcite RelStructuredTypeFlattener produces bad plan for single field structs [CALCITE-5553] Calcite RelStructuredTypeFlattener produces bad plan for single field structs Mar 2, 2023
@apilloud apilloud changed the title [CALCITE-5553] Calcite RelStructuredTypeFlattener produces bad plan for single field structs [CALCITE-5553] noFlatteningForInput handles single field structs Mar 6, 2023
@apilloud apilloud force-pushed the wrongplan branch 3 times, most recently from bc800cc to 62031a6 Compare March 6, 2023 22:38
Copy link
Member

@libenchao libenchao left a comment

Choose a reason for hiding this comment

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

@apilloud Thanks for your PR, the fix looks good to me generally, I've only two minor comments about the tests.

// and "SAL" is visible but must be greater than 1000,
// which is the equivalent of:
// Same columns as "EMP" amd "EMPNULLABLES", but "DEPTNO" not visible and set to 20 by default
// and "SAL" is visible but must be greater than 1000, which is the equivalent of:
Copy link
Member

Choose a reason for hiding this comment

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

Is it necessary to do this comment reformatting?

Copy link
Member Author

@apilloud apilloud Mar 9, 2023

Choose a reason for hiding this comment

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

Without the comment reformatting I get the following test failure:

/home/runner/work/calcite/calcite/testkit/src/main/java/org/apache/calcite/test/catalog/MockCatalogReaderSimple.java:79:3:
Method length is 376 lines (max allowed is 370). [MethodLength]

This seemed like the simplest change, but I'm happy to do something else instead.

Copy link
Member

Choose a reason for hiding this comment

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

I see, then we'd better split this method into smaller ones in a separate issue, and I'm ok for this workaround in this one.

Copy link
Member

Choose a reason for hiding this comment

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

I've logged CALCITE-5574 for this.

Copy link
Member

@libenchao libenchao left a comment

Choose a reason for hiding this comment

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

@apilloud Thanks for the updating, the changes looks good now. There is only one thing left, the tests fails due to the orderness in SqlToRelConverterTest.xml.

// and "SAL" is visible but must be greater than 1000,
// which is the equivalent of:
// Same columns as "EMP" amd "EMPNULLABLES", but "DEPTNO" not visible and set to 20 by default
// and "SAL" is visible but must be greater than 1000, which is the equivalent of:
Copy link
Member

Choose a reason for hiding this comment

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

I see, then we'd better split this method into smaller ones in a separate issue, and I'm ok for this workaround in this one.

@sonarcloud
Copy link

sonarcloud bot commented Mar 10, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

Copy link
Member

@libenchao libenchao left a comment

Choose a reason for hiding this comment

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

+1, will merge after the main branch is open.

// and "SAL" is visible but must be greater than 1000,
// which is the equivalent of:
// Same columns as "EMP" amd "EMPNULLABLES", but "DEPTNO" not visible and set to 20 by default
// and "SAL" is visible but must be greater than 1000, which is the equivalent of:
Copy link
Member

Choose a reason for hiding this comment

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

I've logged CALCITE-5574 for this.

@libenchao libenchao closed this in 5ee1b1b Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants