-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[FLINK-36999][cdc-source-connectors] When the source type is oracle and field type is nember and the value is null, a null pointer exception occurs during deserialization. #3833
base: master
Are you sure you want to change the base?
Conversation
…cimal and the value is null, a null pointer exception occurs during deserialization.
source oracle table structure: When the pwd_sms_tel field value of the nember type is null, a null pointer exception will be reported. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@linjianchang Thanks for your contributions. I left some comments.
@@ -188,6 +188,10 @@ protected DataType inferBytes(Object value, Schema schema) { | |||
protected DataType inferStruct(Object value, Schema schema) { | |||
Struct struct = (Struct) value; | |||
if (VariableScaleDecimal.LOGICAL_NAME.equals(schema.name())) { | |||
if (struct == null) { | |||
// set the default value | |||
return DataTypes.DECIMAL(10, 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return DataTypes.DECIMAL(10, 0); | |
return DataTypes.DECIMAL(DecimalType.DEFAULT_PRECISION, DecimalType.DEFAULT_SCALE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@linjianchang Can you add unit test for this scenario?
When the source type is oracle and field type is nember and the value is null, a null pointer exception occurs during deserialization.