Skip to content

Fix: Schema Length Mismatch for ObjectId Non-id Fields in Collections#588

Merged
JNSimba merged 2 commits into
apache:masterfrom
kwonder0926:master
Apr 21, 2025
Merged

Fix: Schema Length Mismatch for ObjectId Non-id Fields in Collections#588
JNSimba merged 2 commits into
apache:masterfrom
kwonder0926:master

Conversation

@kwonder0926
Copy link
Copy Markdown
Contributor

Proposed changes

When a non-id field in a collection has a value of ObjectId type, an error is reported with the following message:

Reason: column_name[objectIdField], the length of input is too long than schema. first 32 bytes of input str: [{‘$oid’:‘67f8e2503d1bd029812b776’}] schema length: 30; actual length: 35; . src line [];

This occurs because when the ObjectId is converted to a string, it takes the form: {‘$oid’:‘67f8e2503d1bd029812b7767’}. The length becomes 35, which exceeds the predefined varchar(30) limit.

Problem Summary:

Checklist(Required)

Does it affect the original behavior: No
Has unit tests been added: No Need
Has document been added or modified: No Need
Does it need to update dependencies: No)
Are there any changes that cannot be rolled back: No

Further comments

Only the length of the ObjectId type when converted to Varchar type was changed.

Copy link
Copy Markdown
Member

@JNSimba JNSimba left a comment

Choose a reason for hiding this comment

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

LGTM

@JNSimba JNSimba merged commit 280bd66 into apache:master Apr 21, 2025
6 checks passed
@JNSimba JNSimba mentioned this pull request Apr 24, 2025
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