Skip to content

Commit

Permalink
FMWK-266 Ignore null keys in schema builder (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
reugn authored Nov 29, 2023
1 parent 4a86ab3 commit 659f49a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 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 (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
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import java.math.BigDecimal;
import java.sql.Statement;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.logging.Logger;

Expand Down Expand Up @@ -56,7 +55,7 @@ public String getString(String columnLabel) {
if (columnLabel.equals(defaultKeyName)) {
return getUserKey().map(Value::toString).orElse(null);
}
return getBin(columnLabel).map(Objects::toString).orElse(null);
return getBin(columnLabel).map(Object::toString).orElse(null);
}

@Override
Expand Down

0 comments on commit 659f49a

Please sign in to comment.