Skip to content

[CALCITE-7431] RelTraitSet#getTrait seems to mishandle RelCompositeTrait#4827

Open
xiedeyantu wants to merge 2 commits intoapache:mainfrom
xiedeyantu:CALCITE-7431
Open

[CALCITE-7431] RelTraitSet#getTrait seems to mishandle RelCompositeTrait#4827
xiedeyantu wants to merge 2 commits intoapache:mainfrom
xiedeyantu:CALCITE-7431

Conversation

@xiedeyantu
Copy link
Member

@xiedeyantu xiedeyantu marked this pull request as draft March 8, 2026 05:04
@xiedeyantu
Copy link
Member Author

I don't know how to make these two systems fully compatible. I support improving the error messages between them. Therefore, this PR doesn't solve the problem. I don't know if it's worthwhile.

@xiedeyantu xiedeyantu marked this pull request as ready for review March 8, 2026 12:53
* {@link RelDistributionTraitDef#INSTANCE} to retrieve all values.
*/
@SuppressWarnings("unchecked")
public <T extends RelDistribution> @Nullable T getDistribution() {
Copy link
Contributor

Choose a reason for hiding this comment

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

If I understand correctly, getTrait and getCollation will throw an error, while getDistribution returns the first element. These are two different strategies. Can you please explain this?

Copy link
Member Author

Choose a reason for hiding this comment

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

This was indeed an overlooked point, and I've already made corrections based on the comments. I'm not sure if this PR will be useful, as it doesn't address the root cause.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 9, 2026

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.

2 participants