Skip to content

[CALCITE-6300] Function MAP_VALUES/MAP_KEYS gives exception when mapVauleType and mapKeyType not equals map Biggest mapKeytype or mapValueType#4853

Merged
caicancai merged 1 commit intoapache:mainfrom
caicancai:6300
Apr 2, 2026

Conversation

@caicancai
Copy link
Copy Markdown
Member

@caicancai caicancai commented Mar 27, 2026

@caicancai
Copy link
Copy Markdown
Member Author

caicancai commented Mar 27, 2026

@mihaibudiu Let's fix this problem completely. I will continue to follow up on this.

if (operandTypes.get(i).getSqlTypeName()
!= targetType.getSqlTypeName()) {
call.setOperand(i,
SqlStdOperatorTable.CAST.createCall(SqlParserPos.ZERO,
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.

The newly created cast node will not have a type in the typemap. You have to insert it there as well.

Copy link
Copy Markdown
Member Author

@caicancai caicancai Mar 29, 2026

Choose a reason for hiding this comment

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

@mihaibudiu done, thanks

@caicancai caicancai requested a review from mihaibudiu March 29, 2026 13:24
Copy link
Copy Markdown
Contributor

@mihaibudiu mihaibudiu left a comment

Choose a reason for hiding this comment

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

I hope this is fine. I thought I had opened an issue about this subject, but I couldn't find it anymore. It contained a failing test case.

…auleType and mapKeyType not equals map Biggest mapKeytype or mapValueType
@caicancai caicancai added the LGTM-will-merge-soon Overall PR looks OK. Only minor things left. label Apr 2, 2026
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 2, 2026

@caicancai caicancai merged commit ac81f75 into apache:main Apr 2, 2026
20 of 35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

LGTM-will-merge-soon Overall PR looks OK. Only minor things left.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants