Pinned fields
Click on the next to a field label to start pinning.
Details
Assignee
UnassignedUnassignedReporter
Arjan BalArjan BalComponents
Priority
Major
Details
Details
Assignee
Unassigned
UnassignedReporter
Arjan Bal
Arjan BalComponents
Priority
Created August 10, 2023 at 4:52 AM
Updated August 10, 2023 at 5:08 AM
When the input schema for the oracle sink is provided as a macro as shown in [1] and it contains lowercase column names like [2], the oracle sink writes the correct number of records to the sink, but all the column values are NULL. This happens because by default all column names in oracle are uppercase. Quoted identifiers can be used to provide lowercase column names. At this line in the code the code attempts to get the field with name in upper case (e.g: PROJECT_NUMBER). This is because oracle returns the column names in upper case by default. The schema that is specified in the macro has the field names in lower case (e.g: project_number). So we get a
null
field as the result.We should:
Not write NULLs to the DB without some kind of warning in the logs so that its easier to debug.
When the schema is provided without a macro and contains lowercase column names, the sink plugin writes correct data. So there is an inconsistency in behaviour when schema is provided as a macro and when it is provided directly. So users can’t export the schema and use the same value as a macro. We should make both behaviour similar.
A known workaround is to provide column names in uppercase when using macros.
[1]
[2] "{\"type\":\"record\",\"name\":\"output\",\"fields\":[{\"name\":\"project_number\",\"type\":[\"string\",\"null\"]}]}"