Skip to content

Commit

Permalink
check the returned bin map for null
Browse files Browse the repository at this point in the history
  • Loading branch information
reugn committed Nov 29, 2023
1 parent 89a3d9a commit ba9429c
Showing 1 changed file with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,16 @@ public static List<DataColumn> getSchema(SchemaTableName schemaTableName, IAeros

client.scanAll(policy, schemaTableName.getSchemaName(), toSet(schemaTableName.getTableName()), (key, rec) -> {
Map<String, Object> bins = rec.bins;
bins.forEach((k, value) -> {
logger.fine(() -> String.format("Bin: %s -> %s", k, value));
int t = getBinType(value);
if (k != null && t != 0) {
columnHandles.put(k, new DataColumn(schemaTableName.getSchemaName(),
schemaTableName.getTableName(), t, k, k));
}
});
if (bins != null) {
bins.forEach((k, value) -> {
logger.fine(() -> String.format("Bin: %s -> %s", k, value));
int t = getBinType(value);
if (k != null && t != 0) {
columnHandles.put(k, new DataColumn(schemaTableName.getSchemaName(),
schemaTableName.getTableName(), t, k, k));
}
});
}
});

List<DataColumn> columns = new ArrayList<>(columnHandles.values());
Expand Down

0 comments on commit ba9429c

Please sign in to comment.