close
Skip to content

[Fix][MongoDB] The Long type cannot handle string values in scientific notation#8783

Merged
hailin0 merged 7 commits into
apache:devfrom
qifanlili:dev
Apr 7, 2025
Merged

[Fix][MongoDB] The Long type cannot handle string values in scientific notation#8783
hailin0 merged 7 commits into
apache:devfrom
qifanlili:dev

Conversation

@qifanlili

Copy link
Copy Markdown
Contributor

Purpose of this pull request

The purpose is to fix bug: 8775

Does this PR introduce any user-facing change?

How was this patch tested?

Check list

@qifanlili qifanlili changed the title [Fix][MongoDB] The Long type cannot handle string values in scientific notation. [Fix][MongoDB] The Long type cannot handle string values in scientific notation. #8775 Feb 21, 2025

@Hisoka-X Hisoka-X left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

author lee <liqifan@cvte.com> 1740121208 +0800
committer lee <liqifan@cvte.com> 1741076125 +0800

parent a3a7b49
author lee <liqifan@cvte.com> 1740121208 +0800
committer lee <liqifan@cvte.com> 1741076105 +0800

[Fix][MongoDB] The Long type cannot handle string values in scientific notation. (apache#8783)
@github-actions github-actions Bot added document core SeaTunnel core module and removed mongodb labels Mar 4, 2025
@qifanlili

Copy link
Copy Markdown
Contributor Author

@qifanlili

Copy link
Copy Markdown
Contributor Author

@Hisoka-X Any other questions here?

Comment on lines +76 to +78
Method method = SamplingSplitStrategy.class.getDeclaredMethod("getDocumentNumAndAvgSize");
method.setAccessible(true);
ImmutablePair<Long, Long> result = (ImmutablePair<Long, Long>) method.invoke(strategy);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Try not to use reflection to test your code. Let's set getDocumentNumAndAvgSize scope to default and add @VisibleForTesting annotation. Then you can invoke it in here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the suggestion, I have modified it to see if there are any other issues. I need to modify the visibility of getDocumentNumAndAvgSize if I use @VisibleForTesting, private doesn't work.

@Hisoka-X Hisoka-X left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM if ci passes. Thanks @qifanlili

@Hisoka-X Hisoka-X changed the title [Fix][MongoDB] The Long type cannot handle string values in scientific notation. #8775 [Fix][MongoDB] The Long type cannot handle string values in scientific notation Apr 7, 2025
@Hisoka-X Hisoka-X requested a review from hailin0 April 7, 2025 09:51
@hailin0 hailin0 merged commit 00f550e into apache:dev Apr 7, 2025
qifanlili added a commit to qifanlili/seatunnel that referenced this pull request Apr 14, 2025
author lee <liqifan@cvte.com> 1740121208 +0800
committer lee <liqifan@cvte.com> 1741076125 +0800

parent a3a7b49
author lee <liqifan@cvte.com> 1740121208 +0800
committer lee <liqifan@cvte.com> 1741076105 +0800

[Fix][MongoDB] The Long type cannot handle string values in scientific notation. (apache#8783)
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.

[Bug] [MongoDB] collStats 的值太大,Long类型无法处理科学计数法表示的字符串数值

3 participants