Skip to content

Commit

Permalink
ALS-6511: Fix null value handling
Browse files Browse the repository at this point in the history
  • Loading branch information
ramari16 committed Jul 22, 2024
1 parent bc1cda5 commit d149826
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public void writeHeader(String[] data) {
SchemaBuilder.FieldAssembler<Schema> patientRecords = SchemaBuilder.record("patientData")
.fields();

fields.forEach(patientRecords::requiredString);
fields.forEach(field -> patientRecords.nullableString(field, "null"));
patientDataSchema = patientRecords.endRecord();

Schema objectSchema = Schema.createUnion(metadataSchema, patientDataSchema);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public void writeValidPFB() {
pfbWriter.writeHeader(new String[] {"\\demographics\\age\\", "\\phs123\\stroke\\"});
pfbWriter.writeEntity(List.of(new String[]{"80", "Y"},
new String[]{"70", "N"},
new String[]{"75", "N"}
new String[]{"75", null}
));
pfbWriter.close();
// todo: validate this programatically
Expand Down

0 comments on commit d149826

Please sign in to comment.