Skip to content

[CALCITE-6027] Simplify the cardinality on map_keys and map_values functions#5037

Open
xuzifu666 wants to merge 1 commit into
apache:mainfrom
xuzifu666:calcite-6027
Open

[CALCITE-6027] Simplify the cardinality on map_keys and map_values functions#5037
xuzifu666 wants to merge 1 commit into
apache:mainfrom
xuzifu666:calcite-6027

Conversation

@xuzifu666

Copy link
Copy Markdown
Member

@sonarqubecloud

Copy link
Copy Markdown


// Simplify CARDINALITY(MAP_KEYS(m)) -> CARDINALITY(m)
// and CARDINALITY(MAP_VALUES(m)) -> CARDINALITY(m)
if (e.getOperator().getName().equals("CARDINALITY")

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.

Do you expect people write such programs?
There's potentially an infinite number of such optimizations we can consider, but are they useful in practice?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

You are right. This is indeed an overly restrictive optimization, with little value; I currently share this view. Perhaps the value of Jira needs further discussion.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I had moved the discussion to jira.

@xuzifu666 xuzifu666 added the discussion-in-jira There's open discussion in JIRA to be resolved before proceeding with the PR label Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

discussion-in-jira There's open discussion in JIRA to be resolved before proceeding with the PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants