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

[#4845] fix(core): Fix bugs when updating metalake or catalog with nullable comment. #4846

Merged
merged 2 commits into from
Sep 4, 2024

Conversation

yuqi1129
Copy link
Contributor

@yuqi1129 yuqi1129 commented Sep 3, 2024

What changes were proposed in this pull request?

Change the update SQL in the mapper to handle nullable comment.

Why are the changes needed?

It's a bug to fix.

Fix: #4845

Does this PR introduce any user-facing change?

N/A

How was this patch tested?

Added UTs and ITs

@jerryshao
Copy link
Contributor

Do we have similar issue for "topic"?

@yuqi1129
Copy link
Contributor Author

yuqi1129 commented Sep 4, 2024

Do we have similar issue for "topic"?

This problem only occurs in conditions like where or on predicate and the root cause is

select null = null 

will return false.

The update method for "topic" is insert into xxx on duplicate key update set....,comment = xxx and has no similar problem.

@yuqi1129
Copy link
Contributor Author

yuqi1129 commented Sep 4, 2024

This PR is an improvement for #4541.

@jerryshao jerryshao added the branch-0.6 Automatically cherry-pick commit to branch-0.6 label Sep 4, 2024
@@ -150,7 +150,8 @@ CatalogPO selectCatalogMetaByMetalakeIdAndName(
+ " AND metalake_id = #{oldCatalogMeta.metalakeId}"
+ " AND type = #{oldCatalogMeta.type}"
+ " AND provider = #{oldCatalogMeta.provider}"
+ " AND catalog_comment = #{oldCatalogMeta.catalogComment}"
+ " AND (catalog_comment = #{oldCatalogMeta.catalogComment} "
+ " or (catalog_comment is null and #{oldCatalogMeta.catalogComment} is null))"
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you please change to "IS NULL" for reserved words?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

DONE

@jerryshao jerryshao merged commit 8ae10cc into apache:main Sep 4, 2024
28 checks passed
github-actions bot pushed a commit that referenced this pull request Sep 4, 2024
…llable comment. (#4846)

### What changes were proposed in this pull request?

Change the update SQL in the mapper to handle nullable comment. 

### Why are the changes needed?

It's a bug to fix.

Fix: #4845 

### Does this PR introduce _any_ user-facing change?

N/A

### How was this patch tested?

Added UTs and ITs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
branch-0.6 Automatically cherry-pick commit to branch-0.6
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug report] Update a metalake with null comment failed
2 participants