How Does a Schema Support Default Fields or NULL Fields?
A source data schema is a user's JSON data sample used to describe the JSON data format. DIS can generate the Avro schema based on the JSON data sample. By default, the default field or NULL is not supported, as shown in Figure 1.
The type of the key1 field is String (type: string in Avro Schema). If the key1 field in the source data is not transferred or the transferred value is null, the dump task reports an error.
To enable the schema generated based on the JSON data sample supports the default value or null, select the Convert and Move and click Convert Source Data Sample, as shown in Figure 2.
In this case, the type of the key1 field is Union (type: [null, string] in Avro Schema). If the key1 field in the source data is not transferred or the transferred value is null, null is automatically filled as the default value. The dump task can properly convert the format.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot