[jira] [Updated] (KAFKA-5972) Flatten SMT does not work with null values
[ https://issues.apache.org/jira/browse/KAFKA-5972?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Greg Harris updated KAFKA-5972: --- Fix Version/s: 2.2.2 2.4.0 2.3.1 2.1.2 2.0.2 1.1.2 1.0.3 > Flatten SMT does not work with null values > -- > > Key: KAFKA-5972 > URL: https://issues.apache.org/jira/browse/KAFKA-5972 > Project: Kafka > Issue Type: Bug > Components: KafkaConnect >Affects Versions: 0.11.0.0, 0.11.0.1 >Reporter: Tomas Zuklys >Assignee: siva santhalingam >Priority: Minor > Labels: easyfix, patch > Fix For: 1.0.3, 1.1.2, 2.0.2, 2.1.2, 2.2.2, 2.4.0, 2.3.1 > > Attachments: kafka-transforms.patch > > > Hi, > I noticed a bug in Flatten SMT while doing tests with different SMTs that are > provided out-of-box. > Flatten SMT does not work as expected with schemaless JSON that has > properties with null values. > Example json: > {code} > {A={D=dValue, B=null, C=cValue}} > {code} > The issue is in if statement that checks for null value. > Current version: > {code} > for (Map.Entry entry : originalRecord.entrySet()) { > final String fieldName = fieldName(fieldNamePrefix, > entry.getKey()); > Object value = entry.getValue(); > if (value == null) { > newRecord.put(fieldName(fieldNamePrefix, entry.getKey()), > null); > return; > } > ... > {code} > should be > {code} > for (Map.Entry entry : originalRecord.entrySet()) { > final String fieldName = fieldName(fieldNamePrefix, > entry.getKey()); > Object value = entry.getValue(); > if (value == null) { > newRecord.put(fieldName(fieldNamePrefix, entry.getKey()), > null); > continue; > } > {code} > I have attached a patch containing the fix for this issue. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Updated] (KAFKA-5972) Flatten SMT does not work with null values
[ https://issues.apache.org/jira/browse/KAFKA-5972?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Tomas Zuklys updated KAFKA-5972: Affects Version/s: 0.11.0.1 > Flatten SMT does not work with null values > -- > > Key: KAFKA-5972 > URL: https://issues.apache.org/jira/browse/KAFKA-5972 > Project: Kafka > Issue Type: Bug > Components: KafkaConnect >Affects Versions: 0.11.0.0, 0.11.0.1 >Reporter: Tomas Zuklys >Priority: Minor > Labels: easyfix, patch > Attachments: kafka-transforms.patch > > > Hi, > I noticed a bug in Flatten SMT while doing tests with different SMTs that are > provided out-of-box. > Flatten SMT does not work as expected with schemaless JSON that has > properties with null values. > Example json: > {code} > {A={D=dValue, B=null, C=cValue}} > {code} > The issue is in if statement that checks for null value. > Current version: > {code} > for (Map.Entryentry : originalRecord.entrySet()) { > final String fieldName = fieldName(fieldNamePrefix, > entry.getKey()); > Object value = entry.getValue(); > if (value == null) { > newRecord.put(fieldName(fieldNamePrefix, entry.getKey()), > null); > return; > } > ... > {code} > should be > {code} > for (Map.Entry entry : originalRecord.entrySet()) { > final String fieldName = fieldName(fieldNamePrefix, > entry.getKey()); > Object value = entry.getValue(); > if (value == null) { > newRecord.put(fieldName(fieldNamePrefix, entry.getKey()), > null); > continue; > } > {code} > I have attached a patch containing the fix for this issue. -- This message was sent by Atlassian JIRA (v6.4.14#64029)