Skip to content

Commit

Permalink
Add required column schema
Browse files Browse the repository at this point in the history
  • Loading branch information
qqndrew committed Mar 9, 2023
1 parent 093efe1 commit eb3ff76
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,7 @@ public void init() throws ComponentInitializationException {
}

@Override
public boolean hasRequiredColumns() {
return true;
}

@Override
public Schema getRequiredColumns() {
public Schema getRequiredColumns(String inputTag) {
return Schema.of(
Schema.Field.of(this.noteIdField, Schema.FieldType.STRING),
Schema.Field.of(this.inputField, Schema.FieldType.STRING)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,21 @@ public Schema calculateOutputSchema(Schema schema) {
return this.schema;
}

@Override
public Schema getRequiredColumns(String inputTag) {
return Schema.of(
Schema.Field.of("nlp_run_dtm", Schema.FieldType.DATETIME),
Schema.Field.of("certainty", Schema.FieldType.STRING),
Schema.Field.of("experiencer", Schema.FieldType.STRING),
Schema.Field.of("status", Schema.FieldType.STRING),
Schema.Field.of("offset", Schema.FieldType.INT32),
Schema.Field.of("concept_code", Schema.FieldType.STRING),
Schema.Field.of("section_id", Schema.FieldType.INT32),
Schema.Field.of("matched_text", Schema.FieldType.STRING),
Schema.Field.of("matched_sentence", Schema.FieldType.STRING)
);
}

@Override
public PCollection<Row> expand(PCollection<Row> input) {
return input.apply(ParDo.of(new DoFn<Row, Row>() {
Expand Down

0 comments on commit eb3ff76

Please sign in to comment.