Skip to content

Commit 36899ed

Browse files
author
davitbzh
committed
handle null values for complex features
1 parent 7f71890 commit 36899ed

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

java/hsfs/src/main/java/com/logicalclocks/hsfs/engine/VectorServer.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -423,8 +423,12 @@ private void refreshJdbcConnection(FeatureStoreBase featureStoreBase, Boolean ex
423423

424424
private Object deserializeComplexFeature(Map<String, DatumReader<Object>> complexFeatureSchemas, ResultSet results,
425425
int index) throws SQLException, IOException {
426-
Decoder decoder = DecoderFactory.get().binaryDecoder(results.getBytes(index), binaryDecoder);
427-
return complexFeatureSchemas.get(results.getMetaData().getColumnName(index)).read(null, decoder);
426+
if (results.getBytes(index) != null) {
427+
Decoder decoder = DecoderFactory.get().binaryDecoder(results.getBytes(index), binaryDecoder);
428+
return complexFeatureSchemas.get(results.getMetaData().getColumnName(index)).read(null, decoder);
429+
} else {
430+
return null;
431+
}
428432
}
429433

430434
private Map<String, DatumReader<Object>> getComplexFeatureSchemas(List<TrainingDatasetFeature> features)

0 commit comments

Comments
 (0)