Skip to content

Conversation

@strongduanmu
Copy link
Member

@strongduanmu strongduanmu marked this pull request as draft September 24, 2025 11:07
@strongduanmu strongduanmu marked this pull request as ready for review September 24, 2025 11:31
}
boolean inferred = false;
for (SqlNode child : nodeList) {
if (child instanceof SqlBasicCall && SqlKind.ROW == child.getKind()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

There are expressions that evaluate to a ROW type that are not ROW expressions.
For example, a[1], where a is an array of ROW values.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for bringing this up, I might not have considered it before. Can you give a sql example? I will continue to analyze the possible problems in this scenario.

Copy link
Contributor

Choose a reason for hiding this comment

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

LogicalValues(tuples=[[{ 1, 2 }, { 3, null }, { 7369, null }, { 7499, 30 }, { null, 20 }, { null, 5 }]])
LogicalAggregate(group=[{0, 1}])
LogicalValues(tuples=[[{ 1, 2 }, { 3, null }, { 7369, null }, { null, 20 }, { null, 5 }, { 7499, 30 }]])
LogicalValues(tuples=[[{ 1, 2 }, { null, 20 }, { 3, null }, { 7369, null }, { 7499, 30 }, { null, 5 }]])
Copy link
Member

Choose a reason for hiding this comment

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

Maybe what I want to ask is this—why has the order changed here? Is this necessary?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, it's neccessay. This order is generated by the UnionToValuesRule rule based on planBefore. For details, see the corresponding relationship in the following figure.

image

@sonarqubecloud
Copy link

@github-actions
Copy link

This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 90 days if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@calcite.apache.org list. Thank you for your contributions.

@github-actions github-actions bot added the stale label Nov 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants